Skip to content

feat: Load rules from .yaml files as well as .yml - #1232

Open
seragAhmed wants to merge 1 commit into
vale-cli:v3from
seragAhmed:feat/1217-yaml-extension
Open

seragAhmed wants to merge 1 commit into
vale-cli:v3from
seragAhmed:feat/1217-yaml-extension

Conversation

@seragAhmed

Copy link
Copy Markdown
Contributor

A style's rules were found by the .yml suffix, so a rule saved as Rule.yaml was skipped without any message. The same suffix was hard-coded 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 (core.RuleExtensions).

If a style holds both Rule.yml and Rule.yaml, the rule is read from Rule.yml, the file Vale already loaded, and the .yaml copy 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 .yaml rule loaded with its style, by name, and as a parent; and a .yml/.yaml pair) plus a unit test for resolveRule.

Fixes #1217

Assisted-by: Claude Code

🤖 Generated with Claude Code

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>
@github-actions

Copy link
Copy Markdown

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.

@github-actions

Copy link
Copy Markdown

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.

This branch has not been deployed

No deployments
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.

Support both .yml and .yaml file extensions

2 participants