pom-contract: adopt universal clippy/lint baseline; warnings to zero
Add the shared pedantic + unreachable_pub baseline. All resulting warnings
were machine-applicable (clippy --fix); no residue to hand-fix.
clippy --all-targets clean, cargo fmt clean, tests green.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2 files changed,
+40 insertions,
-10 deletions
| 8 |
8 |
|
[dependencies]
|
| 9 |
9 |
|
serde_json = "1"
|
| 10 |
10 |
|
toml = "1.1"
|
|
11 |
+ |
|
|
12 |
+ |
[lints.rust]
|
|
13 |
+ |
unused = "warn"
|
|
14 |
+ |
unreachable_pub = "warn"
|
|
15 |
+ |
|
|
16 |
+ |
[lints.clippy]
|
|
17 |
+ |
pedantic = { level = "warn", priority = -1 }
|
|
18 |
+ |
# Allow-list tuned from a measured breakdown across server/multithreaded/pter
|
|
19 |
+ |
# (2026-07-22). These are the high-churn / low-signal pedantic lints; everything
|
|
20 |
+ |
# else in `pedantic` stays a warning. Keep this block identical across repos.
|
|
21 |
+ |
module_name_repetitions = "allow"
|
|
22 |
+ |
# Doc lints — no docs-completeness push underway.
|
|
23 |
+ |
missing_errors_doc = "allow"
|
|
24 |
+ |
missing_panics_doc = "allow"
|
|
25 |
+ |
doc_markdown = "allow"
|
|
26 |
+ |
# Numeric casts — endemic and mostly intentional in size/byte math.
|
|
27 |
+ |
cast_possible_truncation = "allow"
|
|
28 |
+ |
cast_sign_loss = "allow"
|
|
29 |
+ |
cast_precision_loss = "allow"
|
|
30 |
+ |
cast_possible_wrap = "allow"
|
|
31 |
+ |
cast_lossless = "allow"
|
|
32 |
+ |
# Subjective structure/style nags — high churn, low signal.
|
|
33 |
+ |
must_use_candidate = "allow"
|
|
34 |
+ |
too_many_lines = "allow"
|
|
35 |
+ |
struct_excessive_bools = "allow"
|
|
36 |
+ |
similar_names = "allow"
|
|
37 |
+ |
items_after_statements = "allow"
|
|
38 |
+ |
single_match_else = "allow"
|
|
39 |
+ |
# Frequent false-positives in TUI/router-heavy code — added from the buckets breakdown.
|
|
40 |
+ |
match_same_arms = "allow"
|
|
41 |
+ |
unnecessary_wraps = "allow"
|
|
42 |
+ |
type_complexity = "allow"
|
| 70 |
70 |
|
for (key, expected) in json_fields {
|
| 71 |
71 |
|
let expected_str = expected
|
| 72 |
72 |
|
.as_str()
|
| 73 |
|
- |
.map(|s| s.to_string())
|
| 74 |
|
- |
.unwrap_or_else(|| expected.to_string());
|
|
73 |
+ |
.map_or_else(|| expected.to_string(), std::string::ToString::to_string);
|
| 75 |
74 |
|
|
| 76 |
75 |
|
match resolve_json_path(body, key) {
|
| 77 |
76 |
|
None => failures.push(format!(
|
| 91 |
90 |
|
}
|
| 92 |
91 |
|
}
|
| 93 |
92 |
|
|
| 94 |
|
- |
if !failures.is_empty() {
|
| 95 |
|
- |
panic!(
|
| 96 |
|
- |
"PoM schema-drift detected for target \"{target}\" — {} expectation(s) no longer resolve:\n{}\n\nFix: either restore the missing field in the response builder or drop the assertion from `{}`.",
|
| 97 |
|
- |
failures.len(),
|
| 98 |
|
- |
failures.join("\n"),
|
| 99 |
|
- |
path.display(),
|
| 100 |
|
- |
);
|
| 101 |
|
- |
}
|
|
93 |
+ |
assert!(
|
|
94 |
+ |
failures.is_empty(),
|
|
95 |
+ |
"PoM schema-drift detected for target \"{target}\" — {} expectation(s) no longer resolve:\n{}\n\nFix: either restore the missing field in the response builder or drop the assertion from `{}`.",
|
|
96 |
+ |
failures.len(),
|
|
97 |
+ |
failures.join("\n"),
|
|
98 |
+ |
path.display(),
|
|
99 |
+ |
);
|
| 102 |
100 |
|
}
|
| 103 |
101 |
|
|
| 104 |
102 |
|
/// Walk a dot-separated JSON path. Mirrors PoM's `resolve_json_path` exactly
|