Skip to content

Bundled Starlark lint rules fail silently: stale files skipped without warning, -r unknown-rule says 'No issues found', discovery is mpr-relative while init writes cwd-relative #904

Description

@Chendodelangen

Summary

Three related behaviors around bundled Starlark lint rules make a broken rule setup invisible:

  1. Stale rule files are skipped silently. A .claude/lint-rules/ directory written by an older mxcli (v0.14-era init) loads only 4 of its 29 rules on v0.17.0/v0.18.0 (--list-rules shows CONV011-014 and nothing else from the bundle). No warning, no load error, nothing tells the user that 25 rules were dropped.
  2. -r <unknown-rule> reports "No issues found". mxcli lint -p app.mpr -r CONV009 on a project where CONV009 failed to load prints No issues found. — indistinguishable from "rule ran and the project is clean". Expected: "unknown rule id CONV009" (it is not in the registry at that moment).
  3. Rule discovery is project-relative, while init writes workspace-relative. With the layout workspace/.claude/lint-rules/ + workspace/project/app.mpr (created by running mxcli init from the workspace root against -p project/app.mpr), mxcli lint -p project/app.mpr does not load the rules; copying the same files to project/.claude/lint-rules/ loads all of them. So the place init puts the rules is not the place lint looks for them whenever the .mpr is not in the same directory as .claude/.

Environment

  • mxcli v0.17.0 and v0.18.0 (both reproduce 1 and 2; 3 verified on v0.18.0), windows/amd64
  • Mendix 11.12.2, MPR v2

Reproduction

# layout A (as created by mxcli init from a workspace root)
workspace/
  .claude/lint-rules/*.star     # 29 files
  project/app.mpr

cd workspace
mxcli lint -p project/app.mpr --list-rules   # bundle rules missing
mxcli lint -p project/app.mpr -r CONV009     # "No issues found." (rule never ran)

# layout B
cp .claude/lint-rules/*.star project/.claude/lint-rules/
mxcli lint -p project/app.mpr --list-rules   # all rules present
mxcli lint -p project/app.mpr -m MyModule    # CONV009 now fires (2 hits in our module)

The stale-file variant (1): keep rule files from an older release in the discovered location; on v0.18.0 only CONV011-014 of them register, silently.

Impact

We shipped a connector believing 29 convention/security rules guarded it; in reality 4 ran. The failure mode is the worst kind: everything looks green.

Suggestions

  • Print a warning per rule file that fails to parse/register (or a summary: "3 rule files skipped, run with --debug for details").
  • Make -r with an unknown rule id an error.
  • Either document that rule discovery is relative to the .mpr, or search both the .mpr directory and the working directory (the layout init itself creates).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions