Skip to content

A name .super-slim.yml misspells is an error, not ignored - #112

Merged
czj merged 1 commit into
mainfrom
config-unknown-names
Nov 11, 2026
Merged

czj merged 1 commit into
mainfrom
config-unknown-names

Conversation

@czj

@czj czj commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

A name .super-slim.yml misspells is ignored. LineLenght: {max: 150} leaves the limit at 120, Instancevariables: {enabled: false} leaves the rule on, formatter: {max_line_length: 120} wraps nothing, and super-slim lint exits 0 without a word: the file reads as if it were applied. The linter already reports a rule name it doesn't know in a super-slim:disable comment.

Unknown names now stop lint and format with a usage error that names them and lists what the file can hold there. This turns a configuration that was read without complaint into an error, which is why this pull request does not merge itself: it wants a decision, and a line under Breaking in the changelog if it goes in.

  • Rules: a key of linters: that is no rule of super-slim lint, in the words of the directive's offense.
  • Options of a rule: anything but the rule's own options, include and exclude; preset only on the rules that have one.
  • Settings: a top-level key other than linters, format, fmt and tailwind_classes, and under format: anything but max_line_length and attribute_delimiters.
  • Who it stops: a file carrying a rule from slim-lint that SuperSlim never had, such as RuboCop: or Tag:, would fail until the entry is removed.
Proof

Each .super-slim.yml below passes super-slim lint on main with no output and status 0, but the one with preset, which main answers with LineLength: unknown preset `bootstrap5`, use one of: and an empty list. With this change, status 64 and:

.super-slim.yml Message
linters: {LineLenght: {max: 150}} .super-slim.yml: `LineLenght` is not a rule of super-slim lint
linters: {LineLength: {maximum: 150}} .super-slim.yml: `maximum` is not an option of LineLength, use one of: enabled, max, include, exclude
linters: {LineLength: {preset: bootstrap5}} .super-slim.yml: `preset` is not an option of LineLength, use one of: enabled, max, include, exclude
formatter: {max_line_length: 120} .super-slim.yml: `formatter` is not a setting, use one of: linters, format, fmt, tailwind_classes
format: {line_length: 120} .super-slim.yml: `line_length` is not a setting of `format`, use one of: max_line_length, attribute_delimiters

test/cli_test.rb holds the five; the README's paragraph on the configuration file says so.

A rule, an option or a setting the linter does not know was skipped in silence: the limit it meant to raise stayed, the rule it meant to turn off stayed on. Unknown names stop lint and format with a usage error that lists the known ones.

Assisted-by: Claude Fable 5 [Claude Code]
@czj
czj merged commit 75f6b6a into main Nov 11, 2026
13 checks passed
@czj
czj deleted the config-unknown-names branch November 11, 2026 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant