Skip to content

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

Merged
jdkato merged 1 commit into
vale-cli:v3from
seragAhmed:feat/1217-yaml-extension
Nov 21, 2026
Merged

jdkato merged 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

@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

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

The license agreement is signed.
Posted by the CLA Assistant Lite bot.

@seragAhmed

Copy link
Copy Markdown
Contributor Author

I have read the CLA and I agree to it

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>
@seragAhmed
seragAhmed force-pushed the feat/1217-yaml-extension branch from a4a2081 to 2091bd5 Compare November 20, 2026 20:46
@jdkato
jdkato merged commit 40507c4 into vale-cli:v3 Nov 21, 2026
10 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 21, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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