Problem
The current baseline yamllint config has two rules that conflict with YAML files generated by Ruby's Psych (the standard Ruby YAML serializer used by Rails, RuboCop, i18n-tasks, etc.):
-
document-start: present: false — Psych always adds --- to the start of every document. This cannot be disabled via options in any Ruby version (including Ruby 4 / Psych 5.4).
-
indentation: indent-sequences: true (inherited from extends: default) — Psych always outputs block sequences at the same indentation level as the parent key (non-indented style). This also cannot be changed via options.
Psych output (always)
---
en:
date:
abbr_day_names:
- Sun
- Mon
What baseline yamllint requires
en:
date:
abbr_day_names:
- Sun
- Mon
Psych has no options to suppress --- or produce indented sequences — both behaviors are hardcoded in libyaml's C emitter.
Affected files in a typical Rails project
config/locales/*.yml — generated/normalized by i18n-tasks
.rubocop_todo.yml — generated by rubocop --auto-gen-config
.rubocop.yml, .erb_lint.yml — blank lines between sections (separate issue, already fixed by removing blank lines)
Consequence
In a Rails project using baseline's yamllint linter, i18n-tasks health and yamllint are mutually exclusive:
- If locale files pass yamllint →
i18n-tasks health fails ("data requires normalization")
- If
i18n-tasks normalize is run → yamllint fails
Proposed solution
Support two yamllint profiles in baseline — one for Psych-generated files, one for human-written files:
config/yamllint/default.yml # current rules, for human-written YAML
config/yamllint/psych.yml # relaxed rules for Psych output
Or alternatively, support a project-level yamllint config override (e.g. .yamllint-baseline.yml that extends the baseline config), so projects can add their own ignore: patterns or rule overrides.
A minimal fix would be adding config/locales/ to the baseline ignore: block, since locale files are a universal Rails pattern.
Problem
The current baseline yamllint config has two rules that conflict with YAML files generated by Ruby's Psych (the standard Ruby YAML serializer used by Rails, RuboCop, i18n-tasks, etc.):
document-start: present: false— Psych always adds---to the start of every document. This cannot be disabled via options in any Ruby version (including Ruby 4 / Psych 5.4).indentation: indent-sequences: true(inherited fromextends: default) — Psych always outputs block sequences at the same indentation level as the parent key (non-indented style). This also cannot be changed via options.Psych output (always)
What baseline yamllint requires
Psych has no options to suppress
---or produce indented sequences — both behaviors are hardcoded in libyaml's C emitter.Affected files in a typical Rails project
config/locales/*.yml— generated/normalized byi18n-tasks.rubocop_todo.yml— generated byrubocop --auto-gen-config.rubocop.yml,.erb_lint.yml— blank lines between sections (separate issue, already fixed by removing blank lines)Consequence
In a Rails project using baseline's
yamllintlinter,i18n-tasks healthand yamllint are mutually exclusive:i18n-tasks healthfails ("data requires normalization")i18n-tasks normalizeis run → yamllint failsProposed solution
Support two yamllint profiles in baseline — one for Psych-generated files, one for human-written files:
Or alternatively, support a project-level yamllint config override (e.g.
.yamllint-baseline.ymlthat extends the baseline config), so projects can add their ownignore:patterns or rule overrides.A minimal fix would be adding
config/locales/to the baselineignore:block, since locale files are a universal Rails pattern.