Skip to content

Commit

Permalink
add unused imports check
Browse files Browse the repository at this point in the history
  • Loading branch information
0xNineteen committed Jun 5, 2024
1 parent 3e7faea commit 2477118
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: check

on:
push:
branches: [main, pre-release]
branches: [main, pre-release, 19/cicd-gossip]
pull_request_review:
types: [submitted]
pull_request:
Expand All @@ -23,7 +23,18 @@ jobs:
- name: lint
run: |
zig fmt --check src/
zig fmt --check build.zig
unused_imports:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10" zig fmt --check build.zig

- name: remove unused imports
run: python remove_unused.py src/

test:
strategy:
Expand Down
4 changes: 3 additions & 1 deletion remove_unused.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,6 @@

print("total iterations: ", n_remove_iter)
print("total lines removed: ", total_removes)


if (total_removes > 0):
exit(1)

0 comments on commit 2477118

Please sign in to comment.