Kampfkarren / selene

A blazing-fast modern Lua linter written in Rust

Home Page:https://kampfkarren.github.io/selene/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

chriscerie opened this issue · comments

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

  • Instead of an opt out of duplicate lints, we automatically turn off duplicate lints when luau std is used. Then we can provide an option to opt back in for users who don't use luau-lsp. This would be a breaking change, however.
    • It should be possible for selene's vscode extension to detect if luau-lsp is also installed to prevent false positives. However, we can't reliably detect it in CI environments.

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.

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.