Skip to content

feat!: settle the public contract for 1.0 - #251

Merged
x-ror merged 2 commits into
mainfrom
feat/contract-1.0
Nov 14, 2026
Merged

x-ror merged 2 commits into
mainfrom
feat/contract-1.0

Conversation

@x-ror

@x-ror x-ror commented Nov 14, 2026

Copy link
Copy Markdown
Owner

The changes from the 1.0 contract audit that the maintainer approved. After 1.0, rule names, the config schema, CLI output and settings are stable, so the inconsistencies are fixed now.

Breaking

  • A1: a department's enabled = true ([Layout], [Style], [Turbo], …) only turns back on rules that are on by default. An off-by-default rule needs its own enabled = true. This way a rule added in 1.x can't start rewriting files on upgrade.
  • A2: disabled_diagnostics and the [jbuilder] table (which only held it) are removed from .ruby-templates.toml. The file reports them as a Config/Invalid problem, with a hint for each.
  • A4: check text lines end with the rule: file:line:col: severity: message [Html/ImgAlt]. Config problems end with [Config/Invalid].
  • A5: text columns count characters from 1, as in github, json and sarif. A BOM takes no column.
  • A6: JSON severity says info, like text. GitHub keeps notice and SARIF keeps note.
  • A7: every diagnostic's source is ruby-templates. Config problems also carry the Config/Invalid code in the editor.
  • A8: Rails/I18nMissingKey is renamed Rails/MissingTranslation. A config still using the old name gets a hint with the new one.
  • A10: the rubyTemplates.reindentHaml command is removed; Format Document does the same.

Non-breaking

  • A3: a rule that a .ruby-templates.toml enables stays on even when the editor's disabledDiagnostics lists it, as the docs already said.
  • A12: Liquid is documented as experimental.
  • A13: the docs no longer call shipped rules draft or planned, and the stale ruby-templates-ls --check mention is gone.
  • --version: ruby-templates --version/-V and ruby-templates-ls --version print the version.
  • --help: --help and -h exit 0, but not when given as an option's value.

The Stability page comes in a separate PR (docs/stability) that depends on A1.

Tests

  • Rust unit tests: department switches only restore defaults; file enabled beats the editor list; removed keys and renamed rules give problems with hints; text line format and character columns; help detection.
  • test/e2e.js: ruby-templates source, Config/Invalid code on toml problems, the rename.
  • test/cli.js: [Rule] suffix, columns, severities across formats, --version, --help exit codes.
  • test/vscode: Problems filter by the new source; reindentHaml removed.
  • Results: 1009 Rust tests, plus test:server, e2e, cli, test:rules, test:format, test:unit, format:check, build and test:vscode, all pass.

Generated by Claude Code

After 1.0 rule names, the config schema, the CLI output and the
settings are stable, so the inconsistencies the audit found are fixed
now rather than carried into 1.x:

- a department's `enabled = true` only restores rules that are on by
  default, so a rule added in 1.x can't start rewriting files on upgrade;
- `disabled_diagnostics` (and the `[jbuilder]` table that only held it)
  leave .ruby-templates.toml, which switches rules off in their tables,
  and a rule the file enables stays on whatever the editor's list says;
- `check`'s text lines end with the rule, count columns in characters
  like the other formats, and say `info` as JSON does;
- every diagnostic's source is `ruby-templates`;
- `Rails/I18nMissingKey` is `Rails/MissingTranslation`, as its module;
- the `rubyTemplates.reindentHaml` command, a copy of Format Document,
  goes;
- Liquid is documented as experimental, shipped rules are no longer
  called planned, and `--version`/`--help` exit 0.

BREAKING CHANGE: `disabled_diagnostics` and `[jbuilder]` in
.ruby-templates.toml are errors; `[Department] enabled = true` no longer
turns on off-by-default rules; `Rails/I18nMissingKey` is renamed
`Rails/MissingTranslation`; `check` text output gains ` [Rule]` and
character columns; JSON severity `note` is `info`; diagnostic source is
`ruby-templates`; the `rubyTemplates.reindentHaml` command is removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012jSfzj1UNFUHV9YmmbjLg4
A config naming `Rails/I18nMissingKey` now hears its new name, and
`[jbuilder]` gets a hint that fits Jbuilder. Config problems carry the
`Config/Invalid` code in the editor as on the command line, and their
log line uses the same format. `ruby-templates-ls --version` answers
instead of starting to serve, `-h` given as an option's value is no
longer read as help, and the disabledDiagnostics descriptions say what
the file now overrides.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012jSfzj1UNFUHV9YmmbjLg4
@x-ror
x-ror merged commit b7d4819 into main Nov 14, 2026
17 checks passed
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.

2 participants