diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2020-04-04 03:29:12 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-03 22:29:12 +0300 |
commit | 4f63f283c47dcf9e705ce5b8e8857f2b42cff8ad (patch) | |
tree | dd5dc2cae6ebae21826ffcce937533559be45a07 /vendor/github.com/mgechev/revive/lint/rule.go | |
parent | 4af7c47b38d382d105726f9553a1a68d46882cbf (diff) | |
download | gitea-4f63f283c47dcf9e705ce5b8e8857f2b42cff8ad.tar.gz gitea-4f63f283c47dcf9e705ce5b8e8857f2b42cff8ad.zip |
Rename scripts to build and add revive command as a new build tool command (#10942)
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'vendor/github.com/mgechev/revive/lint/rule.go')
-rw-r--r-- | vendor/github.com/mgechev/revive/lint/rule.go | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/vendor/github.com/mgechev/revive/lint/rule.go b/vendor/github.com/mgechev/revive/lint/rule.go new file mode 100644 index 0000000000..815abfdd88 --- /dev/null +++ b/vendor/github.com/mgechev/revive/lint/rule.go @@ -0,0 +1,31 @@ +package lint + +import ( + "go/token" +) + +// DisabledInterval contains a single disabled interval and the associated rule name. +type DisabledInterval struct { + From token.Position + To token.Position + RuleName string +} + +// Rule defines an abstract rule interaface +type Rule interface { + Name() string + Apply(*File, Arguments) []Failure +} + +// AbstractRule defines an abstract rule. +type AbstractRule struct { + Failures []Failure +} + +// ToFailurePosition returns the failure position. +func ToFailurePosition(start token.Pos, end token.Pos, file *File) FailurePosition { + return FailurePosition{ + Start: file.ToPosition(start), + End: file.ToPosition(end), + } +} |