Use -D warnings instead of deny-warnings feature.

This commit is contained in:
Jason Newcomb 2024-08-06 10:12:49 -04:00
parent c082bc2cb8
commit 4e57b2c46f
28 changed files with 23 additions and 52 deletions

View File

@ -25,6 +25,7 @@ env:
CARGO_TARGET_DIR: '${{ github.workspace }}/target'
NO_FMT_TEST: 1
CARGO_INCREMENTAL: 0
RUSTFLAGS: -D warnings
concurrency:
# For a given workflow, if we push to the same PR, cancel all previous builds on that PR.
@ -47,25 +48,25 @@ jobs:
# Run
- name: Build
run: cargo build --tests --features deny-warnings,internal
run: cargo build --tests --features internal
- name: Test
run: cargo test --features deny-warnings,internal
run: cargo test --features internal
- name: Test clippy_lints
run: cargo test --features deny-warnings,internal
run: cargo test --features internal
working-directory: clippy_lints
- name: Test clippy_utils
run: cargo test --features deny-warnings
run: cargo test
working-directory: clippy_utils
- name: Test rustc_tools_util
run: cargo test --features deny-warnings
run: cargo test
working-directory: rustc_tools_util
- name: Test clippy_dev
run: cargo test --features deny-warnings
run: cargo test
working-directory: clippy_dev
- name: Test clippy-driver

View File

@ -11,6 +11,7 @@ env:
CARGO_TARGET_DIR: '${{ github.workspace }}/target'
NO_FMT_TEST: 1
CARGO_INCREMENTAL: 0
RUSTFLAGS: -D warnings
concurrency:
# For a given workflow, if we push to the same branch, cancel all previous builds on that branch.
@ -85,34 +86,34 @@ jobs:
# Run
- name: Build
run: cargo build --tests --features deny-warnings,internal
run: cargo build --tests --features internal
- name: Test
if: matrix.host == 'x86_64-unknown-linux-gnu'
run: cargo test --features deny-warnings,internal
run: cargo test --features internal
- name: Test
if: matrix.host != 'x86_64-unknown-linux-gnu'
run: cargo test --features deny-warnings,internal -- --skip dogfood
run: cargo test --features internal -- --skip dogfood
- name: Test clippy_lints
run: cargo test --features deny-warnings,internal
run: cargo test --features internal
working-directory: clippy_lints
- name: Test clippy_utils
run: cargo test --features deny-warnings
run: cargo test
working-directory: clippy_utils
- name: Test clippy_config
run: cargo test --features deny-warnings
run: cargo test
working-directory: clippy_config
- name: Test rustc_tools_util
run: cargo test --features deny-warnings
run: cargo test
working-directory: rustc_tools_util
- name: Test clippy_dev
run: cargo test --features deny-warnings
run: cargo test
working-directory: clippy_dev
- name: Test clippy-driver

View File

@ -16,6 +16,7 @@ on:
env:
RUST_BACKTRACE: 1
CARGO_INCREMENTAL: 0
RUSTFLAGS: -D warnings
jobs:
clippy_dev:
@ -28,7 +29,7 @@ jobs:
# Run
- name: Build
run: cargo build --features deny-warnings
run: cargo build
working-directory: clippy_dev
- name: Test update_lints
@ -38,6 +39,8 @@ jobs:
run: cargo dev fmt --check
- name: Test cargo dev new lint
env:
RUSTFLAGS: -A unused-imports
run: |
cargo dev new_lint --name new_early_pass --pass early
cargo dev new_lint --name new_late_pass --pass late

View File

@ -51,7 +51,6 @@ tokio = { version = "1", features = ["io-util"] }
rustc_tools_util = "0.3.0"
[features]
deny-warnings = ["clippy_lints/deny-warnings"]
integration = ["tempfile"]
internal = ["clippy_lints/internal", "tempfile"]

View File

@ -14,9 +14,6 @@ toml = "0.7.3"
[dev-dependencies]
walkdir = "2.3"
[features]
deny-warnings = []
[package.metadata.rust-analyzer]
# This crate uses #[feature(rustc_private)]
rustc_private = true

View File

@ -1,5 +1,4 @@
#![feature(rustc_private, array_windows, let_chains)]
#![cfg_attr(feature = "deny-warnings", deny(warnings))]
#![warn(
trivial_casts,
trivial_numeric_casts,

View File

@ -13,9 +13,6 @@ opener = "0.6"
shell-escape = "0.1"
walkdir = "2.3"
[features]
deny-warnings = []
[package.metadata.rust-analyzer]
# This package uses #[feature(rustc_private)]
rustc_private = true

View File

@ -1,6 +1,5 @@
#![feature(let_chains)]
#![feature(rustc_private)]
#![cfg_attr(feature = "deny-warnings", deny(warnings))]
#![warn(
trivial_casts,
trivial_numeric_casts,

View File

@ -1,4 +1,3 @@
#![cfg_attr(feature = "deny-warnings", deny(warnings))]
// warn on lints, that are included in `rust-lang/rust`s bootstrap
#![warn(rust_2018_idioms, unused_lifetimes)]

View File

@ -32,7 +32,6 @@ url = "2.2"
walkdir = "2.3"
[features]
deny-warnings = ["clippy_config/deny-warnings", "clippy_utils/deny-warnings"]
# build clippy with internal lints enabled, off by default
internal = ["serde_json", "tempfile", "regex"]

View File

@ -14,7 +14,6 @@
#![feature(stmt_expr_attributes)]
#![feature(unwrap_infallible)]
#![recursion_limit = "512"]
#![cfg_attr(feature = "deny-warnings", deny(warnings))]
#![allow(
clippy::missing_docs_in_private_items,
clippy::must_use_candidate,

View File

@ -12,9 +12,6 @@ rustc-semver = "1.1"
# FIXME(f16_f128): remove when no longer needed for parsing
rustc_apfloat = "0.2.0"
[features]
deny-warnings = ["clippy_config/deny-warnings"]
[package.metadata.rust-analyzer]
# This crate uses #[feature(rustc_private)]
rustc_private = true

View File

@ -10,7 +10,6 @@
#![feature(assert_matches)]
#![feature(unwrap_infallible)]
#![recursion_limit = "512"]
#![cfg_attr(feature = "deny-warnings", deny(warnings))]
#![allow(
clippy::missing_errors_doc,
clippy::missing_panics_doc,

View File

@ -11,6 +11,3 @@ proc-macro = true
itertools = "0.12"
quote = "1.0.21"
syn = "2.0"
[features]
deny-warnings = []

View File

@ -1,5 +1,4 @@
#![feature(let_chains)]
#![cfg_attr(feature = "deny-warnings", deny(warnings))]
// warn on lints, that are included in `rust-lang/rust`s bootstrap
#![warn(rust_2018_idioms, unused_lifetimes)]

View File

@ -25,6 +25,3 @@ tar = "0.4"
toml = "0.7.3"
ureq = { version = "2.2", features = ["json"] }
walkdir = "2.3"
[features]
deny-warnings = []

View File

@ -10,6 +10,3 @@ categories = ["development-tools"]
edition = "2018"
[dependencies]
[features]
deny-warnings = []

View File

@ -1,5 +1,3 @@
#![cfg_attr(feature = "deny-warnings", deny(warnings))]
use std::str;
/// This macro creates the version string during compilation from the

View File

@ -2,7 +2,6 @@
#![allow(rustc::untranslatable_diagnostic)]
#![feature(rustc_private)]
#![feature(let_chains)]
#![cfg_attr(feature = "deny-warnings", deny(warnings))]
// warn on lints, that are included in `rust-lang/rust`s bootstrap
#![warn(rust_2018_idioms, unused_lifetimes)]
// warn on rustc internal lints

View File

@ -1,4 +1,3 @@
#![cfg_attr(feature = "deny-warnings", deny(warnings))]
// warn on lints, that are included in `rust-lang/rust`s bootstrap
#![warn(rust_2018_idioms, unused_lifetimes)]

View File

@ -1,4 +1,3 @@
#![cfg_attr(feature = "deny-warnings", deny(warnings))]
#![warn(rust_2018_idioms, unused_lifetimes)]
use std::path::PathBuf;

View File

@ -1,5 +1,4 @@
#![feature(is_sorted)]
#![cfg_attr(feature = "deny-warnings", deny(warnings))]
#![warn(rust_2018_idioms, unused_lifetimes)]
#![allow(unused_extern_crates)]

View File

@ -3,7 +3,6 @@
//!
//! See [Eating your own dog food](https://en.wikipedia.org/wiki/Eating_your_own_dog_food) for context
#![cfg_attr(feature = "deny-warnings", deny(warnings))]
#![warn(rust_2018_idioms, unused_lifetimes)]
use itertools::Itertools;

View File

@ -8,7 +8,6 @@
//! Clippy doesn't produce an ICE. Lint warnings are ignored by this test.
#![cfg(feature = "integration")]
#![cfg_attr(feature = "deny-warnings", deny(warnings))]
#![warn(rust_2018_idioms, unused_lifetimes)]
use std::env;

View File

@ -1,4 +1,3 @@
#![cfg_attr(feature = "deny-warnings", deny(warnings))]
#![warn(rust_2018_idioms, unused_lifetimes)]
use std::ffi::OsStr;

View File

@ -1,4 +1,3 @@
#![cfg_attr(feature = "deny-warnings", deny(warnings))]
#![warn(rust_2018_idioms, unused_lifetimes)]
#![allow(clippy::assertions_on_constants)]
#![feature(path_file_prefix)]

View File

@ -1,4 +1,3 @@
#![cfg_attr(feature = "deny-warnings", deny(warnings))]
#![warn(rust_2018_idioms, unused_lifetimes)]
#![allow(clippy::single_match_else)]

View File

@ -1,3 +1,6 @@
[package]
name = "path_dep"
version = "0.1.0"
[features]
primary_package_test = []