-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbefore-commit.sh
More file actions
41 lines (30 loc) · 938 Bytes
/
before-commit.sh
File metadata and controls
41 lines (30 loc) · 938 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
# Static code analysis for Python project
echo "Starting Static Code Analysis..."
# Bandit: discovers potential security issues
echo "Running Bandit..."
bandit -r .
# Black: checks Python code formatting
echo "Running Black..."
black --check .
# Flake8: checks for style guide enforcement
echo "Running Flake8..."
flake8 .
# iSort: checks Python import formatting
echo "Running iSort..."
isort . --check-only
# Mypy: checks for type annotation
echo "Running Mypy..."
mypy --config-file mypy.ini --install-types --non-interactive .
# Pycodestyle: checks Python code against PEP 8 style guide
echo "Running Pycodestyle..."
pycodestyle .
# Pylint: checks Python code for errors, tries to enforce a coding standard
echo "Running Pylint..."
pylint **/*.py
# Radon: checks Python code complexity
echo "Running Radon CC..."
radon cc **/*.py
echo "Running Radon MI..."
radon mi **/*.py
echo "Static Code Analysis Complete"