Skip to content

Add yamlfmt configuration schema#5639

Merged
madskristensen merged 2 commits into
SchemaStore:masterfrom
drode1:yamlfmt-schema
Apr 30, 2026
Merged

Add yamlfmt configuration schema#5639
madskristensen merged 2 commits into
SchemaStore:masterfrom
drode1:yamlfmt-schema

Conversation

@drode1
Copy link
Copy Markdown
Contributor

@drode1 drode1 commented Apr 30, 2026

Summary

Adds the yamlfmt configuration JSON Schema for yamlfmt YAML formatter configuration files.

yamlfmt is an extensible command-line tool and library for formatting YAML files. The schema validates yamlfmt configuration files covering:

  • Command settings - Line endings, path matching mode, include/exclude paths, regex-based exclusion, extension filters, continue-on-error behavior, output format
  • Path discovery - Known config filenames, gitignore-based excludes, custom gitignore path, doublestar and gitignore matching modes
  • Formatter selection - basic and kyaml formatter types
  • Basic formatter options - Indentation, document start marker, line break retention, anchor handling, max line length, folded scalar handling
  • Formatting behavior - Array indentation, merge tag handling, line comment padding, trailing whitespace trimming, EOF newline, directive stripping
  • Style controls - Array style forcing, quote style forcing, root array indentation, alias-key correction control

File matches

.yamlfmt
yamlfmt.yml
yamlfmt.yaml
.yamlfmt.yaml
.yamlfmt.yml

Schema source

Documentation
Additional docs:

Tests

  • basic-config.yaml - Comprehensive basic formatter configuration with command-level and formatter-level options
  • implicit-basic-config.yaml - Formatter block without explicit type to cover default basic formatter behavior
  • kyaml-config.yaml - kyaml formatter configuration
  • invalid-force-array-style.yaml - Rejects unsupported force_array_style values
  • invalid-force-quote-style.yaml - Rejects unsupported force_quote_style values
  • invalid-line-ending.yaml - Rejects unsupported line_ending values
  • invalid-match-type.yaml - Rejects unsupported match_type values
  • invalid-output-format.yaml - Rejects unsupported output_format values

@github-actions
Copy link
Copy Markdown
Contributor

Thanks for the PR!

This section of the codebase is owned by @madskristensen and @hyperupcall - if they write a comment saying "LGTM" then it will be merged.

@madskristensen madskristensen merged commit 442dcf7 into SchemaStore:master Apr 30, 2026
4 checks passed
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.

2 participants