Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove added colon in comment-spacings rule #981

Merged
merged 3 commits into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions RULES_DESCRIPTIONS.md
chavacava marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -182,15 +182,15 @@ _Description_: Spots comments of the form:

_Configuration_: ([]string) list of exceptions. For example, to accept comments of the form
```go
//mypragma: activate something
chavacava marked this conversation as resolved.
Show resolved Hide resolved
//+optional
```
You need to add `"mypragma"` in the configuration
You need to add `"+optional"` in the configuration
chavacava marked this conversation as resolved.
Show resolved Hide resolved

Example:

```toml
[rule.comment-spacings]
arguments =["mypragma","otherpragma"]
arguments =["+optional", "foo:"]
chavacava marked this conversation as resolved.
Show resolved Hide resolved
```
## confusing-naming

Expand Down
2 changes: 1 addition & 1 deletion rule/comment-spacings.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func (r *CommentSpacingsRule) configure(arguments lint.Arguments) {
if !ok {
panic(fmt.Sprintf("invalid argument %v for %s; expected string but got %T", arg, r.Name(), arg))
}
r.allowList = append(r.allowList, `//`+allow+`:`)
r.allowList = append(r.allowList, `//`+allow)
}
}
}
Expand Down
Loading