• v0.65.5
    release / build-and-publish (push) Successful in 5m22s
    Stable

    gitea-actions released this 2026-11-19 10:40:32 -08:00 | 8 commits to master since this release

    Named formatting styles

    (docs/features/format-styles; TODO §71.5.)

    • One setting picks a house layout. [format] style = "<name>" in
      lucisv.toml, --style <name> on the command line, or the new
      lucisv.format.style drop-down in VS Code. Seven layout rules, one row per
      style, in one table in crates/vlog_formatter/src/style.rs:

      style indent / width begin else lists list indent alignment
      lucisv (default) 2 / 100 same line same line fit 1 level keep
      google 2 / 100 same line same line one per line 2 levels keep
      lowrisc 2 / 100 same line same line one per line 1 level always
      ansi 4 / 80 own line own line fit 1 level keep
      microsoft 4 / 120 own line own line one per line 1 level keep
      nxp 2 / 80 same line own line one per line 1 level always
    • Where the styles come from. google follows the Google Verilog Style
      Guide and lowrisc the lowRISC (OpenTitan) guide, both read for this
      release, including else on its own line after a labelled end. ansi,
      microsoft and nxp are lucisv's educated guesses
      — Allman-style
      begin/else after iStyle's and clang-format's styles of those names, and
      a conservative aligned RTL style — not rules those organisations publish
      for Verilog.

    • The default does not move a byte. lucisv output is identical to
      0.65.4 on all 4 921 files of the corpus and OpenTitan's hw tree, checked
      against an independently rebuilt 0.65.4. An explicit indent or
      line-length still wins over a style's.

    • Every style goes through the same safety net. Each was formatted three
      times over those 4 921 files: no verification error, no crash, no token or
      comment difference (checked with a lexer that is not the formatter's), and
      no change on a second or third run. verify.rs is untouched.

    • style = "auto" keeps a file in the layout it is already closest to.
      It formats with each preset and keeps the result that changes the fewest
      lines, so a file written the Google way stays that way. It picks a layout
      for the configured indent and width and never infers them — set
      indent to match the file first, or a 4-space file formatted at the
      default 2 comes out in the default layout. Small edits do not flip a file:
      over 500 files and ten kinds of edit, none rewrote more than 12 lines
      outside the edit. auto costs a search — 2.4 s against 0.4 s on a
      42 000-line file for a whole-document format — so the language server
      remembers each document's layout, and selection and on-type formatting stay
      at 0.1 s after the first request.

    • Known limits. A declaration with several instances in one statement
      gets the older hanging layout under the one-per-line styles. The language
      server's line-length lint still assumes 100 columns under ansi,
      microsoft and nxp (the CLI's check follows the style). Switching from
      one keep-alignment style to another and back is not always a round trip:
      alignment a style added stays.

    Downloads