Skip to content

Commit e96e767

Browse files
authored
CI: dead code removal check (input-output-hk#1983)
This PR adds a CI job that runs the `nix run github:astro/deadnix -- --edit \ --no-lambda-pattern-names` [1] command to detect dead code. And then use reviewdog/action-suggester [2] for actionable code changes comments within GitHub UI. [1] input-output-hk#1756 [2] https://github.com/reviewdog/action-suggester
1 parent d723f2d commit e96e767

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

.github/workflows/lints.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: "Lints"
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
branches:
7+
- master
8+
9+
push:
10+
branches:
11+
- master
12+
13+
defaults:
14+
run:
15+
shell: bash
16+
17+
# do we really want nixos-unstable?
18+
env:
19+
NIX_PATH: "nixpkgs=channel:nixos-unstable"
20+
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21+
22+
jobs:
23+
deadnix:
24+
runs-on: [self-hosted, linux]
25+
steps:
26+
- uses: actions/checkout@v3
27+
- run: |
28+
nix run github:astro/deadnix -- --edit --no-lambda-pattern-names
29+
TMPFILE=$(mktemp)
30+
git diff >"${TMPFILE}"
31+
git stash -u && git stash drop
32+
nix-shell -p reviewdog --run "reviewdog -f=diff -f.diff.strip=1 -reporter=github-pr-review < \"${TMPFILE}\""

0 commit comments

Comments
 (0)