Skip to content

lua: make strict the default for selene and LuaLS #14682

Open

Description

@TrapsterDK

Where

  • quality/tiers/selene/strict.toml:1-28: no almost_swapped, deprecated, empty_loop, if_same_then_else. standard.toml:1: std only.
  • quality/tools/lua/selene.toml:2: scratch config with no bound config is std only.
  • quality/tiers/luals/strict.json:1-10: only no-unknown and unused at Error. standard.json:1-5.
  • quality/adapter/src/commands.rs:131, 1241-1245: LuaLS runs --checklevel=Warning with LuaLS defaults.
  • quality/tools.bzl:2277-2292 (selene), 1496-1499 (luals): no severity(). docs/cli/commands/quality.md:423-424.

Fix

Guard rules (do first):

  • selene deny: undefined_variable, global_usage, unscoped_variables, shadowing, must_use, incorrect_standard_library_use, mismatched_arg_count, unused_variable.
  • LuaLS Error: undefined-global, lowercase-global, global-in-nil-env, need-check-nil, param-type-mismatch, assign-type-mismatch, return-type-mismatch, undefined-field, inject-field, missing-parameter, missing-return, redundant-parameter, discard-returns, deprecated, duplicate-set-field.
  • LuaLS runtime.nonstandardSymbol = [] (no +=, continue, !=). diagnostics.disable = [].

Then:

  • selene strict: add almost_swapped, deprecated, empty_loop, if_same_then_else.
  • LuaLS diagnostics.groupSeverity Error for strict, type-check, duplicate, global, unbalanced, unused, redefined, luadoc, ambiguity. groupFileStatus Any for strict and type-check; drop strong. type.checkTableShape = true, type.weakNilCheck = false, type.weakUnionCheck = false.
  • Use the strict tier when no config is bound (selene scratch config and default luarc).
  • severity() maps for selene and luals. Update quality.md:423-424.

Excluded

selene roblox_*, restricted_module_paths. LuaLS no-unknown, spell-check, codestyle-check, name-style-check, global-element, missing-global-doc, incomplete-signature-doc, await-in-sync, not-yieldable.

Test

  • quality/tiers/tiers_test.rs covers the new keys.
  • Negative fixture per guard (global leak, missing nil check, deprecated call, +=) fails dx lint.
  • Clean fixture passes. tier = "standard" still passes.

Verify every rule ID and flag against the pinned tool version before landing; some come from memory.

Part of #14647

Activity

  1. added
    local
    on Nov 22, 2026
  2. TrapsterDK commented on Nov 22, 2026

    @TrapsterDK
    CollaboratorAuthor

    Paths in this issue are from an old layout. Branch from origin/main; quality code is in core/quality/, wrappers in /private/. Rebase on #14647 (strict default) and #14685 (severity floor).

    Related: #14691 makes selene and luals default linters.

    🤖 Generated with Claude Code

  3. TrapsterDK commented on Nov 23, 2026

    @TrapsterDK
    CollaboratorAuthor

    PR #14728 does the LuaLS strict tier (guard rules, group severities and statuses, nonstandardSymbol, type checks) and makes luals a tier-base tool. Still to do: (1) add the guard rules as error to the luals/selene severity() maps in lua/private/quality/lua_tools.bzl and regenerate the registry and severity_gen.rs; (2) point the smoke-test selene config at the strict tier, staging lua54.yml beside it; (3) update docs/cli/commands/quality.md.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    local

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions