Skip to content

Commit

Permalink
chore(ci): remove clippy.sh
Browse files Browse the repository at this point in the history
- Only one source of truth for lints, main Cargo.toml, making clippy.sh
  unnecessary.
- Warnings no longer denied, only in the CI. To preserve existing
  behaviors users can add `-Dwarnings` to local RUSTFLAGS.

We still need to enforce in workspace tests that all crates inherit
workspace lints.
  • Loading branch information
Gilad Chase committed Nov 10, 2024
1 parent f82884d commit 337de5c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 15 deletions.
9 changes: 4 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -251,13 +251,12 @@ void = "1.0.2"
zstd = "0.13.1"

[workspace.lints.rust]
future-incompatible = "deny"
nonstandard-style = "deny"
rust-2018-idioms = "deny"
future-incompatible = "warn"
nonstandard-style = "warn"
rust-2018-idioms = "warn"
# See [here](https://github.com/taiki-e/cargo-llvm-cov/issues/370) for a discussion on why this is
# needed (from rust 1.80).
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(coverage_nightly)'] }
warnings = "deny"

[workspace.lints.clippy]
as_conversions = "deny"
as_conversions = "warn"
8 changes: 0 additions & 8 deletions scripts/clippy.sh

This file was deleted.

4 changes: 2 additions & 2 deletions scripts/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class BaseCommand(Enum):
DOC = "doc"

def cmd(self, crates: Set[str]) -> List[str]:
package_args = []
package_args = ["-Dwarnings"] # Don't remove `-Dwarnings`, otherwise warnings will merge.
for package in crates:
package_args.extend(["--package", package])

Expand All @@ -44,7 +44,7 @@ def cmd(self, crates: Set[str]) -> List[str]:
return ["scripts/rust_fmt.sh"] + fmt_args + ["--", "--check"]
elif self == BaseCommand.CLIPPY:
clippy_args = package_args if len(package_args) > 0 else ["--workspace"]
return ["scripts/clippy.sh"] + clippy_args
return ["cargo", "clippy"] + clippy_args
elif self == BaseCommand.DOC:
doc_args = package_args if len(package_args) > 0 else ["--workspace"]
return ["cargo", "doc", "-r", "--document-private-items", "--no-deps"] + doc_args
Expand Down

0 comments on commit 337de5c

Please sign in to comment.