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

Missing option 'exclude' in lll linter settings #3020

Closed
Nitjsefni7 opened this issue Jul 28, 2022 · 3 comments
Closed

Missing option 'exclude' in lll linter settings #3020

Nitjsefni7 opened this issue Jul 28, 2022 · 3 comments
Labels

Comments

@Nitjsefni7
Copy link

Your feature request related to a problem? Please describe.

As I have seen that lll linter allows to set flag --exclude to exclude lines that matches regex, I was wondering if it would be possible to add this option to linter settings in linters configuration. It will be helpful to skip for example structs tags.

Describe the solution you'd like.

Add option -exclude for lll settings

lll:
    tab-width: 4
    line-length: 140
    exclude: <regex>

Describe alternatives you've considered.

For now to omit checking for specific lines comment // nolint: lll have to be used.

Additional context.

No response

@Nitjsefni7 Nitjsefni7 added the enhancement New feature or improvement label Jul 28, 2022
@boring-cyborg
Copy link

boring-cyborg bot commented Jul 28, 2022

Hey, thank you for opening your first Issue ! 🙂 If you would like to contribute we have a guide for contributors.

@ldez
Copy link
Member

ldez commented Jul 28, 2022

Hello,

I recommend using the global exclusions system:
https://golangci-lint.run/usage/false-positives/#exclude-or-skip

For me, it's better than an option inside the linter.

Also, we use a custom implementation of lll (we don't use an external lib) so there are no existing options.

@ldez ldez added declined and removed enhancement New feature or improvement labels Jul 28, 2022
@ldez ldez closed this as completed Jul 28, 2022
@james-johnston-thumbtack

If anyone else comes across this issue, this example shows how to use the global exclusions system: #207 (comment)

it's otherwise not obvious from the documentation that this source: configuration option exists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants