Skip to content

Commit f8a8ea0

Browse files
committed
Add pre commit config and fix code style
1 parent 1cfed76 commit f8a8ea0

File tree

10 files changed

+210
-165
lines changed

10 files changed

+210
-165
lines changed

.pre-commit-config.yaml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.3.0
4+
hooks:
5+
- id: trailing-whitespace
6+
- id: end-of-file-fixer
7+
- id: check-json
8+
- id: check-yaml
9+
- id: check-toml
10+
- id: check-added-large-files
11+
- id: debug-statements
12+
- id: mixed-line-ending
13+
- repo: https://github.com/PyCQA/isort
14+
rev: 5.10.1
15+
hooks:
16+
- id: isort
17+
- repo: https://github.com/psf/black
18+
rev: 22.3.0
19+
hooks:
20+
- id: black
21+
- repo: https://github.com/keewis/blackdoc
22+
rev: v0.3.4
23+
hooks:
24+
- id: blackdoc
25+
exclude: generate_reductions.py
26+
additional_dependencies: [black==22.3.0]
27+
- repo: https://github.com/PyCQA/flake8
28+
rev: 4.0.1
29+
hooks:
30+
- id: flake8
31+
- repo: https://github.com/executablebooks/mdformat
32+
rev: 0.7.14
33+
hooks:
34+
- id: mdformat
35+
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
36+
rev: v2.3.0
37+
hooks:
38+
- id: pretty-format-yaml
39+
args: [--autofix]
40+
- id: pretty-format-toml
41+
args: [--autofix]

environment-ci.yml

+24-24
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
channels:
2-
- conda-forge
2+
- conda-forge
33
dependencies:
4-
- black = 22.3.0
5-
- dask
6-
- flake8
7-
- fsspec
8-
- isort
9-
- make
10-
- mdformat
11-
- mypy
12-
- netcdf4
13-
- nomkl
14-
- numpy >= 1.22.0
15-
- pip
16-
- pytest
17-
- pytest-cov
18-
- rasterio >= 1.3.0
19-
- rioxarray
20-
- shapely
21-
- types-setuptools
22-
- xarray >= 2022.3.0
23-
- xmlschema
24-
- zarr
25-
- pip:
26-
- mdformat-gfm
4+
- black = 22.3.0
5+
- dask
6+
- flake8
7+
- fsspec
8+
- isort
9+
- make
10+
- mdformat
11+
- mypy
12+
- netcdf4
13+
- nomkl
14+
- numpy >= 1.22.0
15+
- pip
16+
- pytest
17+
- pytest-cov
18+
- rasterio >= 1.3.0
19+
- rioxarray
20+
- shapely
21+
- types-setuptools
22+
- xarray >= 2022.3.0
23+
- xmlschema
24+
- zarr
25+
- pip:
26+
- mdformat-gfm

environment-dev.yml

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
channels:
2-
- conda-forge
2+
- conda-forge
33
dependencies:
4-
- adlfs
5-
- build
6-
- cfchecker
7-
- gcsfs
8-
- ipytree
9-
- matplotlib
10-
- mamba
11-
- notebook
12-
- sentinelsat
4+
- adlfs
5+
- build
6+
- cfchecker
7+
- gcsfs
8+
- ipytree
9+
- matplotlib
10+
- mamba
11+
- notebook
12+
- sentinelsat

pyproject.toml

+7-7
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,6 @@ requires = [
66
"setuptools_scm_git_archive",
77
]
88

9-
[tool.setuptools_scm]
10-
write_to = "xarray_sentinel/version.py"
11-
write_to_template = '''
12-
# don't change, don't track in version control
13-
__version__ = "{version}"
14-
'''
15-
169
[tool.coverage.run]
1710
branch = true
1811
omit = ["setup.py"]
@@ -22,3 +15,10 @@ profile = "black"
2215

2316
[tool.pytest.ini_options]
2417
addopts = "--doctest-glob='*.md'"
18+
19+
[tool.setuptools_scm]
20+
write_to = "xarray_sentinel/version.py"
21+
write_to_template = '''
22+
# don't change, don't track in version control
23+
__version__ = "{version}"
24+
'''

setup.cfg

+4
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ include_package_data = True
3636
xarray.backends =
3737
sentinel-1 = xarray_sentinel.xarray_backends:Sentinel1Backend
3838

39+
[flake8]
40+
max-line-length = 120
41+
extend-ignore = E203, W503
42+
3943
[mypy]
4044

4145
[mypy-cfchecker]

0 commit comments

Comments
 (0)