github owenlamont/ryl v0.25.0

3 hours ago

Added

  • ryl format formats YAML in place, checks or previews changes, and formats YAML
    embedded in Markdown with --markdown.
    (#519,
    #520,
    #538,
    #605)
  • [format] controls indentation, line endings, quotes, collections, comments,
    blank lines, folding and document markers. Unset indentation detects the file's
    existing width; line-ending = "auto" keeps its prevailing line ending.
    (#550,
    #606)
  • --output-format selects output for check and format --check; only check
    also accepts -f/--format. (#605)
  • Editor Format Document uses ryl format, including for embedded YAML in Markdown.
    (#583)
  • Top-level TOML line-length and indent-width provide shared defaults for lint
    and format. (#521)
  • check --fix can repair colons and hyphens spacing.
    (#524)
  • fold-long-lines can wrap plain, quoted and folded block scalars.
    (#523,
    #541,
    #536)
  • sequence-style and mapping-style can convert collections between flow and
    block forms; indent-width reindents block collections.
    (#544,
    #551,
    #545)
  • Formatting can choose quotes that avoid escapes and configure brace spacing,
    comment spacing and blank-line limits.
    (#539,
    #540,
    #546)

Changed

  • Ambiguous block scalars leave the whole YAML file, or the Markdown region holding
    them, unchanged by formatting and safe fixes apart from key ordering; both commands
    name the file, line and reason on stderr.
  • When formatting would change a Markdown region with mixed line endings, format
    names the refusal and --check/--diff fail; a fence-boundary refusal is also named.
    (#713)
  • Indentation conflict warnings identify indent-width as a TOML key and point
    YAML-configured users to config migration.
    (#713)
  • format and check --fix continue after a file write fails, report the file,
    and exit 2 after processing the remaining inputs.
    (#714)
  • check --fix and ryl format finish unterminated block scalars with a newline
    and, when configured, a document end marker, following the YAML 1.2 reference parser.
    Adding a marker removes value-neutral indentation spaces on a final blank
    block-scalar line, but leaves a root explicit-indent marker unfixed when its
    final spaces carry value and no preserving marker append is available.
    (#712,
    #715)
  • ryl TOML now separates [lint] and [format]. Run ryl --migrate-configs
    to preview existing configs, then add --migrate-write to update them.
    (#508)
  • Top-level TOML ignore and ignore-from-file are deprecated. Replace them with
    exclude and exclude-from-file, or use --migrate-configs --migrate-write.
    (#608)
  • yamllint YAML configuration is deprecated. Convert project configs with
    ryl --migrate-configs --migrate-write and user-global config with
    ryl --migrate-user-config --migrate-write; a later release will remove YAML
    config loading. (#562)
  • -d accepts inline TOML; legacy YAML preset names still work with a warning.
    (#562)
  • format preserves document-start markers by default, including files migrated
    from yamllint's default preset.
    (#584)
  • Editor formatting and Fix All warn when lint settings conflict with formatting.
    (#615)
  • quoted-strings and format keep quotes needed by YAML 1.1 readers, while a
    declared %YAML 1.1 follows the lint policy for redundant quotes.
    (#535,
    #560,
    #604)
  • Formatter previews reuse formatting and indentation detection, reducing work
    on repeated --check and --diff passes.
    (#561,
    #616)

Fixed

  • comments-indentation now reports, and --fix moves, a comment indented to the
    continuation of a multi-line quoted scalar, matching yamllint.
  • A leading shebang or #cloud-config stays before an inserted document marker.
    (#531)
  • check --fix and format add requested start and end markers to each document
    in a stream. (#566,
    #587)
  • Editor diagnostics and fix actions stay positioned after a leading BOM.
    (#588)
  • quoted-strings --fix keeps quotes on flow keys whose colon follows whitespace
    or a comment, preserving the key's meaning.
    (#555)
  • Fixes preserve blank block-scalar content and scalar values when headers have
    comments; editor disable-line actions work inside blank-only scalars.
    (#542,
    #543,
    #563,
    #573)
  • Formatting leaves lines after empty folded scalars intact and retains comments
    on dash lines. (#559,
    #569)
  • Block-scalar diagnostics no longer misread an apostrophe in a plain key as a
    quote. (#571)
  • Formatting aligns block-scalar bodies and detects indentation around document
    BOMs and explicit keys. (#591,
    #626,
    #664)
  • Multiline double-quoted scalars can use single quotes when no required escapes
    prevent conversion. (#662)
  • Formatting preserves encoded stdin and BOMs; encoded check --diff input counts
    pending fixes. (#617,
    #620)
  • format --check writes empty reports when no files or changes are selected.
    (#614)
  • Formatter previews reject conflicting output targets before reading inputs.
    (#631)
  • Config migration leaves YAML sources shadowed by active TOML in place.
    (#632)
  • Config migration preserves disabled formatting choices and handles custom YAML
    paths without guessing an ambiguous user-global ignore file.
    (#556,
    #557)
  • Path matching respects Windows and macOS ASCII casing, and Windows diff paths apply
    with git apply -p0. (#653,
    #655)
  • Formatting preserves Markdown fence boundaries and block scalar values while
    normalizing safe whitespace. (#633,
    #654,
    #661,
    #669)

Migrating from yamllint

The new formatter has no yamllint counterpart. For check, the existing deliberate
differences are listed below so a migration can account for each one; see the
examples and rationale.

Difference Migration step
No implicit default rules Enable --enable ALL or a TOML preset.
Inline directives Use # ryl; keep # yamllint standalone.
Colon in anchor names Review : in names; ryl follows YAML grammar.
Duplicate input paths Expect one check per file, even when inputs overlap.
Bare \r line breaks Normalize to LF or CRLF if relying on yamllint's line count.
Document-prefix BOMs Remove embedded BOMs if another parser rejects them.
CRLF scalar blanks Review block-scalar indentation.
%YAML directives Set the version or quote sensitive values.
Block scalar header comments Review comments diagnostics.
per-line-ignores Configure the ryl-only option in TOML, not yamllint YAML.
Open-block comments Keep default or set allow-any-open-indent in TOML.
Own-line dash Keep default or set dash-on-own-line in TOML.
Inline-comment gap Keep default or set max-spaces-from-content in TOML.
JUnit and GitLab reports Select ryl's output format for CI.
ryl-native user-global config Run ryl --migrate-user-config --migrate-write.
YAMLLINT_CONFIG_FILE rejects TOML Use YAML, or pass TOML with -c.

Don't miss a new ryl release

NewReleases is sending notifications on new releases.