diff options
author | 6543 <6543@obermui.de> | 2022-01-20 18:46:10 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-20 18:46:10 +0100 |
commit | 54e9ee37a7a301dbe74d46fd3c87712e6120e9bf (patch) | |
tree | 1be12fb072625c1b896b9d72f7912b018aad502b /modules/validation/binding.go | |
parent | 1d98d205f5825f40110e6628b61a97c91ac7f72d (diff) | |
download | gitea-54e9ee37a7a301dbe74d46fd3c87712e6120e9bf.tar.gz gitea-54e9ee37a7a301dbe74d46fd3c87712e6120e9bf.zip |
format with gofumpt (#18184)
* gofumpt -w -l .
* gofumpt -w -l -extra .
* Add linter
* manual fix
* change make fmt
Diffstat (limited to 'modules/validation/binding.go')
-rw-r--r-- | modules/validation/binding.go | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/modules/validation/binding.go b/modules/validation/binding.go index 5d5c64611f..7baa36ccc5 100644 --- a/modules/validation/binding.go +++ b/modules/validation/binding.go @@ -24,16 +24,13 @@ const ( ErrRegexPattern = "RegexPattern" ) -var ( - // GitRefNamePatternInvalid is regular expression with unallowed characters in git reference name - // They cannot have ASCII control characters (i.e. bytes whose values are lower than \040, or \177 DEL), space, tilde ~, caret ^, or colon : anywhere. - // They cannot have question-mark ?, asterisk *, or open bracket [ anywhere - GitRefNamePatternInvalid = regexp.MustCompile(`[\000-\037\177 \\~^:?*[]+`) -) +// GitRefNamePatternInvalid is regular expression with unallowed characters in git reference name +// They cannot have ASCII control characters (i.e. bytes whose values are lower than \040, or \177 DEL), space, tilde ~, caret ^, or colon : anywhere. +// They cannot have question-mark ?, asterisk *, or open bracket [ anywhere +var GitRefNamePatternInvalid = regexp.MustCompile(`[\000-\037\177 \\~^:?*[]+`) // CheckGitRefAdditionalRulesValid check name is valid on additional rules func CheckGitRefAdditionalRulesValid(name string) bool { - // Additional rules as described at https://www.kernel.org/pub/software/scm/git/docs/git-check-ref-format.html if strings.HasPrefix(name, "/") || strings.HasSuffix(name, "/") || strings.HasSuffix(name, ".") || strings.Contains(name, "..") || |