Skip to content

Commit

Permalink
Move clippy overrides from the github actions code into the source
Browse files Browse the repository at this point in the history
This creates a predictable experience for developers running "cargo
clippy" locally.

Note that "uninlined_format_args" was allowed due to a clippy bug
which has since been fixed, so that exception is no longer needed.
  • Loading branch information
dburgener committed Aug 26, 2024
1 parent dbda21f commit aa7b254
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 3 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/clippy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ set -e -u -o pipefail

VERSION=${1:-stable}

rustup run ${VERSION} cargo clippy -- -A clippy::new_without_default -A clippy::manual_flatten --deny warnings
rustup run ${VERSION} cargo clippy -- --deny warnings

# Suppress uninlined_format_args since assert! has a format! macro in it, which confuses clippy.
rustup run ${VERSION} cargo clippy --tests -- -A clippy::new_without_default -A clippy::expect_fun_call -A clippy::uninlined_format_args -A clippy::manual_flatten
rustup run ${VERSION} cargo clippy --tests
2 changes: 2 additions & 0 deletions src/bin/audit2cascade.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// Copyright (c) Microsoft Corporation.
// SPDX-License-Identifier: MIT
#![allow(clippy::manual_flatten)]
#![allow(clippy::new_without_default)]
fn main() {
println!("Hello World!");
}
2 changes: 2 additions & 0 deletions src/bin/casc/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// Copyright (c) Microsoft Corporation.
// SPDX-License-Identifier: MIT
#![allow(clippy::manual_flatten)]
#![allow(clippy::new_without_default)]
use selinux_cascade::error::{CascadeErrors, ErrorItem};
use selinux_cascade::{compile_combined, compile_machine_policies, compile_machine_policies_all};

Expand Down
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// Copyright (c) Microsoft Corporation.
// SPDX-License-Identifier: MIT
#![allow(clippy::manual_flatten)]
#![allow(clippy::new_without_default)]
#[macro_use]
extern crate lalrpop_util;

Expand Down
1 change: 1 addition & 0 deletions src/test.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(clippy::expect_fun_call)]
lalrpop_mod!(#[allow(clippy::all)] pub parser);

use crate::error::{CompileError, Diag, ParseError};
Expand Down

0 comments on commit aa7b254

Please sign in to comment.