Skip to content

Commit

Permalink
Merge pull request CodeForPhilly#926 from CodeForPhilly/lebovits/add-…
Browse files Browse the repository at this point in the history
…radon

add radon to precommit hook
  • Loading branch information
nlebovits authored Oct 1, 2024
2 parents d0fe466 + 5d91a30 commit cda5782
Show file tree
Hide file tree
Showing 3 changed files with 155 additions and 138 deletions.
10 changes: 10 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@ repos:
language: system
files: ^data/src/Pipfile$

# Radon MI and Halstead checks
- id: radon-check
name: Radon Maintainability and Halstead Checks
entry: |
bash -c 'radon mi -s {} | grep -E " - [CDEF] \(" && echo "Radon MI grade below B detected!" && exit 1 || echo "All MI grades are B or above."
radon hal {} -s | awk "/effort/ { if (\$3 > 2000) print FILENAME \": High Halstead effort:\" \$3 }"'
language: system
files: \.py$
exclude: ^data/src/awkde/

- repo: https://github.com/jendrikseipp/vulture
rev: 'v2.3' # or any later Vulture version
hooks:
Expand Down
1 change: 1 addition & 0 deletions data/src/Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ pyarrow = "*"
tqdm = "*"
vulture = "*"
pylint = "*"
radon = "*"

[dev-packages]

Expand Down
Loading

0 comments on commit cda5782

Please sign in to comment.