Repository navigation
feat!: settle the public contract for 1.0 - #251
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
enabled = true([Layout],[Style],[Turbo], …) only turns back on rules that are on by default. An off-by-default rule needs its ownenabled = true. This way a rule added in 1.x can't start rewriting files on upgrade.disabled_diagnosticsand the[jbuilder]table (which only held it) are removed from.ruby-templates.toml. The file reports them as aConfig/Invalidproblem, with a hint for each.checktext lines end with the rule:file:line:col: severity: message [Html/ImgAlt]. Config problems end with[Config/Invalid].github,jsonandsarif. A BOM takes no column.severitysaysinfo, like text. GitHub keepsnoticeand SARIF keepsnote.sourceisruby-templates. Config problems also carry theConfig/Invalidcode in the editor.Rails/I18nMissingKeyis renamedRails/MissingTranslation. A config still using the old name gets a hint with the new one.rubyTemplates.reindentHamlcommand is removed; Format Document does the same.Non-breaking
.ruby-templates.tomlenables stays on even when the editor'sdisabledDiagnosticslists it, as the docs already said.ruby-templates-ls --checkmention is gone.--version:ruby-templates --version/-Vandruby-templates-ls --versionprint the version.--help:--helpand-hexit 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
enabledbeats the editor list; removed keys and renamed rules give problems with hints; text line format and character columns; help detection.test/e2e.js:ruby-templatessource,Config/Invalidcode on toml problems, the rename.test/cli.js:[Rule]suffix, columns, severities across formats,--version,--helpexit codes.test/vscode: Problems filter by the new source;reindentHamlremoved.test:server,e2e,cli,test:rules,test:format,test:unit,format:check,buildandtest:vscode, all pass.Generated by Claude Code