Skip to content

Commit

Permalink
STYLE: use types_or in pre-commit (#38457)
Browse files Browse the repository at this point in the history
  • Loading branch information
rkc007 committed Dec 16, 2020
1 parent dc4eaf3 commit af45b0a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
13 changes: 6 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
minimum_pre_commit_version: '2.9.2'
repos:
- repo: https://github.com/python/black
rev: 20.8b1
Expand All @@ -21,10 +22,8 @@ repos:
rev: 5.6.4
hooks:
- id: isort
name: isort (python)
- id: isort
name: isort (cython)
types: [cython]
types: [text] # overwrite upstream `types: [python]`
types_or: [python, cython]
- repo: https://github.com/asottile/pyupgrade
rev: v2.7.4
hooks:
Expand Down Expand Up @@ -96,17 +95,17 @@ repos:
name: Check for incorrect code block or IPython directives
language: pygrep
entry: (\.\. code-block ::|\.\. ipython ::)
files: \.(py|pyx|rst)$
types_or: [python, cython, rst]
- id: unwanted-patterns-strings-to-concatenate
name: Check for use of not concatenated strings
language: python
entry: python scripts/validate_unwanted_patterns.py --validation-type="strings_to_concatenate"
files: \.(py|pyx|pxd|pxi)$
types_or: [python, cython]
- id: unwanted-patterns-strings-with-wrong-placed-whitespace
name: Check for strings with wrong placed spaces
language: python
entry: python scripts/validate_unwanted_patterns.py --validation-type="strings_with_wrong_placed_whitespace"
files: \.(py|pyx|pxd|pxi)$
types_or: [python, cython]
- id: unwanted-patterns-private-import-across-module
name: Check for import of private attributes across modules
language: python
Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ dependencies:
- flake8-comprehensions>=3.1.0 # used by flake8, linting of unnecessary comprehensions
- isort>=5.2.1 # check that imports are in the right order
- mypy=0.782
- pre-commit
- pre-commit>=2.9.2
- pycodestyle # used by flake8
- pyupgrade

Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ flake8
flake8-comprehensions>=3.1.0
isort>=5.2.1
mypy==0.782
pre-commit
pre-commit>=2.9.2
pycodestyle
pyupgrade
gitpython
Expand Down

0 comments on commit af45b0a

Please sign in to comment.