2121 - id : pytest-check
2222 name : pytest-check
2323 description : Run unit tests with pytest.
24- entry : python -m pytest --cov=./src --cov-report=html
24+ entry : bash -c "if python -m pytest --co -qq; then python -m pytest -- cov=./src --cov-report=html; fi"
2525 language : system
2626 pass_filenames : false
2727 always_run : true
@@ -33,6 +33,10 @@ repos:
3333 - id : no-commit-to-branch
3434 name : Don't commit to main or master branch
3535 description : Prevent the user from committing directly to the primary branch.
36+ - id : check-added-large-files
37+ name : Check for large files
38+ description : Prevent the user from committing very large files.
39+ args : ['--maxkb=500']
3640
3741 # verify that pyproject.toml is well formed
3842 - repo : https://github.com/abravalheri/validate-pyproject
@@ -53,21 +57,55 @@ repos:
5357 files : ^(src|tests)/
5458
5559
56- # Analyze the code style and report code that doesn't adhere.
60+ # Analyze the src code style and report code that doesn't adhere.
5761 - repo : local
5862 hooks :
5963 - id : pylint
60- name : pylint (python files in src/ and tests/ )
64+ name : pylint (python files in src/)
6165 entry : pylint
6266 language : system
6367 types : [python]
64- files : ^(src|tests)/
68+ files : ^src/
69+ args :
70+ [
71+ " -rn" , # Only display messages
72+ " -sn" , # Don't display the score
73+ " --rcfile=src/.pylintrc" ,
74+ ]
75+ # Analyze the tests code style and report code that doesn't adhere.
76+ - repo : local
77+ hooks :
78+ - id : pylint
79+ name : pylint (python files in tests/)
80+ entry : pylint
81+ language : system
82+ types : [python]
83+ files : ^tests/
6584 args :
6685 [
6786 " -rn" , # Only display messages
6887 " -sn" , # Don't display the score
88+ " --rcfile=tests/.pylintrc" ,
89+ ]
90+
91+
92+ # Analyze type hints and report errors.
93+ - repo : local
94+ hooks :
95+ - id : mypy
96+ name : mypy (python files in src/ and tests/)
97+ entry : mypy
98+ language : system
99+ types : [python]
100+ files : ^(src|tests)/
101+ args :
102+ [
103+
104+ " --ignore-missing-imports" , # Ignore imports without type hints
105+
69106 ]
70107
108+ # Make sure Sphinx can build the documentation without issues.
71109 - repo : local
72110 hooks :
73111 - id : sphinx-build
0 commit comments