Skip to content

Commit

Permalink
rust: introduce xclippy project alias
Browse files Browse the repository at this point in the history
Introduce 'cargo xclippy' alias for better control of enabling and
disabling clippy lints project-wide.
  • Loading branch information
bmwill committed Apr 5, 2022
1 parent 7c30c0a commit 260cbc2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
10 changes: 10 additions & 0 deletions .cargo/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[alias]
# Collection of project wide clippy lints. This is done via an alias because
# clippy doesn't currently allow for specifiying project-wide lints in a
# configuration file. This is a similar workaround to the ones presented here:
# <https://github.com/EmbarkStudios/rust-ecosystem/issues/59>
xclippy = [
"clippy", "--all-targets", "--",
"-Wclippy::all",
"-Wclippy::disallowed_methods",
]
6 changes: 2 additions & 4 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,9 @@ jobs:
toolchain: beta
components: clippy
override: true
# See '.cargo/config' for list of enabled/disappled clippy lints
- name: cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-targets -- -D clippy::all -D warnings -D clippy::disallowed_methods
run: cargo xclippy -D warnings
- name: cargo test
uses: actions-rs/cargo@v1
with:
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,9 @@ jobs:
- uses: bmwill/rust-cache@v1 # Fork of 'Swatinem/rust-cache' which allows caching additional paths
with:
path: ~/.cargo/registry/src/**/librocksdb-sys-*
# See '.cargo/config' for list of enabled/disappled clippy lints
- name: cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-targets -- -D clippy::all -D warnings -D clippy::disallowed_methods
run: cargo xclippy -D warnings

rustfmt:
needs: diff
Expand Down

0 comments on commit 260cbc2

Please sign in to comment.