Skip to content

Commit eb17f9d

Browse files
committed
chore(deps): point perfectionist at KSXGitHub/perfectionist#25
PR #25 (commit d8c545f) fixes both issues filed in #408 and #409: macro_trailing_comma now skips rustfmt-compatible compact layouts (single-element multi-line bracket macros) and properly fulfills cfg_attr-gated expects. * Drop the crate-level suppression scaffolding in tests/tree_builder.rs and tests/visualizer.rs: the rule no longer fires on vec![Single { ... }] / vec![single(...)] shapes that rustfmt actively collapses. * Drop the trailing commas added to dbg!(vec![...]) call sites in test_remove_overlapping_paths.rs, which fell into the same compact-layout category and are no longer flagged. The single-argument multi-line panic! in src/hardlink/hardlink_list/summary.rs still requires the trailing comma because PR #25 only relaxes the rule for bracket-delimited compact layouts, not parenthesised single-argument macros.
1 parent 9aaeda8 commit eb17f9d

4 files changed

Lines changed: 11 additions & 53 deletions

File tree

dylint.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[workspace.metadata.dylint]
22
libraries = [
3-
{ git = "https://github.com/KSXGitHub/perfectionist", tag = "0.0.0-rc.6" },
3+
{ git = "https://github.com/KSXGitHub/perfectionist", rev = "d8c545fd782c6a707f056ed7b5e953f2824bbb76" },
44
]

src/app/overlapping_arguments/test_remove_overlapping_paths.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ fn remove_duplicated_arguments() {
9090
"0/1/2",
9191
"./bar",
9292
"./abc/./def",
93-
],);
93+
]);
9494
let mut actual = original.clone();
9595
remove_overlapping_paths::<MockedApi>(&mut actual);
9696
let expected = vec!["foo", "bar", "abc/def", "0/1/2"];
@@ -104,7 +104,7 @@ fn remove_duplicated_arguments() {
104104
"abc/def",
105105
"foo",
106106
"0/1/2",
107-
],);
107+
]);
108108
let mut actual = original.clone();
109109
remove_overlapping_paths::<MockedApi>(&mut actual);
110110
let expected = vec!["foo", "./bar", "./abc/./def", "0/1/2"];
@@ -145,7 +145,7 @@ fn remove_all_except_current_dir() {
145145
"abc/def",
146146
"0/1/2",
147147
MOCKED_CURRENT_DIR,
148-
],);
148+
]);
149149
let mut actual = original.clone();
150150
remove_overlapping_paths::<MockedApi>(&mut actual);
151151
let expected = vec!["."];
@@ -158,7 +158,7 @@ fn remove_all_except_current_dir() {
158158
".",
159159
"abc/def",
160160
"0/1/2",
161-
],);
161+
]);
162162
let mut actual = original.clone();
163163
remove_overlapping_paths::<MockedApi>(&mut actual);
164164
let expected = vec![MOCKED_CURRENT_DIR];
@@ -182,7 +182,7 @@ fn remove_all_except_parent_dir() {
182182
"abc/def",
183183
".",
184184
"0/1/2",
185-
],);
185+
]);
186186
let mut actual = original.clone();
187187
remove_overlapping_paths::<MockedApi>(&mut actual);
188188
let expected = vec!["/home/user"];
@@ -199,7 +199,7 @@ fn remove_overlapping_real_paths() {
199199
"link-to-foo/child",
200200
"link-to-bar/a/b/c",
201201
"0/1/2",
202-
],);
202+
]);
203203
let mut actual = original.clone();
204204
remove_overlapping_paths::<MockedApi>(&mut actual);
205205
let expected = vec!["foo", "bar", "abc/def", "0/1/2"];
@@ -212,7 +212,7 @@ fn remove_overlapping_real_paths() {
212212
"bar",
213213
"abc/def",
214214
"0/1/2",
215-
],);
215+
]);
216216
let mut actual = original.clone();
217217
remove_overlapping_paths::<MockedApi>(&mut actual);
218218
let expected = vec!["foo", "bar", "abc/def", "0/1/2"];
@@ -225,7 +225,7 @@ fn remove_overlapping_real_paths() {
225225
"abc/def",
226226
"link-to-current-dir/bar",
227227
"0/1/2",
228-
],);
228+
]);
229229
let mut actual = original.clone();
230230
remove_overlapping_paths::<MockedApi>(&mut actual);
231231
let expected = vec!["link-to-current-dir/foo", "bar", "abc/def", "0/1/2"];
@@ -242,7 +242,7 @@ fn do_not_remove_symlinks() {
242242
"link-to-foo",
243243
"link-to-bar",
244244
"0/1/2",
245-
],);
245+
]);
246246
let mut actual = original.clone();
247247
remove_overlapping_paths::<MockedApi>(&mut actual);
248248
let expected = original;
@@ -255,7 +255,7 @@ fn do_not_remove_symlinks() {
255255
"link-to-foo",
256256
"link-to-bar",
257257
"0/1/2",
258-
],);
258+
]);
259259
let mut actual = original.clone();
260260
remove_overlapping_paths::<MockedApi>(&mut actual);
261261
let expected = original;

tests/tree_builder.rs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,3 @@
1-
#![cfg_attr(dylint_lib = "perfectionist", feature(register_tool))]
2-
#![cfg_attr(dylint_lib = "perfectionist", register_tool(perfectionist))]
3-
#![cfg_attr(
4-
dylint_lib = "perfectionist",
5-
expect(
6-
perfectionist::macro_trailing_comma,
7-
reason = "rustfmt collapses single-element multi-line vec! and removes the trailing comma; see https://github.com/KSXGitHub/perfectionist/issues"
8-
)
9-
)]
10-
#![cfg_attr(
11-
dylint_lib = "perfectionist",
12-
allow(
13-
unfulfilled_lint_expectations,
14-
reason = "perfectionist's macro_trailing_comma short-circuits when its lint is allowed/expected at crate scope, so #[expect] cannot be fulfilled even though violations exist"
15-
)
16-
)]
17-
#![allow(
18-
unexpected_cfgs,
19-
reason = "`dylint_lib` is set by dylint's compiler wrapper and is not in --check-cfg"
20-
)]
21-
221
use build_fs_tree::{FileSystemTree, dir, file};
232
use derive_more::From;
243
use parallel_disk_usage::{

tests/visualizer.rs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,3 @@
1-
#![cfg_attr(dylint_lib = "perfectionist", feature(register_tool))]
2-
#![cfg_attr(dylint_lib = "perfectionist", register_tool(perfectionist))]
3-
#![cfg_attr(
4-
dylint_lib = "perfectionist",
5-
expect(
6-
perfectionist::macro_trailing_comma,
7-
reason = "rustfmt collapses single-element multi-line vec! and removes the trailing comma; see https://github.com/KSXGitHub/perfectionist/issues"
8-
)
9-
)]
10-
#![cfg_attr(
11-
dylint_lib = "perfectionist",
12-
allow(
13-
unfulfilled_lint_expectations,
14-
reason = "perfectionist's macro_trailing_comma short-circuits when its lint is allowed/expected at crate scope, so #[expect] cannot be fulfilled even though violations exist"
15-
)
16-
)]
17-
#![allow(
18-
unexpected_cfgs,
19-
reason = "`dylint_lib` is set by dylint's compiler wrapper and is not in --check-cfg"
20-
)]
21-
221
use parallel_disk_usage::{
232
bytes_format::BytesFormat::*,
243
data_tree::DataTree,

0 commit comments

Comments
 (0)