Repository navigation
feat: Load rules from .yaml files as well as .yml - #1232
seragAhmed wants to merge 1 commit into
Conversation
A style's rules were found by the `.yml` suffix, so a rule saved as `Rule.yaml` was skipped without a word. The same suffix was fixed where a rule is turned on by name (`Style.Rule = YES`), where `extends: Style.Rule` finds its parent, and where a spelling rule is read back for suggestions. All four now accept either extension through core.RuleExtensions. If a style holds both `Rule.yml` and `Rule.yaml`, the rule is read from `Rule.yml`, which is the file Vale loaded before; the other is ignored rather than failing with a duplicate rule name. Fixes vale-cli#1217 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Before this is reviewed, please read the AI-Assisted Contributions section of the contributing guide and make sure this change meets it: you can explain every line, the description is your own and brief, it fixes a bug you hit or a feature agreed in an issue, it does not touch undocumented options, and any substantial tool use is noted. |
|
Before this can be merged, please read Vale's contributor license agreement, which is four short points, and post a new comment on this pull request whose entire text is the sentence below, with no quote, no extra words, and no trailing period. Don't use the Reply button, which quotes this comment. This is once per person, not per pull request. I have read the CLA and I agree to it You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot. |
A style's rules were found by the
.ymlsuffix, so a rule saved asRule.yamlwas skipped without any message. The same suffix was hard-coded where a rule is turned on by name (Style.Rule = YES), whereextends: Style.Rulefinds its parent, and where a spelling rule is read back for suggestions. All four now accept either extension (core.RuleExtensions).If a style holds both
Rule.ymlandRule.yaml, the rule is read fromRule.yml, the file Vale already loaded, and the.yamlcopy is ignored. It doesn't matter which file the directory walk finds first. Vocabularies, scopes and test files already accepted both extensions, so they're unchanged.Tests: two e2e cases in
config.yaml(a.yamlrule loaded with its style, by name, and as a parent; and a.yml/.yamlpair) plus a unit test forresolveRule.Fixes #1217
Assisted-by: Claude Code
🤖 Generated with Claude Code