yamlfix – opinionated YAML formatter

yamlfix is an opinionated YAML formatter that automatically applies consistent styling while preserving comments.

It can process individual files or entire directory trees from the command line and is also available as a Python library.

The formatter corrects indentation, normalizes truthy values, removes unnecessary quotes, adjusts comments and splits long lines. Its behaviour can be customized through pyproject.toml, dedicated TOML configuration files or environment variables.

This is free and open source software.

Key Features

  • Formats YAML files while retaining their comments.
  • Processes individual files or directories recursively.
  • Corrects indentation and normalizes truthy values.
  • Removes unnecessary quotation marks from scalar values.
  • Supports configurable flow-style and block-style sequences.
  • Respects Jinja2 syntax embedded within YAML files.
  • Offers command-line and Python library interfaces.
  • Reads settings from pyproject.toml, TOML files and environment variables.
  • Supports configurable line lengths, whitespace and comment formatting.
  • Ensures files contain a single trailing newline.

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 Explore our carefully curated directory of recommended free and open source software, covering every major software category.

The directory forms part of our extensive collection of articles for Linux enthusiasts. It includes hundreds of detailed reviews, together with free and open source alternatives to proprietary software from companies such as Google, Microsoft, Apple, Adobe, IBM, Cisco, Oracle, and Autodesk.

LinuxLinks also covers interesting projects worth exploring, Linux-compatible hardware, free programming books and tutorials, and much more.

Know a useful free and open source Linux application that we haven’t covered? Tell us about it using our submission form.
Subscribe

Please read our Comment Policy before commenting.

Notify of
guest
0 Comments
Oldest
Newest Most Voted