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 afb5ce9 commit dad3fbd
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -178,21 +178,19 @@ jobs:

- name: Filter dead code
run: |
cat dead_code.log
- name: Filter dead code
run: |
cat dead_code.log | grep -e "src/kili"
- name: Filter dead code
run: |
cat dead_code.log | grep -e "src/kili" | grep -v -e "src/kili/types.py" -e "is only referenced in tests"
- name: Filter dead code
run: |
cat dead_code.log | grep -e "src/kili" | grep -v -e "src/kili/types.py" -e "is only referenced in tests" -e "_ is never read" -e "src/kili/orm" -e "src/kili/entrypoints" -e "internal.py" -e "src/kili/services" -e "affected_rows" -e "src/kili/core/graphql/ws_graphql_client"
- name: Filter dead code
run: |
cat dead_code.log | grep -e "src/kili" | grep -v -e "src/kili/types.py" -e "is only referenced in tests" -e "_ is never read" -e "src/kili/orm" -e "src/kili/entrypoints" -e "internal.py" -e "src/kili/services" -e "affected_rows" -e "unused attribute 'internal'" -e "src/kili/core/graphql/ws_graphql_client" > dead_code_filtered.log
cat dead_code.log | \
grep -e "src/kili" | \
grep -v \
-e "src/kili/types.py" \
-e "is only referenced in tests" \
-e "_ is never read" \
-e "src/kili/orm" \
-e "src/kili/entrypoints" \
-e "internal.py" \
-e "src/kili/services" \
-e "affected_rows" \
-e "src/kili/core/graphql/ws_graphql_client" \
> dead_code_filtered.log
- name: Crash if dead code found
run: |
Expand Down

0 comments on commit dad3fbd

Please sign in to comment.