-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdylint.toml
More file actions
97 lines (89 loc) · 3.52 KB
/
Copy pathdylint.toml
File metadata and controls
97 lines (89 loc) · 3.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# Dylint configuration. cargo-dylint reads `[workspace.metadata.dylint]`
# from this file (or, equivalently, from `Cargo.toml`). Keeping the table
# here keeps the workspace `Cargo.toml` focused on cargo-native metadata
# and makes the cache key for CI easy to compute (see the `dylint` job
# in `.github/workflows/ci.yml`).
#
# Run with: `cargo dylint --all -- --all-targets --workspace`
# or via the `just dylint` recipe.
[workspace.metadata.dylint]
libraries = [
{ git = "https://github.com/KSXGitHub/perfectionist", tag = "0.0.0-rc.22" },
]
# Project-local DSL / test macros that perfectionist's exactly-once
# heuristic cannot peer through. perfectionist's built-in allow set already
# covers `concat!`, `json!`, and the `assert_*_snapshot!` family, so they
# do not need to be repeated here.
["perfectionist::impure_macro_arguments"]
ignore = [
# `pacquet_testing_utils::allow_known_failure!` binds its argument
# to a `let` internally before the match, so the expression is
# evaluated exactly once. The rule cannot peer through the macro
# body to see that.
"allow_known_failure",
# Test-local `static_env!` (in `npmrc_auth/tests.rs`) generates an
# `EnvVar` impl. The `&[(...)]` slice expression it receives binds
# to a local inside the impl, evaluated once on each `var(name)`
# call.
"static_env",
# Test-local `case!` (in `pkg_*_*/tests.rs`) takes
# `$input:expr, $message:expr, $variant:pat`. The lint sees the
# `$variant` slot's token stream as a non-trivial expression even
# though it's parsed as a pattern. The macro binds `$input` to a
# local on entry, so the exactly-once contract holds.
"case",
# `rusqlite::params!` is a DSL macro that wraps each arg as a
# `&dyn ToSql` reference. Args carry no side effects (they are
# already references / borrows that the macro forwards once);
# hoisting to a `let` is purely noise.
"params",
]
[perfectionist]
enable = ["unordered_derives"]
disable = [
"needless_borrowed_parameters",
"unpinned_repo_ref",
]
# Code spans read fine in `--help` and stay useful as `cargo doc` docs, so
# keep them; links and HTML remain forbidden and are cleaned from help text.
["perfectionist::clap_help_markdown"]
ignore_constructs = ["code_span"]
# The codebase collapses imports to one `use` per crate root (shared
# prefixes in nested braces) — the same granularity rustfmt spells
# `imports_granularity = "Crate"` and perfectionist spells `"crate"`. Pin
# the rule to it; its default `module` style would flag every such import.
["perfectionist::import_granularity_mismatch"]
style = "crate"
# Every unit test lives in an external file (shorter production files,
# less churn). Flag any inline test item, not just the ones over a line
# budget.
["perfectionist::excessive_inline_tests"]
inline_style = "external_only"
# Don't rely on the doc-comment-only default: a bare `#NNN` is just as
# ambiguous in a plain `//` comment, so lint those too.
["perfectionist::bare_issue_reference"]
include_plain_comments = true
# Narrowed to names that resolve in the documenting item's own module,
# multi-word only. Widening tracked in
# <https://github.com/pnpm/pnpm/issues/12716>.
["perfectionist::bare_identifier_reference"]
reference_scope = "own_module"
min_words = 2
["perfectionist::unordered_derives"]
style = "prefix_then_alphabetical"
prefix = [
"Debug",
"Default",
"Display",
"Error",
"Diagnostic",
"Clone",
"Copy",
"PartialEq",
"Eq",
"PartialOrd",
"Ord",
"Hash",
"Serialize",
"Deserialize",
]