Skip to content

Commit 25d0c72

Browse files
authored
Merge pull request #557 from djhoese/precommit-mypy
Add more pre-commit checks (mccabe, bandit, mypy, etc)
2 parents d8f45cd + a7e1f25 commit 25d0c72

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+770
-699
lines changed

.bandit

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[bandit]
2+
skips: B506
3+
exclude: pyresample/test,pyresample/version.py,versioneer.py

.bumpversion.cfg

Lines changed: 0 additions & 36 deletions
This file was deleted.

.github/ISSUE_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
```
77
#### Problem description
88

9-
[this should also explain **why** the current behaviour is a problem and why the
9+
[this should also explain **why** the current behaviour is a problem and why the
1010
expected output is a better solution.]
1111

1212
#### Expected Output

.github/workflows/ci.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,4 +101,3 @@ jobs:
101101
uses: AndreMiras/coveralls-python-action@develop
102102
with:
103103
parallel-finished: true
104-

.pre-commit-config.yaml

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,38 @@
11
exclude: '^$'
22
fail_fast: false
33
repos:
4-
- repo: https://github.com/pycqa/flake8
5-
rev: 6.1.0
6-
hooks:
7-
- id: flake8
8-
additional_dependencies: [flake8-docstrings, flake8-debugger, flake8-bugbear]
4+
- repo: https://github.com/astral-sh/ruff-pre-commit
5+
rev: 'v0.1.6'
6+
hooks:
7+
- id: ruff
8+
# once https://github.com/astral-sh/ruff/issues/2402 is fully resolved then we can get rid of flake8:
9+
- repo: https://github.com/pycqa/flake8
10+
rev: 6.1.0
11+
hooks:
12+
- id: flake8
13+
- repo: https://github.com/pre-commit/pre-commit-hooks
14+
rev: v4.5.0
15+
hooks:
16+
- id: trailing-whitespace
17+
- id: end-of-file-fixer
18+
- id: check-yaml
19+
args: [--unsafe]
20+
- repo: https://github.com/PyCQA/bandit
21+
rev: '1.7.5' # Update me!
22+
hooks:
23+
- id: bandit
24+
args: [--ini, .bandit]
25+
- repo: https://github.com/pre-commit/mirrors-mypy
26+
rev: 'v1.6.1' # Use the sha / tag you want to point at
27+
hooks:
28+
- id: mypy
29+
additional_dependencies:
30+
- types-docutils
31+
- types-pkg-resources
32+
- types-PyYAML
33+
- types-requests
34+
- type_extensions
35+
args: ["--python-version", "3.9", "--ignore-missing-imports"]
936
- repo: https://github.com/pycqa/isort
1037
rev: 5.12.0
1138
hooks:
@@ -14,4 +41,4 @@ repos:
1441
ci:
1542
# To trigger manually, comment on a pull request with "pre-commit.ci autofix"
1643
autofix_prs: false
17-
44+
skip: [bandit]

CITATION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
To find out how to reference pyresample, go to https://doi.org/10.5281/zenodo.3372769 and choose your favourite citation format on the bottom of the right hand side-bar.
1+
To find out how to reference pyresample, go to https://doi.org/10.5281/zenodo.3372769 and choose your favourite citation format on the bottom of the right hand side-bar.

MANIFEST.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ recursive-include docs/source *
33
include pyresample/test/test_files/*
44
include LICENSE.txt
55
include pyresample/ewa/_fornav_templates.*
6+
include pyresample/py.typed
67
include versioneer.py
78
include pyresample/version.py
89
include README.md
9-
recursive-include pyresample *.pyx
10+
recursive-include pyresample *.pyx

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Pyresample offers multiple resampling algorithms including:
2323
- Bilinear
2424

2525
For nearest neighbor and bilinear interpolation pyresample uses a kd-tree
26-
approach by using the fast KDTree implementation provided by the
26+
approach by using the fast KDTree implementation provided by the
2727
[pykdtree](https://github.com/storpipfugl/pykdtree) library.
2828
Pyresample works with numpy arrays and numpy masked arrays. Interfaces to
2929
XArray objects (including dask array support) are provided in separate
@@ -38,4 +38,3 @@ PyTroll group and related packages.
3838
Citation
3939
----------
4040
Hoese, D., Raspaud, M., Lahtinen, P., Roberts, W., Lavergne, et al. (2020). pytroll/pyresample: Version 1.16.0. Zenodo. [https://doi.org/10.5281/zenodo.3372769](https://doi.org/10.5281/zenodo.3372769)
41-

changelog_pre1.9.1.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1283,6 +1283,3 @@ Other
12831283
- No commit message. [StorPipfugl]
12841284
- Moved to Google Code under GPLv3 license. [StorPipfugl]
12851285
- moved to Google Code. [StorPipfugl]
1286-
1287-
1288-

docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ Pyresample's API has changed (new functions, modules, classes, etc) then the
1010
API documentation should be regenerated before running the above make
1111
command.
1212

13-
sphinx-apidoc -f -T -o source/api ../pyresample ../pyresample/test
13+
sphinx-apidoc -f -T -o source/api ../pyresample ../pyresample/test

0 commit comments

Comments
 (0)