Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork1.5k
lll: ignore comments containing only URL#3986
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:master
Are you sure you want to change the base?
Conversation
Uh oh!
There was an error while loading.Please reload this page.
| lineNumber:=0 | ||
| multiImportEnabled:=false | ||
| urlComment:=regexp.MustCompile(`\s*//\s*http(s)?://[^ ]+$`) |
mattdowdellOct 29, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Would it be possible to also exclude URLs used as reference links? e.g.
Here's a[link] and[another][1]![link]:https://example.com[1]:https://example.com
I sometimes use these references to keep Go docs readable when browsing code (inserting long URLs makes following text hard), and given modern godoc uses markdown, this would likely be universally helpful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
For that I specifically use:
exclude-rules: -linters: -lllsource:"^//\\[.*\\]:\\w+"
batazor commentedNov 29, 2023
Sometimes in the code you have to leave links to tasks in the tracker or links to discussion of some bugs - to understand why it was done this way. And often they are long links, it would be cool to be able to skip such cases by default. |
Uh oh!
There was an error while loading.Please reload this page.
As illustrated in the following example, to ignore long URLs the
nolintdirective should be placed on the top of the comments but this ignoreslllon the whole function..golangci.yml
$golangci-lint run$Fixes#3983