Skip to content

Commit

Permalink
ci: add dead code detection
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonas1312 committed Oct 10, 2023
1 parent f2f1652 commit a64be1a
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: 3.8
cache: "pip"

- name: Install dependencies
run: |
Expand Down Expand Up @@ -131,6 +132,7 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: 3.8
cache: "pip"

- name: Install dependencies
run: |
Expand Down Expand Up @@ -161,12 +163,44 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: 3.8
cache: "pip"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"
- name: Log dead code
run: vulture src/kili tests

- name: Log dead code
run: dead

- name: Log dead code
run: |
{ vulture src/kili tests ; dead ; }
- name: Log dead code
run: |
{ vulture src/kili tests ; dead ; } > dead_code.log
- name: Log dead code
run: >-
{ vulture src/kili tests ; dead ; } |
grep -e "src/kili" |
grep -v
-e "is only referenced in tests"
-e "_ is never read"
-e "internal.py"
-e "unused attribute 'internal'"
-e "affected_rows"
-e "src/kili/orm"
-e "src/kili/types.py"
-e "src/kili/services"
-e "src/kili/entrypoints"
-e "src/kili/core/graphql/ws_graphql_client"
> dead_code.log
- name: Log dead code
run: >-
{ vulture src/kili tests ; dead ; } |
Expand All @@ -182,6 +216,7 @@ jobs:
-e "src/kili/services"
-e "src/kili/entrypoints"
-e "src/kili/core/graphql/ws_graphql_client"
> dead_code.log
- name: Crash if dead code found
run: |
Expand Down

0 comments on commit a64be1a

Please sign in to comment.