yamlfix – opinionated YAML formatter

yamlfix is an opinionated YAML formatter that standardizes the appearance of YAML documents while preserving their comments. It is designed for maintaining consistent formatting across configuration files, infrastructure definitions and other structured documents.

The software provides a command-line interface for formatting existing files and a library interface for integration into other applications. Its configuration options allow projects to establish their own formatting conventions rather than relying exclusively on the formatter’s defaults.

This is free and open source software.

Key Features

  • Process individual YAML files or recursively scan directories.
  • Check formatting without modifying source files.
  • Preserve comments and configure comment spacing and indentation.
  • Normalize Boolean value representations.
  • Remove unnecessary quotation marks from scalar values.
  • Configure mapping and sequence indentation independently.
  • Support configurable flow-style and block-style sequences.
  • Respect Jinja2 expressions embedded within YAML documents.
  • Configure maximum line lengths and whitespace handling.
  • Control document start markers and trailing newlines.
  • Configure duplicate key checking.
  • Control the formatting of YAML anchor merge keys.
  • Specify file inclusion and exclusion patterns.
  • Read configuration from pyproject.toml, dedicated TOML files and environment variables.
  • Integration with text editors, pre-commit hooks and automated formatting workflows.

Website: github.com/lyz-code/yamlfix
Support:
Developer: Lyz
License: GNU General Public License v3.0

yamlfix is written in Python. Learn Python with our recommended free books and free tutorials.


Related Software

YAML Code Formatters
yamlfmtExtensible command-line tool and Go library for formatting YAML files
libfyamlFully-featured YAML 1.2 and JSON parser/writer
yamlfixOpinionated YAML formatter
pretty-yamlHuman-readable YAML-serialized data
yamLittle formatter for YAML
Pretty YAMLSemi-tolerant and configurable YAML formatter

Read our verdict in the software roundup.


Best Free and Open Source Software LinuxLinks helps you discover the best free and open source software for Linux. Explore our extensive collection of recommended applications, including alternatives to popular proprietary software.

We also publish software reviews, Linux tutorials, hardware reviews, free programming books and articles covering the wider open source community. Browse our Linux resources to discover more.

Know a useful free and open source Linux application we haven't covered? Suggest a program for inclusion.

Has your software been featured on LinuxLinks? Display one of our Featured on LinuxLinks badges on your website or GitHub README.
Subscribe

Please read our Comment Policy before commenting.

Notify of
guest
0 Comments
Oldest
Newest Most Voted