Skip to content

Commit

Permalink
Merge pull request #8 from mulkieran/clippy
Browse files Browse the repository at this point in the history
Add clippy Makefile target
  • Loading branch information
mulkieran authored Dec 21, 2023
2 parents 4514832 + f92ad0f commit d93be9a
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,4 @@ jobs:
args: --all -- --check

- name: Run cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings
run: make -f Makefile clippy
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ license = "MIT"
documentation = "https://docs.rs/loopdev-3"
repository = "https://github.com/stratis-storage/loopdev-3"
readme = "README.md"
categories = ["os::linux-apis", "api-bindings"]
keywords = ["loop"]
edition = "2021"
exclude = ["/.github", ".gitignore"]
exclude = ["/.github", ".gitignore", "Makefile"]

[lib]
name = "loopdev"
Expand Down
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
ifeq ($(origin CLIPPY_FIX), undefined)
CLIPPY_OPTS = --all-targets --no-deps
else
CLIPPY_OPTS = --fix
endif

DENY = -D warnings -D future-incompatible -D unused -D rust_2018_idioms -D nonstandard_style

CLIPPY_DENY = -D clippy::all -D clippy::cargo -A clippy::multiple-crate-versions

clippy:
RUSTFLAGS="${DENY}" cargo clippy ${CLIPPY_OPTS} -- ${CLIPPY_DENY}
2 changes: 0 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
extern crate bindgen;

use bindgen::Builder;
use std::{env::var, path::PathBuf};

Expand Down

0 comments on commit d93be9a

Please sign in to comment.