Repository navigation
Expand file tree
/
Copy pathCargo.toml
More file actions
204 lines (189 loc) · 7.84 KB
/
Copy pathCargo.toml
File metadata and controls
204 lines (189 loc) · 7.84 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
[package]
name = "cargo-fallow"
version = "0.3.0"
edition = "2024"
# The floor of fallow-report-protocol.
rust-version = "1.98"
license = "MIT"
description = "Codebase analysis for Rust workspaces, as a Cargo subcommand"
repository = "https://github.com/fallow-rs/cargo-fallow"
documentation = "https://github.com/fallow-rs/cargo-fallow/blob/main/docs/README.md"
readme = "README.md"
keywords = ["cargo", "cargo-subcommand", "static-analysis", "mutation-testing"]
categories = ["development-tools::cargo-plugins"]
# The package holds the source, the manifest, the lock file, the license, the
# README and the CHANGELOG only. scripts/check-package.mjs checks the list.
include = ["/src/**/*.rs", "/src/hooks/gate.sh", "/skills/cargo-fallow/SKILL.md", "/LICENSE", "/README.md", "/CHANGELOG.md"]
# The fixtures and the fuzz crate have their own `[workspace]` tables. This
# table keeps their manifests out of the root workspace.
[workspace]
exclude = ["tests/fixtures", "fuzz"]
# The package installs only `cargo-fallow`. It never installs a binary named
# `fallow`, because that name belongs to the JavaScript CLI.
[[bin]]
name = "cargo-fallow"
path = "src/main.rs"
[dependencies]
# The `schema` feature gives the JSON Schema of the shared wire types, for
# `cargo fallow schema`.
fallow-report-protocol = { version = "3.38", features = ["schema"] }
clap = { version = "4", features = ["derive"] }
cargo_metadata = "0.23"
serde = { version = "1", features = ["derive"] }
serde_json = { version = "1", features = ["preserve_order"] }
# The `ra_ap_*` crates release together about each week, and the API can
# change in each release. Keep every `ra_ap_*` crate on one version, and update
# them together on a fixed schedule, not through Dependabot. The version is
# 0.0.358 because `ra_ap_hir` and its siblings have no later release.
ra_ap_parser = "=0.0.358"
ra_ap_syntax = "=0.0.358"
# Only the `precise` feature uses these crates.
ra_ap_hir = { version = "=0.0.358", optional = true }
ra_ap_ide_db = { version = "=0.0.358", optional = true }
ra_ap_load-cargo = { version = "=0.0.358", optional = true }
ra_ap_paths = { version = "=0.0.358", optional = true }
ra_ap_project_model = { version = "=0.0.358", optional = true }
ra_ap_vfs = { version = "=0.0.358", optional = true }
rustc-hash = "2"
schemars = "1"
tempfile = "3"
toml_edit = { version = "0.25", default-features = false, features = ["parse", "display"] }
xxhash-rust = { version = "0.8", features = ["xxh3"] }
[features]
# `--precise` mode of `cargo fallow visibility`: rust-analyzer as a library,
# about 150 more crates. The default build has no `ra_ap_*` crate beyond the
# parser.
precise = [
"dep:ra_ap_hir",
"dep:ra_ap_ide_db",
"dep:ra_ap_load-cargo",
"dep:ra_ap_paths",
"dep:ra_ap_project_model",
"dep:ra_ap_vfs",
]
[dev-dependencies]
assert_cmd = "2"
# Validates the JSON reports against `docs/output-schema.json`. No default
# feature: the tests resolve no remote or file reference.
jsonschema = { version = "0.60", default-features = false }
serde_json = "1"
[lints.rust]
# Stricter than fallow, which uses "warn". This crate has no unsafe code.
unsafe_code = "forbid"
missing_docs = "warn"
# The lints below are the same as `[workspace.lints.rust]` in fallow.
absolute_paths_not_starting_with_crate = "warn" # Prefer crate/self/super paths inside crates
# cargo-fuzz sets `cfg(fuzzing)`. fallow also declares `cfg(miri)`. This
# crate has no Miri job, so it does not declare that name.
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(fuzzing)'] }
unsafe_op_in_unsafe_fn = "warn" # Require unsafe blocks even inside unsafe fn
unused_unsafe = "warn" # Catch unnecessary unsafe blocks
non_ascii_idents = "warn" # Prevent non-ASCII identifiers
unit_bindings = "warn" # Catch useless `let _ = expr` bindings
tail_expr_drop_order = "warn" # Catch temporaries dropped in surprising order
[lints.clippy]
# Lint groups (priority -1 so individual overrides take precedence)
all = { level = "warn", priority = -1 }
pedantic = { level = "warn", priority = -1 }
nursery = { level = "warn", priority = -1 }
cargo = { level = "warn", priority = -1 }
# Restriction lints, the same list as fallow.
dbg_macro = "warn"
todo = "warn"
print_stdout = "warn"
print_stderr = "warn"
clone_on_ref_ptr = "warn"
empty_drop = "warn"
empty_structs_with_brackets = "warn"
exit = "warn"
get_unwrap = "warn"
unwrap_used = "warn"
expect_used = "warn"
rc_buffer = "warn"
rc_mutex = "warn"
undocumented_unsafe_blocks = "warn"
unnecessary_safety_comment = "warn"
unused_result_ok = "warn"
infinite_loop = "warn"
self_named_module_files = "warn"
pathbuf_init_then_push = "warn"
excessive_nesting = "warn"
allow_attributes_without_reason = "warn"
unimplemented = "warn"
filetype_is_file = "warn"
rest_pat_in_fully_bound_structs = "warn"
pub_underscore_fields = "warn"
non_zero_suggestions = "warn"
precedence_bits = "warn"
map_with_unused_argument_over_ranges = "warn"
iter_on_single_items = "warn"
redundant_clone = "warn"
significant_drop_in_scrutinee = "warn"
suspicious_operation_groupings = "warn"
unused_peekable = "warn"
mem_forget = "warn"
lossy_float_literal = "warn"
mixed_read_write_in_expression = "warn"
try_err = "warn"
fn_to_numeric_cast_any = "warn"
float_cmp_const = "warn"
string_lit_chars_any = "warn"
format_push_string = "warn"
mutex_atomic = "warn"
suspicious_xor_used_as_pow = "warn"
empty_enum_variants_with_brackets = "warn"
multiple_unsafe_ops_per_block = "warn"
unwrap_in_result = "warn"
string_add = "warn"
redundant_type_annotations = "warn"
deref_by_slicing = "warn"
# Pedantic exceptions, the same as fallow.
module_name_repetitions = "allow"
must_use_candidate = "allow"
missing_errors_doc = "allow"
cast_possible_truncation = "allow"
cast_precision_loss = "allow"
too_many_lines = "warn"
items_after_statements = "allow"
single_match_else = "allow"
redundant_closure_for_method_calls = "allow"
similar_names = "allow"
wildcard_imports = "allow"
doc_markdown = "allow" # False positives on technical terms
too_long_first_doc_paragraph = "allow" # Too strict for module-level docs
struct_excessive_bools = "allow" # CLI filter structs need many bools
fn_params_excessive_bools = "allow" # Same reason
# Allow nursery lints that are too noisy or have false positives
option_if_let_else = "allow" # Too many false positives in match-heavy code
missing_const_for_fn = "allow" # Not a const library
fallible_impl_from = "allow" # From impls that can fail are intentional
use_self = "allow" # Too noisy with generics
unused_async_trait_impl = "allow" # Trait signatures (tower-lsp, rmcp) require async fn without .await
assert_is_empty = "allow" # The assert_eq! form needs `[] as [T; 0]` for most collections
# Process-spawn ban (method list lives in .clippy.toml). Allowed crate-wide,
# the same as the fallow workspace. src/lib.rs denies it again at the crate
# root, and the workspace loader carries the one narrow expectation.
disallowed_methods = "allow"
# The dependency tree has duplicate versions that this crate cannot remove,
# for example the windows-sys versions of clap and tempfile.
multiple_crate_versions = "allow"
# The same settings as `[profile.release]` in fallow, except `panic`. fallow
# aborts on a panic. This binary unwinds, because the bounded parse in
# src/parse.rs turns a parser panic into a result for one file.
[profile.release]
lto = true
codegen-units = 1
strip = "symbols"
opt-level = 3
panic = "unwind"
# A release-like build for the parse stack tests in CI: the same optimization
# and no debug assertions, so `src/parse.rs` uses its release stack values.
# LTO and one codegen unit only make the build slower.
[profile.ci-release]
inherits = "release"
lto = false
codegen-units = 16
strip = "none"
# Optimize heavy deps for size, not in the hot path. The same as fallow.
[profile.release.package.clap_builder]
opt-level = "z"