Skip to content

Commit a92196d

Browse files
peanutfunspjuhelmanniepmkamemanuel-schmid
authored
Add pre-commit to dependencies with appropriate config (#892)
* Add pre-commit to dependencies with appropriate config * Add isort to pre-commit configuration * loosens pre-commit python version requirement * Update documentation to present pre-commit hooks * Updates documentation to present formatting convention * Update installation instructions and guides for pre-commit * Language edit for the CLIMADA conventions guide. * Language edit for the CLIMADA conventions guide. * Apply suggestions from code review --------- Co-authored-by: spjuhel <[email protected]> Co-authored-by: Pui Man (Mannie) Kam <[email protected]> Co-authored-by: emanuel-schmid <[email protected]>
1 parent 487a51b commit a92196d

File tree

6 files changed

+368
-85
lines changed

6 files changed

+368
-85
lines changed

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,3 +176,10 @@ data/ISIMIP_crop/
176176

177177
# climada data results folder:
178178
results/
179+
180+
# Hidden files we want to track
181+
!.gitignore
182+
!.pre-commit-config.yaml
183+
!.pylintrc
184+
!.readthedocs.yml
185+
!.github

.pre-commit-config.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# See https://pre-commit.com for more information
2+
default_language_version:
3+
python: python3
4+
5+
# See https://pre-commit.com/hooks.html for more hooks
6+
repos:
7+
- repo: https://github.com/pre-commit/pre-commit-hooks
8+
rev: v3.2.0
9+
hooks:
10+
- id: end-of-file-fixer
11+
- id: trailing-whitespace
12+
13+
- repo: https://github.com/pycqa/isort
14+
rev: '5.13.2'
15+
hooks:
16+
- id: isort
17+
args: ["--profile", "black", "--filter-files"]
18+
19+
# Using this mirror lets us use mypyc-compiled black, which is about 2x faster
20+
- repo: https://github.com/psf/black-pre-commit-mirror
21+
rev: '24.4.2'
22+
hooks:
23+
- id: black-jupyter

0 commit comments

Comments
 (0)