Skip to content

Commit 055ba7e

Browse files
committed
CI: Add clippy and fmt lints
Run cargo clippy, and cargo fmt with import sorting.
1 parent fac684f commit 055ba7e

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

.github/workflows/lint.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Lint
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
pull_request:
7+
types: [opened, reopened, synchronize]
8+
branches: ["main"]
9+
10+
permissions: {}
11+
12+
# Make sure CI fails on all warnings, including Clippy lints
13+
env:
14+
CARGO_TERM_COLOR: always
15+
RUSTFLAGS: "-Dwarnings"
16+
17+
jobs:
18+
clippy_check:
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
24+
with:
25+
persist-credentials: false
26+
27+
- name: Run Clippy
28+
run: cargo clippy --all-targets
29+
30+
format_check:
31+
runs-on: ubuntu-latest
32+
33+
steps:
34+
- name: Checkout repository
35+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
36+
with:
37+
persist-credentials: false
38+
39+
- name: Run Rustfmt
40+
run: cargo fmt --check -- --config imports_granularity=Module,group_imports=StdExternalCrate

0 commit comments

Comments
 (0)