-
Notifications
You must be signed in to change notification settings - Fork 1
54 lines (48 loc) · 1.33 KB
/
lint.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Linter
on: push
jobs:
rust-clippy:
name: Run clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run clippy
# Add back --all-targets when `error[E0463]: can't find crate for `test`` is fixed
run: cargo clippy --all-features -- -D warnings
rust-fmt:
name: Run rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run rustfmt
run: cargo fmt --all -- --check
typos:
name: Spell check with typos
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run typos
uses: crate-ci/typos@master
find-todos-fixme:
name: Find todos and fixmes
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run todo check
run: |
if grep -riE -n 'TODO|FIXME' * | grep -v -i 'TODOLater'; then
exit 1
else
echo "All good"
fi
check-no-crlf:
name: Check no crlf line endings
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run check for CRLF line endings
run: |
if git ls-files --eol | grep crlf; then
echo "[ERROR] found CRLF line endings, install dos2unix and run 'find . -type f -exec dos2unix {} \;' to fix"
exit 1
fi