Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clippy in Regressions. #1403

Merged
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
96c5055
Added jq for json querying.
YoshikiTakashima Jul 22, 2022
0547a1d
Added clippy to regression.
YoshikiTakashima Jul 22, 2022
ba12b55
Added error ignore and todo to kani-compiler.
YoshikiTakashima Jul 22, 2022
e7b194d
Added clippy todo to cprover_bindings.
YoshikiTakashima Jul 22, 2022
a731fa5
Forced failure on warnings (Werror for clippy).
YoshikiTakashima Jul 22, 2022
05b7728
Added clippy todo to compiletest.
YoshikiTakashima Jul 23, 2022
476c88c
Clippy supression for bookrunner.
YoshikiTakashima Jul 23, 2022
0846e95
Resolved metadata warnings with publish = false.
YoshikiTakashima Jul 23, 2022
dfb712a
Clippy todo for kani library.
YoshikiTakashima Jul 23, 2022
5b0c159
Clippy todos and publish fix for kani_macros.
YoshikiTakashima Jul 23, 2022
7f6d50c
Cargo fmt.
YoshikiTakashima Jul 23, 2022
7db5b7d
Merge branch 'main' of github.com:model-checking/kani into yoshi-clip…
YoshikiTakashima Jul 23, 2022
1832866
Temporally turned off clippy fail.
YoshikiTakashima Jul 25, 2022
2bc5ead
Merge branch 'main' into yoshi-clippy-compliance
YoshikiTakashima Jul 25, 2022
df626cf
Moved clippy to format checks.
YoshikiTakashima Jul 25, 2022
0885ef8
Merge branch 'yoshi-clippy-compliance' of github.com:YoshikiTakashima…
YoshikiTakashima Jul 25, 2022
f89f24b
Moved clippy to the format check.
YoshikiTakashima Jul 25, 2022
9fd5572
Added missing dependency.
YoshikiTakashima Jul 25, 2022
5c0a918
Fixed yaml overwrite problem.
YoshikiTakashima Jul 25, 2022
37cd803
Gather stats on clippy warnings.
YoshikiTakashima Jul 25, 2022
7803971
jq install for osx not needed.
YoshikiTakashima Jul 25, 2022
f3d9252
Moved clippy control to a central config file.
YoshikiTakashima Jul 25, 2022
2985448
Fixed clippy warnings under library/
YoshikiTakashima Jul 25, 2022
27557a0
Adjusted actions to print stats by removing lint supression.
YoshikiTakashima Jul 25, 2022
a363270
Merge branch 'main' of github.com:model-checking/kani into yoshi-clip…
YoshikiTakashima Jul 25, 2022
6ed0866
Ignored 3 clippy warnings that regressed after merge.
YoshikiTakashima Jul 25, 2022
cf7a0ff
Forgot to remove manual -A
YoshikiTakashima Jul 25, 2022
19c39e4
Merge branch 'main' of github.com:model-checking/kani into yoshi-clip…
YoshikiTakashima Jul 25, 2022
88a98da
got rid of redundant allowed lints.
YoshikiTakashima Jul 26, 2022
b7e46ba
Merge branch 'main' into yoshi-clippy-compliance
YoshikiTakashima Jul 26, 2022
455c42f
Moved jq install to workflow side.
YoshikiTakashima Jul 26, 2022
806c3db
removed .cargo from gitignore
YoshikiTakashima Jul 26, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/workflows/format-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,20 @@ jobs:
run: |
pip3 install --upgrade autopep8
./scripts/run-autopep8.sh

clippy-check:
runs-on: ubuntu-20.04
steps:
- name: Checkout Kani
uses: actions/checkout@v2

- name: Setup Kani Dependencies
uses: ./.github/actions/setup
with:
os: ubuntu-20.04

- name: "Run Clippy"
run: |
cargo clippy --all -- -D warnings \
-A "clippy::expect_fun_call" \
-A "clippy::or_fun_call"
YoshikiTakashima marked this conversation as resolved.
Show resolved Hide resolved
1 change: 1 addition & 0 deletions cprover_bindings/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ name = "cprover_bindings"
version = "0.6.0"
edition = "2021"
license = "MIT OR Apache-2.0"
publish = false

[lib]
test = true
Expand Down
9 changes: 9 additions & 0 deletions cprover_bindings/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@
//! Speical [irep::Irep::id]s include:
//! 1. [irep::IrepId::Empty] and [irep::IrepId::Nil] behaves like \[null\].

// todo: Resolve the following clippy warnings.
#![allow(
clippy::needless_bool,
clippy::let_and_return,
clippy::manual_map,
clippy::module_inception,
clippy::new_without_default
)]

mod env;
pub mod goto_program;
pub mod irep;
Expand Down
1 change: 1 addition & 0 deletions kani-compiler/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ name = "kani-compiler"
version = "0.6.0"
edition = "2021"
license = "MIT OR Apache-2.0"
publish = false

[dependencies]
ar = { version = "0.9.0", optional = true }
Expand Down
1 change: 1 addition & 0 deletions kani-compiler/kani_queries/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ name = "kani_queries"
version = "0.6.0"
edition = "2021"
license = "MIT OR Apache-2.0"
publish = false

[dependencies]
tracing = {version = "0.1"}
Expand Down
20 changes: 20 additions & 0 deletions kani-compiler/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,26 @@
//! Like miri, clippy, and other tools developed on the top of rustc, we rely on the
//! rustc_private feature and a specific version of rustc.
#![deny(warnings)]
// todo: fix clippy warnings
#![allow(
clippy::expect_fun_call,
clippy::explicit_auto_deref,
clippy::if_same_then_else,
clippy::iter_nth_zero,
clippy::let_and_return,
clippy::manual_map,
clippy::map_entry,
clippy::match_like_matches_macro,
clippy::module_inception,
clippy::needless_arbitrary_self_type,
clippy::needless_bool,
clippy::needless_return,
clippy::new_ret_no_self,
clippy::new_without_default,
clippy::or_fun_call,
clippy::redundant_clone,
clippy::type_complexity
)]
#![feature(extern_types)]
#![recursion_limit = "256"]
#![feature(box_patterns)]
Expand Down
1 change: 1 addition & 0 deletions kani-driver/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ description = "Build a project with Kani and run all proof harnesses"
license = "MIT OR Apache-2.0"
homepage = "https://github.com/model-checking/kani"
repository = "https://github.com/model-checking/kani"
publish = false

[dependencies]
kani_metadata = { path = "../kani_metadata" }
Expand Down
3 changes: 3 additions & 0 deletions kani-driver/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
// Copyright Kani Contributors
// SPDX-License-Identifier: Apache-2.0 OR MIT

// todo: resolve clippy warning.
#![allow(clippy::unnecessary_lazy_evaluations)]

use anyhow::Result;
use args_toml::join_args;
use call_cbmc::VerificationStatus;
Expand Down
1 change: 1 addition & 0 deletions kani_metadata/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ name = "kani_metadata"
version = "0.6.0"
edition = "2021"
license = "MIT OR Apache-2.0"
publish = false

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
1 change: 1 addition & 0 deletions library/kani/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ name = "kani"
version = "0.6.0"
edition = "2021"
license = "MIT OR Apache-2.0"
publish = false

[dependencies]
kani_macros = { path = "../kani_macros" }
3 changes: 3 additions & 0 deletions library/kani/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
#![feature(rustc_attrs)] // Used for rustc_diagnostic_item.
#![feature(min_specialization)] // Used for default implementation of Arbitrary.

// todo: resolve clippy warnings.
#![allow(clippy::manual_range_contains, clippy::missing_safety_doc)]

pub mod arbitrary;
pub mod invariant;
pub mod slice;
Expand Down
1 change: 1 addition & 0 deletions library/kani_macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ name = "kani_macros"
version = "0.6.0"
edition = "2021"
license = "MIT OR Apache-2.0"
publish = false

[lib]
proc-macro = true
Expand Down
3 changes: 3 additions & 0 deletions library/kani_macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
// So we have to enable this on the commandline (see kani-rustc) with:
// RUSTFLAGS="-Zcrate-attr=feature(register_tool) -Zcrate-attr=register_tool(kanitool)"

// todo: resolve clippy warnings
#![allow(clippy::len_zero, clippy::redundant_clone)]

// proc_macro::quote is nightly-only, so we'll cobble things together instead
use proc_macro::TokenStream;

Expand Down
1 change: 1 addition & 0 deletions library/std/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ name = "std"
version = "0.6.0"
edition = "2021"
license = "MIT OR Apache-2.0"
publish = false

[dependencies]
kani = {path="../kani"}
2 changes: 1 addition & 1 deletion scripts/setup/macos-10.15/install_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ set -eux
#brew update

# Install dependencies via `brew`
brew install universal-ctags wget
brew install universal-ctags wget jq
YoshikiTakashima marked this conversation as resolved.
Show resolved Hide resolved

# Add Python package dependencies
PYTHON_DEPS=(
Expand Down
1 change: 1 addition & 0 deletions scripts/setup/ubuntu/install_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ DEPS=(
wget
zlib1g
zlib1g-dev
jq
YoshikiTakashima marked this conversation as resolved.
Show resolved Hide resolved
)

# Version specific dependencies.
Expand Down
1 change: 1 addition & 0 deletions tools/bookrunner/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ name = "bookrunner"
version = "0.1.0"
edition = "2018"
license = "MIT OR Apache-2.0"
publish = false

[dependencies]
Inflector = "0.11.4"
Expand Down
2 changes: 2 additions & 0 deletions tools/bookrunner/librustdoc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ name = "rustdoc"
version = "0.0.0"
edition = "2021"
license = "MIT OR Apache-2.0"
publish = false

# From upstream librustdoc:
# https://github.com/rust-lang/rust/tree/master/src/librustdoc
# Upstream crate does not list license but Rust statues:
Expand Down
7 changes: 6 additions & 1 deletion tools/bookrunner/librustdoc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@
#![feature(iter_intersperse)]
#![recursion_limit = "256"]
#![warn(rustc::internal)]
#![allow(clippy::collapsible_if, clippy::collapsible_else_if)]
#![allow(
clippy::collapsible_if,
clippy::collapsible_else_if,
clippy::derive_partial_eq_without_eq,
clippy::format_push_string
)]

#[macro_use]
extern crate tracing;
Expand Down
1 change: 1 addition & 0 deletions tools/bookrunner/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT
#![feature(extend_one)]
#![feature(rustc_private)]
#![allow(clippy::too_many_arguments, clippy::redundant_clone, clippy::len_zero)]

mod bookrunner;
mod books;
Expand Down
1 change: 1 addition & 0 deletions tools/compiletest/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ name = "compiletest"
version = "0.0.0"
edition = "2021"
license = "MIT OR Apache-2.0"
publish = false
# From upstream compiletest:
# https://github.com/rust-lang/rust/tree/master/src/tools/compiletest
# Upstream crate does not list license but Rust statues:
Expand Down
14 changes: 14 additions & 0 deletions tools/compiletest/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,20 @@
// Modifications Copyright Kani Contributors
// See GitHub history for details.

// todo: Resolve the following clippy warnings.
#![allow(
clippy::collapsible_else_if,
clippy::derive_partial_eq_without_eq,
clippy::into_iter_on_ref,
clippy::iter_skip_next,
clippy::manual_strip,
clippy::needless_borrow,
clippy::needless_range_loop,
clippy::new_without_default,
clippy::ptr_arg,
clippy::single_char_pattern,
clippy::vec_init_then_push
)]
#![crate_name = "compiletest"]
// The `test` crate is the only unstable feature
// allowed here, just to share similar code.
Expand Down
1 change: 1 addition & 0 deletions tools/make-kani-release/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ version = "0.1.0"
edition = "2021"
description = "Contructs a Kani release bundle"
license = "MIT OR Apache-2.0"
publish = false

[dependencies]
anyhow = "1"
Expand Down