Skip to content

meson format option to preserve trailing commas new lines #14721

Closed

Description

@Ericson2314

See NixOS/nix#13377 requesting a work-around until this is written, and NixOS/nix#13350 for the original format changes. Diffs like

 libplugintest = shared_module(
   'plugintest',
   'plugintest.cc',
-  dependencies : [
-    dependency('nix-expr'),
-  ],
+  dependencies : [ dependency('nix-expr') ],
   build_by_default : false,
 )

I don't like, because it means when lists get longer and shorter, there is more "churn". I rather "pay up front" with a multi-line list that might seem overkill, in case the list gets longer.

FWIW, clang-format does seem to preserve trailing commas, at least with the settings we use for Nix.

Activity

  1. self-assigned this
    on Jul 17, 2025
  2. added a commit that references this issue on Aug 1, 2025
    38d29b4
  3. added a commit that references this issue on Aug 26, 2025
    0188454
  4. added a commit that references this issue on Dec 2, 2025
    bac256d
  5. added a commit that references this issue on Jan 11, 2026
    3827712
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions