Skip to content

Commit 9f3b488

Browse files
committed
Auto merge of #12178 - weihanglo:dogfood-lints-table, r=epage
chore: dogfood Cargo `-Zlints` table feature
2 parents 85273ad + e2f5925 commit 9f3b488

File tree

45 files changed

+133
-47
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+133
-47
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,7 @@ jobs:
6666
- uses: actions/checkout@v4
6767
- run: rustup update stable && rustup default stable
6868
- run: rustup component add clippy
69-
# Only check cargo lib for now
70-
# TODO: check every members
71-
- run: cargo clippy -p cargo --lib --no-deps -- -D warnings
69+
- run: cargo clippy --workspace --all-targets --no-deps -- -D warnings
7270

7371
stale-label:
7472
runs-on: ubuntu-latest
@@ -110,8 +108,6 @@ jobs:
110108
CARGO_PROFILE_TEST_DEBUG: 1
111109
CARGO_INCREMENTAL: 0
112110
CARGO_PUBLIC_NETWORK_TESTS: 1
113-
# Deny warnings on CI to avoid warnings getting into the codebase.
114-
RUSTFLAGS: -D warnings
115111
strategy:
116112
matrix:
117113
include:

Cargo.lock

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,20 @@ varisat = "0.2.2"
106106
walkdir = "2.4.0"
107107
windows-sys = "0.48"
108108

109+
[workspace.lints.rust]
110+
rust_2018_idioms = "warn" # TODO: could this be removed?
111+
112+
[workspace.lints.rustdoc]
113+
private_intra_doc_links = "allow"
114+
115+
[workspace.lints.clippy]
116+
all = { level = "allow", priority = -1 }
117+
dbg_macro = "warn"
118+
disallowed_methods = "warn"
119+
print_stderr = "warn"
120+
print_stdout = "warn"
121+
self_named_module_files = "warn"
122+
109123
[package]
110124
name = "cargo"
111125
version = "0.77.0"
@@ -234,3 +248,6 @@ vendored-openssl = ["openssl/vendored"]
234248
vendored-libgit2 = ["libgit2-sys/vendored"]
235249
# This is primarily used by rust-lang/rust distributing cargo the executable.
236250
all-static = ['vendored-openssl', 'curl/static-curl', 'curl/force-system-lib-on-osx']
251+
252+
[lints]
253+
workspace = true

benches/benchsuite/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,6 @@ harness = false
3232
[[bench]]
3333
name = "global_cache_tracker"
3434
harness = false
35+
36+
[lints]
37+
workspace = true

benches/benchsuite/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![allow(clippy::disallowed_methods)]
2+
13
use cargo::Config;
24
use std::fs;
35
use std::path::{Path, PathBuf};

benches/capture/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@ cargo_metadata.workspace = true
1212
flate2.workspace = true
1313
tar.workspace = true
1414
toml.workspace = true
15+
16+
[lints]
17+
workspace = true

benches/capture/src/main.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
//! Use the `-f` flag to allow it to overwrite existing captures.
55
//! The workspace will be saved in a `.tgz` file in the `../workspaces` directory.
66
7+
#![allow(clippy::disallowed_methods)]
8+
#![allow(clippy::print_stderr)]
9+
710
use flate2::{Compression, GzBuilder};
811
use std::fs;
912
use std::path::{Path, PathBuf};

crates/cargo-platform/Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "cargo-platform"
3-
version = "0.1.6"
3+
version = "0.1.7"
44
edition.workspace = true
55
license.workspace = true
66
rust-version = "1.70.0" # MSRV:3
@@ -11,3 +11,6 @@ description = "Cargo's representation of a target platform."
1111

1212
[dependencies]
1313
serde.workspace = true
14+
15+
[lints]
16+
workspace = true

crates/cargo-platform/examples/matches.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
//! This example demonstrates how to filter a Platform based on the current
22
//! host target.
33
4+
#![allow(clippy::print_stdout)]
5+
46
use cargo_platform::{Cfg, Platform};
57
use std::process::Command;
68
use std::str::FromStr;

crates/cargo-test-macro/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@ publish = false
1212

1313
[lib]
1414
proc-macro = true
15+
16+
[lints]
17+
workspace = true

0 commit comments

Comments
 (0)