Skip to content

Commit 10d9697

Browse files
authored
chore: remove unused #region comments (#1181)
1 parent f94c9d7 commit 10d9697

File tree

1 file changed

+0
-20
lines changed

1 file changed

+0
-20
lines changed

rule/string_format.go

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ import (
1111
"github.com/mgechev/revive/lint"
1212
)
1313

14-
// #region Revive API
15-
1614
// StringFormatRule lints strings and/or comments according to a set of regular expressions given as Arguments
1715
type StringFormatRule struct{}
1816

@@ -56,10 +54,6 @@ func (StringFormatRule) ParseArgumentsTest(arguments lint.Arguments) *string {
5654
return nil
5755
}
5856

59-
// #endregion
60-
61-
// #region Internal structure
62-
6357
type lintStringFormatRule struct {
6458
onFailure func(lint.Failure)
6559
rules []stringFormatSubrule
@@ -87,10 +81,6 @@ const identRegex = "[_A-Za-z][_A-Za-z0-9]*"
8781
var parseStringFormatScope = regexp.MustCompile(
8882
fmt.Sprintf("^(%s(?:\\.%s)?)(?:\\[([0-9]+)\\](?:\\.(%s))?)?$", identRegex, identRegex, identRegex))
8983

90-
// #endregion
91-
92-
// #region Argument parsing
93-
9484
func (w *lintStringFormatRule) parseArguments(arguments lint.Arguments) {
9585
for i, argument := range arguments {
9686
scopes, regex, negated, errorMessage := w.parseArgument(argument, i)
@@ -196,10 +186,6 @@ func (lintStringFormatRule) parseScopeError(msg string, ruleNum, option, scopeNu
196186
panic(fmt.Sprintf("failed to parse configuration for string-format: %s [argument %d, option %d, scope index %d]", msg, ruleNum, option, scopeNum))
197187
}
198188

199-
// #endregion
200-
201-
// #region Node traversal
202-
203189
func (w lintStringFormatRule) Visit(node ast.Node) ast.Visitor {
204190
// First, check if node is a call expression
205191
call, ok := node.(*ast.CallExpr)
@@ -247,10 +233,6 @@ func (lintStringFormatRule) getCallName(call *ast.CallExpr) (callName string, ok
247233
return "", false
248234
}
249235

250-
// #endregion
251-
252-
// #region Linting logic
253-
254236
// apply a single format rule to a call expression (should be done after verifying the that the call expression matches the rule's scope)
255237
func (r *stringFormatSubrule) apply(call *ast.CallExpr, scope *stringFormatSubruleScope) {
256238
if len(call.Args) <= scope.argument {
@@ -324,5 +306,3 @@ func (r *stringFormatSubrule) generateFailure(node ast.Node) {
324306
Node: node,
325307
})
326308
}
327-
328-
// #endregion

0 commit comments

Comments
 (0)