From 5aa7d8e0d6e426716cdb5a47d988e35750101ffb Mon Sep 17 00:00:00 2001 From: Jason Cameron Date: Fri, 13 Jun 2025 16:34:43 -0400 Subject: [PATCH] fix: reorder fields in AnubisRule struct for better alignment --- cmd/robots2policy/main.go | 5 +++-- cmd/robots2policy/testdata/simple.yaml | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cmd/robots2policy/main.go b/cmd/robots2policy/main.go index 3f273714..717e6415 100644 --- a/cmd/robots2policy/main.go +++ b/cmd/robots2policy/main.go @@ -36,12 +36,13 @@ type RobotsRule struct { IsBlacklist bool // true if this is a specifically denied user agent } +//betteralign:ignore, we want name to be the first field type AnubisRule struct { + Name string `yaml:"name" json:"name"` + Action string `yaml:"action" json:"action"` Expression map[string]interface{} `yaml:"expression,omitempty" json:"expression,omitempty"` Challenge *config.ChallengeRules `yaml:"challenge,omitempty" json:"challenge,omitempty"` Weight *config.Weight `yaml:"weight,omitempty" json:"weight,omitempty"` - Name string `yaml:"name" json:"name"` - Action string `yaml:"action" json:"action"` } func main() { diff --git a/cmd/robots2policy/testdata/simple.yaml b/cmd/robots2policy/testdata/simple.yaml index 2b1f4251..980cc452 100644 --- a/cmd/robots2policy/testdata/simple.yaml +++ b/cmd/robots2policy/testdata/simple.yaml @@ -5,4 +5,4 @@ - name: robots-txt-policy-disallow-2 action: CHALLENGE expression: - single: path.startsWith("/private") \ No newline at end of file + single: path.startsWith("/private")