11
22default_language_version :
33 python : python3
4- exclude : docs/(conf.py|_ext/)
4+ exclude : ^ docs/(conf.py|_ext/)
55default_stages : [commit,push]
66fail_fast : false
77
88ci :
99 skip : [pylint]
10+ autoupdate_branch : develop
11+ autoupdate_schedule : monthly
1012
1113repos :
12- - repo : https://github.com/psf/black
13- rev : 23.3 .0
14+ - repo : https://github.com/python-poetry/poetry
15+ rev : 1.8 .0
1416 hooks :
15- - id : black
17+ - id : poetry-check
18+ args : [--lock]
19+ - repo : https://github.com/hadialqattan/pycln
20+ rev : v2.4.0
21+ hooks :
22+ - id : pycln
23+ args : [--config=pyproject.toml]
1624- repo : https://github.com/PyCQA/isort
17- rev : 5.12.0
25+ rev : 5.13.2
1826 hooks :
1927 - id : isort
2028 additional_dependencies : [tomli] # to read config from pyproject.toml
21- - repo : https://github.com/humitos/mirrors-autoflake
22- rev : v1.1
29+ - repo : https://github.com/psf/black
30+ rev : 24.4.2
2331 hooks :
24- - id : autoflake
32+ - id : black
2533- repo : https://github.com/PyCQA/flake8
26- rev : 6 .0.0
34+ rev : 7 .0.0
2735 hooks :
2836 - id : flake8
29- files : ^omf/fileio/geoh5*
37+ files : ^( omf/fileio/geoh5|tests/)
3038- repo : https://github.com/asottile/pyupgrade
31- rev : v3.4.0
39+ rev : v3.15.2
3240 hooks :
3341 - id : pyupgrade
34- args : [--py38 -plus]
42+ args : [--py39 -plus]
3543- repo : https://github.com/pre-commit/mirrors-mypy
36- rev : v1.3 .0
44+ rev : v1.10 .0
3745 hooks :
3846 - id : mypy
39- additional_dependencies : [types-six]
40- args : [--ignore-missing-imports, --scripts-are-modules, --show-error-context,
41- --show-column-numbers]
42- files : ^omf/fileio/geoh5*
47+ files : ^(omf/fileio/geoh5|tests/)
48+ additional_dependencies : [
49+ # numpy==1.26.*, # TODO: fix mypy errors related to numpy
50+ tomli, # to read config from pyproject.toml
51+ types-six,
52+ types-toml,
53+ ]
54+ exclude : ^docs/
55+ - repo : https://github.com/codingjoe/relint
56+ rev : 3.1.1
57+ hooks :
58+ - id : relint
59+ args : [-W] # to fail on warnings
60+ files : ^omf/fileio/geoh5/
4361- repo : local
4462 hooks :
4563 - id : pylint
4664 name : pylint
4765 entry : poetry run pylint
4866 language : system
4967 require_serial : true # pylint does its own parallelism
50- types : [text]
51- types_or : [python, pyi]
52- exclude : (devtools|docs)/
68+ types : [python]
5369 files : ^(omf/fileio/geoh5|tests/)
70+ # - id: check-copyright # TODO: add missing copyright statements in source files
71+ # name: Check copyright
72+ # entry: python devtools/check-copyright.py
73+ # language: python
74+ # types: [text]
75+ # exclude: (^\.|^docs/)
76+ # files: ^(LICENSE|README(-dev)?.rst|((devtools|omf/fileio/geoh5|tests)/.*\.pyi?))$
77+ - id : prepare-commit-msg
78+ stages : [prepare-commit-msg]
79+ name : Prepare commit message
80+ entry : python devtools/git_message_hook.py --prepare
81+ language : python
82+ - id : check-commit-msg
83+ stages : [commit-msg]
84+ name : Check commit message
85+ entry : python devtools/git_message_hook.py --check
86+ language : python
5487- repo : https://github.com/codespell-project/codespell
55- rev : v2.2.4
88+ rev : v2.2.6
5689 hooks :
5790 - id : codespell
58- exclude : (\.ipynb$|^poetry.lock$)
91+ exclude : (\.lock|\. ipynb|^THIRD_PARTY_SOFTWARE\.rst)$
5992 entry : codespell -I .codespellignore
6093- repo : https://github.com/pre-commit/pre-commit-hooks
61- rev : v4.4 .0
94+ rev : v4.6 .0
6295 hooks :
6396 - id : trailing-whitespace
6497 exclude : \.mdj$
98+ - id : check-json
99+ exclude_types : [jupyter]
65100 - id : check-toml
66101 - id : check-yaml
67102# - id: check-added-large-files # crashing on some configuration. To be investigated
@@ -70,13 +105,24 @@ repos:
70105 - id : debug-statements
71106 - id : detect-private-key
72107 - id : end-of-file-fixer
73- exclude : \. mdj$
108+ exclude : (^\.idea/.*\.xml|\. mdj) $
74109 - id : mixed-line-ending
110+ exclude : ^\.idea/.*\.xml$
75111 - id : name-tests-test
112+ - id : pretty-format-json
113+ args :
114+ - --autofix
115+ - --indent=4
116+ - --no-sort-keys
117+ - --top-keys
118+ - version,title,icon,documentation,conda_environment,run_command,geoh5,monitoring_directory,workspace_geoh5
119+ exclude_types : [jupyter]
120+ exclude : ^docs/(.*/)?images/
76121- repo : https://github.com/rstcheck/rstcheck
77- rev : v6.1.2
122+ rev : v6.2.0
78123 hooks :
79124 - id : rstcheck
125+ exclude : ^THIRD_PARTY_SOFTWARE.rst$
80126 additional_dependencies : [sphinx]
81127- repo : https://github.com/pre-commit/pygrep-hooks
82128 rev : v1.10.0
0 commit comments