Kampfkarren / selene

A blazing-fast modern Lua linter written in Rust
https://kampfkarren.github.io/selene/
Mozilla Public License 2.0
561 stars 76 forks source link

Add option to turn off duplicate lints serviced by luau-lsp #580

Open chriscerie opened 5 months ago

chriscerie commented 5 months ago

We've heard from several selene + luau-lsp users that duplicate lints of the same thing coming from both tools were annoying enough to turn one off entirely. I propose we add an option to turn off lints that already exist in luau-lsp. This would exist as a selene.toml config so both the cli and extension can consume it.

Note that lints like argument count mismatching are duplicate, but we'd need to handle cases where they deviate or agree depending on the specific case (e.g., passing two args to Instance.new() is allowed by luau-lsp but not selene. In this case we'd keep the warning, but not for other arg count cases where selene and luau-lsp agree).

Alternatives

LastTalon commented 5 months ago

I think it makes sense to not make assumptions about what other tools the user is using; keeping the lints enabled by default and opt-out sounds correct to me.

I think this is something I would definitely use, but I would also want a particular workflow easily supported still. My team uses selene as part of our CI workflow and while it would be useful to have the lints de-duplicated in editor, we don't run Luau lints in our CI workflow, so I would want the ability to keep those lints in CI even if they aren't shown in editor.

chriscerie commented 5 months ago

while it would be useful to have the lints de-duplicated in editor, we don't run Luau lints in our CI workflow

Thanks, this is helpful! Supporting cli and extension toggles independently is definitely possible.