mirror of
https://github.com/rust-lang/cargo
synced 2024-08-27 19:29:21 +00:00
chore: Deny warnings across entire cargo repo
This commit is contained in:
parent
dca10d17db
commit
d52f29897a
9
.github/workflows/main.yml
vendored
9
.github/workflows/main.yml
vendored
|
@ -35,6 +35,8 @@ jobs:
|
||||||
CARGO_PROFILE_TEST_DEBUG: 1
|
CARGO_PROFILE_TEST_DEBUG: 1
|
||||||
CARGO_INCREMENTAL: 0
|
CARGO_INCREMENTAL: 0
|
||||||
CARGO_PUBLIC_NETWORK_TESTS: 1
|
CARGO_PUBLIC_NETWORK_TESTS: 1
|
||||||
|
# Deny warnings on CI to avoid warnings getting into the codebase.
|
||||||
|
RUSTFLAGS: -D warnings
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
|
@ -85,8 +87,7 @@ jobs:
|
||||||
run: echo CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse >> $GITHUB_ENV
|
run: echo CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse >> $GITHUB_ENV
|
||||||
if: "!contains(matrix.rust, 'stable')"
|
if: "!contains(matrix.rust, 'stable')"
|
||||||
|
|
||||||
# Deny warnings on CI to avoid warnings getting into the codebase.
|
- run: cargo test
|
||||||
- run: cargo test --features 'deny-warnings'
|
|
||||||
# The testsuite generates a huge amount of data, and fetch-smoke-test was
|
# The testsuite generates a huge amount of data, and fetch-smoke-test was
|
||||||
# running out of disk space.
|
# running out of disk space.
|
||||||
- name: Clear test output
|
- name: Clear test output
|
||||||
|
@ -100,8 +101,8 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
# This only tests `cargo fix` because fix-proxy-mode is one of the most
|
# This only tests `cargo fix` because fix-proxy-mode is one of the most
|
||||||
# complicated subprocess management in Cargo.
|
# complicated subprocess management in Cargo.
|
||||||
cargo test --test testsuite --features 'deny-warnings' -- fix::
|
cargo test --test testsuite -- fix::
|
||||||
- run: cargo test --features 'deny-warnings' --manifest-path crates/cargo-test-support/Cargo.toml
|
- run: cargo test --manifest-path crates/cargo-test-support/Cargo.toml
|
||||||
env:
|
env:
|
||||||
CARGO_TARGET_DIR: target
|
CARGO_TARGET_DIR: target
|
||||||
- run: cargo test -p cargo-platform
|
- run: cargo test -p cargo-platform
|
||||||
|
|
|
@ -112,7 +112,6 @@ test = false
|
||||||
doc = false
|
doc = false
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
deny-warnings = []
|
|
||||||
vendored-openssl = ["openssl/vendored"]
|
vendored-openssl = ["openssl/vendored"]
|
||||||
vendored-libgit2 = ["libgit2-sys/vendored"]
|
vendored-libgit2 = ["libgit2-sys/vendored"]
|
||||||
pretty-env-logger = ["pretty_env_logger"]
|
pretty-env-logger = ["pretty_env_logger"]
|
||||||
|
|
|
@ -30,6 +30,3 @@ url = "2.2.2"
|
||||||
|
|
||||||
[target.'cfg(windows)'.dependencies]
|
[target.'cfg(windows)'.dependencies]
|
||||||
windows-sys = { version = "0.45.0", features = ["Win32_Storage_FileSystem"] }
|
windows-sys = { version = "0.45.0", features = ["Win32_Storage_FileSystem"] }
|
||||||
|
|
||||||
[features]
|
|
||||||
deny-warnings = []
|
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
//! See <https://rust-lang.github.io/cargo/contrib/> for a guide on writing tests.
|
//! See <https://rust-lang.github.io/cargo/contrib/> for a guide on writing tests.
|
||||||
|
|
||||||
#![allow(clippy::all)]
|
#![allow(clippy::all)]
|
||||||
#![cfg_attr(feature = "deny-warnings", deny(warnings))]
|
|
||||||
|
|
||||||
use std::env;
|
use std::env;
|
||||||
use std::ffi::OsStr;
|
use std::ffi::OsStr;
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
// For various reasons, some idioms are still allow'ed, but we would like to
|
// For various reasons, some idioms are still allow'ed, but we would like to
|
||||||
// test and enforce them.
|
// test and enforce them.
|
||||||
#![warn(rust_2018_idioms)]
|
#![warn(rust_2018_idioms)]
|
||||||
#![cfg_attr(feature = "deny-warnings", deny(warnings))]
|
|
||||||
// Due to some of the default clippy lints being somewhat subjective and not
|
// Due to some of the default clippy lints being somewhat subjective and not
|
||||||
// necessarily an improvement, we prefer to not use them at this time.
|
// necessarily an improvement, we prefer to not use them at this time.
|
||||||
#![allow(clippy::all)]
|
#![allow(clippy::all)]
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
// See src/cargo/lib.rs for notes on these lint settings.
|
// See src/cargo/lib.rs for notes on these lint settings.
|
||||||
#![warn(rust_2018_idioms)]
|
#![warn(rust_2018_idioms)]
|
||||||
#![allow(clippy::all)]
|
#![allow(clippy::all)]
|
||||||
#![cfg_attr(feature = "deny-warnings", deny(warnings))]
|
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate cargo_test_macro;
|
extern crate cargo_test_macro;
|
||||||
|
|
Loading…
Reference in a new issue