cmakefmt 2.3.0__tar.gz → 2.3.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. {cmakefmt-2.3.0 → cmakefmt-2.3.1}/Cargo.lock +65 -120
  2. {cmakefmt-2.3.0 → cmakefmt-2.3.1}/Cargo.toml +3 -3
  3. {cmakefmt-2.3.0 → cmakefmt-2.3.1}/PKG-INFO +1 -1
  4. {cmakefmt-2.3.0 → cmakefmt-2.3.1}/src/cli/process.rs +1 -5
  5. {cmakefmt-2.3.0 → cmakefmt-2.3.1}/src/config/file.rs +17 -1
  6. {cmakefmt-2.3.0 → cmakefmt-2.3.1}/src/config/mod.rs +5 -4
  7. {cmakefmt-2.3.0 → cmakefmt-2.3.1}/src/formatter/node.rs +95 -0
  8. {cmakefmt-2.3.0 → cmakefmt-2.3.1}/src/lsp/mod.rs +319 -61
  9. {cmakefmt-2.3.0 → cmakefmt-2.3.1}/src/spec/registry.rs +11 -11
  10. {cmakefmt-2.3.0 → cmakefmt-2.3.1}/LICENSE +0 -0
  11. {cmakefmt-2.3.0 → cmakefmt-2.3.1}/LICENSES/Apache-2.0.txt +0 -0
  12. {cmakefmt-2.3.0 → cmakefmt-2.3.1}/LICENSES/MIT.txt +0 -0
  13. {cmakefmt-2.3.0 → cmakefmt-2.3.1}/README.md +0 -0
  14. {cmakefmt-2.3.0 → cmakefmt-2.3.1}/build.rs +0 -0
  15. {cmakefmt-2.3.0 → cmakefmt-2.3.1}/pyproject.toml +0 -0
  16. {cmakefmt-2.3.0 → cmakefmt-2.3.1}/src/README.md +0 -0
  17. {cmakefmt-2.3.0 → cmakefmt-2.3.1}/src/cli/commands.rs +0 -0
  18. {cmakefmt-2.3.0 → cmakefmt-2.3.1}/src/cli/diff.rs +0 -0
  19. {cmakefmt-2.3.0 → cmakefmt-2.3.1}/src/cli/errors.rs +0 -0
  20. {cmakefmt-2.3.0 → cmakefmt-2.3.1}/src/cli/mod.rs +0 -0
  21. {cmakefmt-2.3.0 → cmakefmt-2.3.1}/src/cli/report.rs +0 -0
  22. {cmakefmt-2.3.0 → cmakefmt-2.3.1}/src/cli/runtime.rs +0 -0
  23. {cmakefmt-2.3.0 → cmakefmt-2.3.1}/src/cli/spec_coverage.rs +0 -0
  24. {cmakefmt-2.3.0 → cmakefmt-2.3.1}/src/cli/summary.rs +0 -0
  25. {cmakefmt-2.3.0 → cmakefmt-2.3.1}/src/config/editorconfig.rs +0 -0
  26. {cmakefmt-2.3.0 → cmakefmt-2.3.1}/src/config/legacy.rs +0 -0
  27. {cmakefmt-2.3.0 → cmakefmt-2.3.1}/src/dprint.rs +0 -0
  28. {cmakefmt-2.3.0 → cmakefmt-2.3.1}/src/dump.rs +0 -0
  29. {cmakefmt-2.3.0 → cmakefmt-2.3.1}/src/error.rs +0 -0
  30. {cmakefmt-2.3.0 → cmakefmt-2.3.1}/src/files.rs +0 -0
  31. {cmakefmt-2.3.0 → cmakefmt-2.3.1}/src/formatter/comment.rs +0 -0
  32. {cmakefmt-2.3.0 → cmakefmt-2.3.1}/src/formatter/mod.rs +0 -0
  33. {cmakefmt-2.3.0 → cmakefmt-2.3.1}/src/lib.rs +0 -0
  34. {cmakefmt-2.3.0 → cmakefmt-2.3.1}/src/main.rs +0 -0
  35. {cmakefmt-2.3.0 → cmakefmt-2.3.1}/src/parser/ast.rs +0 -0
  36. {cmakefmt-2.3.0 → cmakefmt-2.3.1}/src/parser/cursor.rs +0 -0
  37. {cmakefmt-2.3.0 → cmakefmt-2.3.1}/src/parser/grammar.rs +0 -0
  38. {cmakefmt-2.3.0 → cmakefmt-2.3.1}/src/parser/lower.rs +0 -0
  39. {cmakefmt-2.3.0 → cmakefmt-2.3.1}/src/parser/mod.rs +0 -0
  40. {cmakefmt-2.3.0 → cmakefmt-2.3.1}/src/parser/scanner.rs +0 -0
  41. {cmakefmt-2.3.0 → cmakefmt-2.3.1}/src/semantic.rs +0 -0
  42. {cmakefmt-2.3.0 → cmakefmt-2.3.1}/src/spec/builtins.yaml +0 -0
  43. {cmakefmt-2.3.0 → cmakefmt-2.3.1}/src/spec/cmake_commands.txt +0 -0
  44. {cmakefmt-2.3.0 → cmakefmt-2.3.1}/src/spec/mod.rs +0 -0
  45. {cmakefmt-2.3.0 → cmakefmt-2.3.1}/src/spec/modules.yaml +0 -0
  46. {cmakefmt-2.3.0 → cmakefmt-2.3.1}/src/wasm.rs +0 -0
@@ -64,7 +64,7 @@ version = "1.1.5"
64
64
  source = "registry+https://github.com/rust-lang/crates.io-index"
65
65
  checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc"
66
66
  dependencies = [
67
- "windows-sys 0.61.2",
67
+ "windows-sys",
68
68
  ]
69
69
 
70
70
  [[package]]
@@ -75,7 +75,7 @@ checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d"
75
75
  dependencies = [
76
76
  "anstyle",
77
77
  "once_cell_polyfill",
78
- "windows-sys 0.61.2",
78
+ "windows-sys",
79
79
  ]
80
80
 
81
81
  [[package]]
@@ -324,7 +324,7 @@ dependencies = [
324
324
 
325
325
  [[package]]
326
326
  name = "cmakefmt-rust"
327
- version = "2.3.0"
327
+ version = "2.3.1"
328
328
  dependencies = [
329
329
  "clap",
330
330
  "clap_complete",
@@ -351,7 +351,7 @@ dependencies = [
351
351
  "serde",
352
352
  "serde-saphyr",
353
353
  "serde_json",
354
- "similar 3.2.0",
354
+ "similar 3.2.1",
355
355
  "tempfile",
356
356
  "thiserror",
357
357
  "toml",
@@ -361,16 +361,15 @@ dependencies = [
361
361
 
362
362
  [[package]]
363
363
  name = "codspeed"
364
- version = "5.0.3"
364
+ version = "6.0.0"
365
365
  source = "registry+https://github.com/rust-lang/crates.io-index"
366
- checksum = "1cade51e6e6e30e7ea2cd9599fa5d5d5f48255a6b221bbd0cab1cf32f3c23c65"
366
+ checksum = "7e7c21807b937b8e535f2745cd83c525fc250524021cd662b9ba4d3e399bb504"
367
367
  dependencies = [
368
368
  "anyhow",
369
369
  "cc",
370
370
  "colored",
371
371
  "getrandom",
372
372
  "glob",
373
- "libc",
374
373
  "nix",
375
374
  "serde",
376
375
  "serde_json",
@@ -379,9 +378,9 @@ dependencies = [
379
378
 
380
379
  [[package]]
381
380
  name = "codspeed-criterion-compat"
382
- version = "5.0.3"
381
+ version = "6.0.0"
383
382
  source = "registry+https://github.com/rust-lang/crates.io-index"
384
- checksum = "b5d1640d31b122c8d754939c6ae4040709a9602f289d11e43075476a21285020"
383
+ checksum = "8a14939cf9e46182bdfbf6de618a8a110361c15a27eccff8f5ad4380249e9c14"
385
384
  dependencies = [
386
385
  "clap",
387
386
  "codspeed",
@@ -392,9 +391,9 @@ dependencies = [
392
391
 
393
392
  [[package]]
394
393
  name = "codspeed-criterion-compat-walltime"
395
- version = "5.0.3"
394
+ version = "6.0.0"
396
395
  source = "registry+https://github.com/rust-lang/crates.io-index"
397
- checksum = "2a83eed387b8f84aad4cb29607758bec3ab3f53b1734af934ddae7fee626d8ce"
396
+ checksum = "af785573a72d17af663e661a45e1d617a2bab9f3a13a219ca0ae6ef9412ea1d8"
398
397
  dependencies = [
399
398
  "anes",
400
399
  "cast",
@@ -429,7 +428,7 @@ version = "3.1.1"
429
428
  source = "registry+https://github.com/rust-lang/crates.io-index"
430
429
  checksum = "faf9468729b8cbcea668e36183cb69d317348c2e08e994829fb56ebfdfbaac34"
431
430
  dependencies = [
432
- "windows-sys 0.61.2",
431
+ "windows-sys",
433
432
  ]
434
433
 
435
434
  [[package]]
@@ -441,7 +440,7 @@ dependencies = [
441
440
  "encode_unicode",
442
441
  "libc",
443
442
  "unicode-width",
444
- "windows-sys 0.61.2",
443
+ "windows-sys",
445
444
  ]
446
445
 
447
446
  [[package]]
@@ -517,7 +516,7 @@ checksum = "e0b1fab2ae45819af2d0731d60f2afe17227ebb1a1538a236da84c93e9a60162"
517
516
  dependencies = [
518
517
  "dispatch2",
519
518
  "nix",
520
- "windows-sys 0.61.2",
519
+ "windows-sys",
521
520
  ]
522
521
 
523
522
  [[package]]
@@ -604,7 +603,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
604
603
  checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"
605
604
  dependencies = [
606
605
  "libc",
607
- "windows-sys 0.61.2",
606
+ "windows-sys",
608
607
  ]
609
608
 
610
609
  [[package]]
@@ -640,15 +639,6 @@ version = "0.2.0"
640
639
  source = "registry+https://github.com/rust-lang/crates.io-index"
641
640
  checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb"
642
641
 
643
- [[package]]
644
- name = "fsevent-sys"
645
- version = "4.1.0"
646
- source = "registry+https://github.com/rust-lang/crates.io-index"
647
- checksum = "76ee7a02da4d231650c7cea31349b889be2f45ddb3ef3032d2ec8185f6313fd2"
648
- dependencies = [
649
- "libc",
650
- ]
651
-
652
642
  [[package]]
653
643
  name = "futures-core"
654
644
  version = "0.3.34"
@@ -824,7 +814,7 @@ checksum = "3640c1c38b8e4e43584d8df18be5fc6b0aa314ce6ebf51b53313d4306cca8e46"
824
814
  dependencies = [
825
815
  "hermit-abi",
826
816
  "libc",
827
- "windows-sys 0.61.2",
817
+ "windows-sys",
828
818
  ]
829
819
 
830
820
  [[package]]
@@ -938,7 +928,7 @@ dependencies = [
938
928
  "libc",
939
929
  "log",
940
930
  "wasi",
941
- "windows-sys 0.61.2",
931
+ "windows-sys",
942
932
  ]
943
933
 
944
934
  [[package]]
@@ -967,20 +957,21 @@ checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451"
967
957
 
968
958
  [[package]]
969
959
  name = "notify"
970
- version = "8.2.0"
960
+ version = "8.2.1"
971
961
  source = "registry+https://github.com/rust-lang/crates.io-index"
972
- checksum = "4d3d07927151ff8575b7087f245456e549fea62edf0ec4e565a5ee50c8402bc3"
962
+ checksum = "82f812702fbc75d35416d3f884e04925be7e9498f4eceea2e24ba34559284674"
973
963
  dependencies = [
974
964
  "bitflags 2.13.2",
975
- "fsevent-sys",
976
965
  "inotify",
977
966
  "kqueue",
978
967
  "libc",
979
968
  "log",
980
969
  "mio",
981
970
  "notify-types",
971
+ "objc2-core-foundation",
972
+ "objc2-core-services",
982
973
  "walkdir",
983
- "windows-sys 0.60.2",
974
+ "windows-sys",
984
975
  ]
985
976
 
986
977
  [[package]]
@@ -1022,6 +1013,25 @@ dependencies = [
1022
1013
  "objc2-encode",
1023
1014
  ]
1024
1015
 
1016
+ [[package]]
1017
+ name = "objc2-core-foundation"
1018
+ version = "0.3.2"
1019
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1020
+ checksum = "2a180dd8642fa45cdb7dd721cd4c11b1cadd4929ce112ebd8b9f5803cc79d536"
1021
+ dependencies = [
1022
+ "bitflags 2.13.2",
1023
+ ]
1024
+
1025
+ [[package]]
1026
+ name = "objc2-core-services"
1027
+ version = "0.3.2"
1028
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1029
+ checksum = "583300ad934cba24ff5292aee751ecc070f7ca6b39a574cc21b7b5e588e06a0b"
1030
+ dependencies = [
1031
+ "libc",
1032
+ "objc2-core-foundation",
1033
+ ]
1034
+
1025
1035
  [[package]]
1026
1036
  name = "objc2-encode"
1027
1037
  version = "4.1.0"
@@ -1048,21 +1058,20 @@ checksum = "d6790f58c7ff633d8771f42965289203411a5e5c68388703c06e14f24770b41e"
1048
1058
 
1049
1059
  [[package]]
1050
1060
  name = "pest"
1051
- version = "2.9.4"
1061
+ version = "2.9.5"
1052
1062
  source = "registry+https://github.com/rust-lang/crates.io-index"
1053
- checksum = "fd47a460a9cbc3b3429c7e22bf0d76653e779319bae45a499ca010c9a990bb23"
1063
+ checksum = "a8db75153506001cb36ed924f08cadc862eb3f8c4d0d534139f29074769d7660"
1054
1064
  dependencies = [
1055
1065
  "memchr",
1056
- "psm",
1057
- "stacker",
1066
+ "pest_stack_guard",
1058
1067
  "ucd-trie",
1059
1068
  ]
1060
1069
 
1061
1070
  [[package]]
1062
1071
  name = "pest_derive"
1063
- version = "2.9.4"
1072
+ version = "2.9.5"
1064
1073
  source = "registry+https://github.com/rust-lang/crates.io-index"
1065
- checksum = "203e46697708f7519ab1608393cf89239cafb46b8e6d08a8ffe359359b11ef44"
1074
+ checksum = "20aa17e11fb35664b67d5214a0afac57a360d231b6ec53d6eba0700b27d933b4"
1066
1075
  dependencies = [
1067
1076
  "pest",
1068
1077
  "pest_generator",
@@ -1070,9 +1079,9 @@ dependencies = [
1070
1079
 
1071
1080
  [[package]]
1072
1081
  name = "pest_generator"
1073
- version = "2.9.4"
1082
+ version = "2.9.5"
1074
1083
  source = "registry+https://github.com/rust-lang/crates.io-index"
1075
- checksum = "e84ae6340a458d3d6cfc73cf328cf3cfe90b2484cd0de25eb66aa954615ed4d5"
1084
+ checksum = "626ec5afccf44ccbfeb2b232316510bb55b4bf34d891afcb0fb07d2b17d7fe9d"
1076
1085
  dependencies = [
1077
1086
  "pest",
1078
1087
  "pest_meta",
@@ -1083,13 +1092,23 @@ dependencies = [
1083
1092
 
1084
1093
  [[package]]
1085
1094
  name = "pest_meta"
1086
- version = "2.9.4"
1095
+ version = "2.9.5"
1087
1096
  source = "registry+https://github.com/rust-lang/crates.io-index"
1088
- checksum = "b57f92f32b3dbce6598fd8f5cdf1f06a6072570b8103fa21728fa9036923e710"
1097
+ checksum = "b3f45b6caa65c1b08186832745159c2529994146340a7bf44168095469720f5d"
1089
1098
  dependencies = [
1090
1099
  "pest",
1091
1100
  ]
1092
1101
 
1102
+ [[package]]
1103
+ name = "pest_stack_guard"
1104
+ version = "1.0.0"
1105
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1106
+ checksum = "97e6cd2217057fa86b6eaa512917e58089d875b957a31e35e7ab729977e0a5f2"
1107
+ dependencies = [
1108
+ "psm",
1109
+ "stacker",
1110
+ ]
1111
+
1093
1112
  [[package]]
1094
1113
  name = "pin-project-lite"
1095
1114
  version = "0.2.17"
@@ -1327,7 +1346,7 @@ dependencies = [
1327
1346
  "errno",
1328
1347
  "libc",
1329
1348
  "linux-raw-sys",
1330
- "windows-sys 0.61.2",
1349
+ "windows-sys",
1331
1350
  ]
1332
1351
 
1333
1352
  [[package]]
@@ -1501,9 +1520,9 @@ checksum = "bbbb5d9659141646ae647b42fe094daf6c6192d1620870b449d9557f748b2daa"
1501
1520
 
1502
1521
  [[package]]
1503
1522
  name = "similar"
1504
- version = "3.2.0"
1523
+ version = "3.2.1"
1505
1524
  source = "registry+https://github.com/rust-lang/crates.io-index"
1506
- checksum = "4f66ca1f7aca2474dc10c942eb22feffc897735f54cd1db90138c2fddb490987"
1525
+ checksum = "d2f8bec09ae8fae0f4f265a4559a9334be3929d8504e9b536df0a41302bd1733"
1507
1526
  dependencies = [
1508
1527
  "bstr",
1509
1528
  ]
@@ -1530,7 +1549,7 @@ dependencies = [
1530
1549
  "cfg-if",
1531
1550
  "libc",
1532
1551
  "psm",
1533
- "windows-sys 0.61.2",
1552
+ "windows-sys",
1534
1553
  ]
1535
1554
 
1536
1555
  [[package]]
@@ -1581,7 +1600,7 @@ dependencies = [
1581
1600
  "getrandom",
1582
1601
  "once_cell",
1583
1602
  "rustix",
1584
- "windows-sys 0.61.2",
1603
+ "windows-sys",
1585
1604
  ]
1586
1605
 
1587
1606
  [[package]]
@@ -1797,7 +1816,7 @@ version = "0.1.11"
1797
1816
  source = "registry+https://github.com/rust-lang/crates.io-index"
1798
1817
  checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22"
1799
1818
  dependencies = [
1800
- "windows-sys 0.61.2",
1819
+ "windows-sys",
1801
1820
  ]
1802
1821
 
1803
1822
  [[package]]
@@ -1806,15 +1825,6 @@ version = "0.2.1"
1806
1825
  source = "registry+https://github.com/rust-lang/crates.io-index"
1807
1826
  checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
1808
1827
 
1809
- [[package]]
1810
- name = "windows-sys"
1811
- version = "0.60.2"
1812
- source = "registry+https://github.com/rust-lang/crates.io-index"
1813
- checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb"
1814
- dependencies = [
1815
- "windows-targets",
1816
- ]
1817
-
1818
1828
  [[package]]
1819
1829
  name = "windows-sys"
1820
1830
  version = "0.61.2"
@@ -1824,71 +1834,6 @@ dependencies = [
1824
1834
  "windows-link",
1825
1835
  ]
1826
1836
 
1827
- [[package]]
1828
- name = "windows-targets"
1829
- version = "0.53.5"
1830
- source = "registry+https://github.com/rust-lang/crates.io-index"
1831
- checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3"
1832
- dependencies = [
1833
- "windows-link",
1834
- "windows_aarch64_gnullvm",
1835
- "windows_aarch64_msvc",
1836
- "windows_i686_gnu",
1837
- "windows_i686_gnullvm",
1838
- "windows_i686_msvc",
1839
- "windows_x86_64_gnu",
1840
- "windows_x86_64_gnullvm",
1841
- "windows_x86_64_msvc",
1842
- ]
1843
-
1844
- [[package]]
1845
- name = "windows_aarch64_gnullvm"
1846
- version = "0.53.1"
1847
- source = "registry+https://github.com/rust-lang/crates.io-index"
1848
- checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53"
1849
-
1850
- [[package]]
1851
- name = "windows_aarch64_msvc"
1852
- version = "0.53.1"
1853
- source = "registry+https://github.com/rust-lang/crates.io-index"
1854
- checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006"
1855
-
1856
- [[package]]
1857
- name = "windows_i686_gnu"
1858
- version = "0.53.1"
1859
- source = "registry+https://github.com/rust-lang/crates.io-index"
1860
- checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3"
1861
-
1862
- [[package]]
1863
- name = "windows_i686_gnullvm"
1864
- version = "0.53.1"
1865
- source = "registry+https://github.com/rust-lang/crates.io-index"
1866
- checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c"
1867
-
1868
- [[package]]
1869
- name = "windows_i686_msvc"
1870
- version = "0.53.1"
1871
- source = "registry+https://github.com/rust-lang/crates.io-index"
1872
- checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2"
1873
-
1874
- [[package]]
1875
- name = "windows_x86_64_gnu"
1876
- version = "0.53.1"
1877
- source = "registry+https://github.com/rust-lang/crates.io-index"
1878
- checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499"
1879
-
1880
- [[package]]
1881
- name = "windows_x86_64_gnullvm"
1882
- version = "0.53.1"
1883
- source = "registry+https://github.com/rust-lang/crates.io-index"
1884
- checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1"
1885
-
1886
- [[package]]
1887
- name = "windows_x86_64_msvc"
1888
- version = "0.53.1"
1889
- source = "registry+https://github.com/rust-lang/crates.io-index"
1890
- checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650"
1891
-
1892
1837
  [[package]]
1893
1838
  name = "winnow"
1894
1839
  version = "1.0.4"
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "cmakefmt-rust"
3
- version = "2.3.0"
3
+ version = "2.3.1"
4
4
  edition = "2021"
5
5
  description = "A fast, correct CMake formatter"
6
6
  license = "MIT OR Apache-2.0"
@@ -36,7 +36,7 @@ crate-type = ["cdylib", "rlib"]
36
36
  default = ["cli"]
37
37
  browser-wasm = ["dep:wasm-bindgen"]
38
38
  dprint-plugin = ["dep:dprint-core"]
39
- lsp = ["lsp-server", "lsp-types"]
39
+ lsp = ["lsp-server", "lsp-types", "ec4rs"]
40
40
  cli = [
41
41
  "lsp",
42
42
  "clap",
@@ -92,7 +92,7 @@ rmp-serde = "1"
92
92
 
93
93
  [dev-dependencies]
94
94
  insta = "1"
95
- codspeed-criterion-compat = { version = "5.0", features = ["html_reports"] }
95
+ codspeed-criterion-compat = { version = "6.0", features = ["html_reports"] }
96
96
  tempfile = "3"
97
97
  pest = "2"
98
98
  pest_derive = "2"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cmakefmt
3
- Version: 2.3.0
3
+ Version: 2.3.1
4
4
  Classifier: Development Status :: 4 - Beta
5
5
  Classifier: Intended Audience :: Developers
6
6
  Classifier: License :: OSI Approved :: MIT License
@@ -1012,11 +1012,7 @@ pub(crate) fn build_context(
1012
1012
  ) -> Result<(Config, CommandRegistry, ConfigContext), cmakefmt::Error> {
1013
1013
  let config_context = resolve_config_context(cli, file_path);
1014
1014
 
1015
- let mut config = Config::from_files(&config_context.sources)?;
1016
- let mut registry = CommandRegistry::builtins().clone();
1017
- for path in &config_context.sources {
1018
- registry.merge_override_file(path)?;
1019
- }
1015
+ let (mut config, registry) = Config::from_files_with_registry(&config_context.sources)?;
1020
1016
 
1021
1017
  // Apply .editorconfig fallback when no cmakefmt config file was found.
1022
1018
  if matches!(config_context.mode, ConfigSourceMode::DefaultsOnly)
@@ -69,7 +69,7 @@ struct FormatSection {
69
69
  max_hanging_wrap_lines: Option<usize>,
70
70
  /// Maximum positional arguments to keep in a hanging-wrap layout. Default: `6`.
71
71
  max_hanging_wrap_positional_args: Option<usize>,
72
- /// Maximum keyword/flag subgroups to keep in a hanging-wrap layout. Default: `2`.
72
+ /// Maximum argument subgroups to keep together in a hanging-wrap layout. Default: `0` (vertical).
73
73
  max_hanging_wrap_groups: Option<usize>,
74
74
  /// Maximum rows a hanging-wrap positional group may consume before nesting is forced. Default: `2`.
75
75
  max_rows_cmdline: Option<usize>,
@@ -688,6 +688,20 @@ impl Config {
688
688
  Ok(config)
689
689
  }
690
690
 
691
+ /// Load formatting options and command specs from the same config files.
692
+ ///
693
+ /// Later files override earlier files in both the config and registry.
694
+ #[cfg(all(not(target_arch = "wasm32"), any(feature = "cli", feature = "lsp")))]
695
+ #[cfg_attr(docsrs, doc(cfg(any(feature = "cli", feature = "lsp"))))]
696
+ pub fn from_files_with_registry(paths: &[PathBuf]) -> Result<(Self, crate::CommandRegistry)> {
697
+ let config = Self::from_files(paths)?;
698
+ let mut registry = crate::CommandRegistry::builtins().clone();
699
+ for path in paths {
700
+ registry.merge_override_file(path)?;
701
+ }
702
+ Ok((config, registry))
703
+ }
704
+
691
705
  /// Parse a YAML config string through the same `FileConfig` schema used by
692
706
  /// config files and return the resolved runtime [`Config`].
693
707
  ///
@@ -1155,6 +1169,7 @@ command_case = "upper"
1155
1169
  );
1156
1170
  }
1157
1171
 
1172
+ #[cfg(feature = "cli")]
1158
1173
  #[test]
1159
1174
  fn toml_config_template_parses() {
1160
1175
  let template = default_config_template_for(DumpConfigFormat::Toml);
@@ -1449,6 +1464,7 @@ per_command_overrides:
1449
1464
 
1450
1465
  // ── from_yaml_str tests ─────────────────────────────────────────────
1451
1466
 
1467
+ #[cfg(feature = "cli")]
1452
1468
  #[test]
1453
1469
  fn effective_yaml_config_roundtrips_non_default_values() {
1454
1470
  let original = Config::from_yaml_str(
@@ -25,7 +25,7 @@
25
25
  //! [`Config::for_file`] load these files and return a resolved
26
26
  //! runtime [`Config`]. Unknown fields are rejected.
27
27
 
28
- #[cfg(all(not(target_arch = "wasm32"), feature = "cli"))]
28
+ #[cfg(all(not(target_arch = "wasm32"), any(feature = "cli", feature = "lsp")))]
29
29
  #[doc(hidden)]
30
30
  pub mod editorconfig;
31
31
  pub mod file;
@@ -272,7 +272,7 @@ pub enum ArgumentCommentStyle {
272
272
  /// | `max_empty_lines` | `1` |
273
273
  /// | `max_lines_hwrap` | `2` |
274
274
  /// | `max_pargs_hwrap` | `6` |
275
- /// | `max_subgroups_hwrap` | `2` |
275
+ /// | `max_subgroups_hwrap` | `0` |
276
276
  /// | `max_rows_cmdline` | `2` |
277
277
  /// | `command_case` | [`CaseStyle::Lower`] |
278
278
  /// | `keyword_case` | [`CaseStyle::Upper`] |
@@ -315,7 +315,8 @@ pub struct Config {
315
315
  /// Maximum number of positional arguments to keep in a hanging-wrap layout
316
316
  /// before going vertical.
317
317
  pub max_pargs_hwrap: usize,
318
- /// Maximum number of keyword/flag subgroups to keep in a horizontal wrap.
318
+ /// Maximum number of argument subgroups to keep together in a horizontal wrap.
319
+ /// Defaults to `0` to preserve vertical layouts for wrapped grouped calls.
319
320
  pub max_subgroups_hwrap: usize,
320
321
  /// Maximum rows a hanging-wrap positional group may consume before the
321
322
  /// layout is rejected and nesting is forced.
@@ -462,7 +463,7 @@ impl Default for Config {
462
463
  max_empty_lines: 1,
463
464
  max_lines_hwrap: 2,
464
465
  max_pargs_hwrap: 6,
465
- max_subgroups_hwrap: 2,
466
+ max_subgroups_hwrap: 0,
466
467
  max_rows_cmdline: 2,
467
468
  always_wrap: Vec::new(),
468
469
  require_valid_layout: false,
@@ -190,6 +190,15 @@ pub(crate) fn format_command(
190
190
  cmd_config.max_pargs_hwrap()
191
191
  ));
192
192
  hanging
193
+ } else if let Some(grouped) = (!wrap_after_first_arg)
194
+ .then(|| try_format_grouped(command, &sections, form, &cmd_config, block_depth))
195
+ .flatten()
196
+ {
197
+ debug.log(format!(
198
+ "formatter: command {} layout=grouped-hanging-wrap",
199
+ command.name
200
+ ));
201
+ grouped
193
202
  } else {
194
203
  debug.log(format!(
195
204
  "formatter: command {} layout=vertical thresholds(line_width={}, max_hanging_wrap_lines={}, max_hanging_wrap_positional_args={}, max_hanging_wrap_groups={})",
@@ -607,6 +616,92 @@ fn try_format_hanging(
607
616
  ))
608
617
  }
609
618
 
619
+ /// Pack simple argument sections into an indented command body, keeping each
620
+ /// keyword's wrapped values aligned under its first value. Structural groups
621
+ /// and comments retain the dedicated vertical writers below.
622
+ fn try_format_grouped(
623
+ command: &CommandInvocation,
624
+ sections: &[Section<'_>],
625
+ form: &CommandForm,
626
+ cmd_config: &CommandConfig<'_>,
627
+ block_depth: usize,
628
+ ) -> Option<String> {
629
+ if sections.len() < 2
630
+ || sections.len() > cmd_config.max_subgroups_hwrap()
631
+ || sections.iter().any(|section| {
632
+ section.arguments.len() > cmd_config.max_pargs_hwrap()
633
+ || section
634
+ .arguments
635
+ .iter()
636
+ .any(|arg| arg.is_comment() || argument_has_newline(arg))
637
+ || section.header.is_some_and(|header| {
638
+ lookup_kwarg(form, header)
639
+ .is_some_and(|spec| !spec.kwargs.is_empty() || !spec.flags.is_empty())
640
+ })
641
+ })
642
+ {
643
+ return None;
644
+ }
645
+
646
+ let base_indent = cmd_config.indent_str().repeat(block_depth);
647
+ let indent = format!("{base_indent}{}", cmd_config.indent_str());
648
+ let name = format_name(command, cmd_config);
649
+ let mut lines = vec![format!("{base_indent}{name}("), indent.clone()];
650
+ let mut width = indent.chars().count();
651
+ for section in sections {
652
+ let start_line = lines.len();
653
+ if let Some(header) = section.header {
654
+ if width > indent.chars().count() {
655
+ lines.last_mut()?.push(' ');
656
+ width += 1;
657
+ }
658
+ let header = apply_case(cmd_config.keyword_case(), header);
659
+ lines.last_mut()?.push_str(&header);
660
+ width += header.chars().count();
661
+ }
662
+ let continuation_width = if section.header.is_some() {
663
+ width + 1
664
+ } else {
665
+ width
666
+ };
667
+ let continuation = " ".repeat(continuation_width);
668
+ for (index, argument) in section.arguments.iter().enumerate() {
669
+ let needs_space = section.header.is_some() || index > 0;
670
+ let token = argument.as_str();
671
+ let candidate_width = width + usize::from(needs_space) + token.chars().count();
672
+ if candidate_width <= cmd_config.line_width() {
673
+ if needs_space {
674
+ lines.last_mut()?.push(' ');
675
+ }
676
+ lines.last_mut()?.push_str(token);
677
+ width = candidate_width;
678
+ } else {
679
+ // A keyword must retain at least its first value. If that
680
+ // pair cannot fit here, let the vertical layout separate groups.
681
+ if index == 0
682
+ || continuation_width + token.chars().count() > cmd_config.line_width()
683
+ {
684
+ return None;
685
+ }
686
+ lines.push(format!("{continuation}{token}"));
687
+ width = continuation_width + token.chars().count();
688
+ }
689
+ }
690
+ let rows = lines.len() - start_line + 1;
691
+ if rows > cmd_config.global().max_lines_hwrap
692
+ || (section.header.is_none() && rows > cmd_config.global().max_rows_cmdline)
693
+ || width > cmd_config.line_width()
694
+ {
695
+ return None;
696
+ }
697
+ }
698
+ let output = close_multiline(lines, &base_indent, name.len(), cmd_config);
699
+ output
700
+ .lines()
701
+ .all(|line| line.chars().count() <= cmd_config.line_width())
702
+ .then_some(output)
703
+ }
704
+
610
705
  fn format_command_vertical(
611
706
  command: &CommandInvocation,
612
707
  sections: &[Section<'_>],