New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds black and pre-commit hooks #239
Changes from 31 commits
03bf430
910c075
9607f3e
bd3d472
d9a6fa5
b3f7013
565eb19
ca821b6
c6b42e7
22adbe7
107afa5
9141a5d
ba8cba8
7a4bab4
7f27ade
33cafd1
13d2d42
c74b2f5
35afd99
096ea90
59abbe3
05938c8
a69a5c9
6695108
ddbd76e
f5b3fc6
644e14d
6786f7a
e6b91cf
0f5bf78
8e47e24
b0f5f8d
a6f0436
04723c5
70f957d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,3 +25,6 @@ indent_size = 2 | |
|
||
[*.{md,Rmd}] | ||
trim_trailing_whitespace = false | ||
|
||
[Makefile] | ||
indent_style = tab |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v3.4.0 | ||
hooks: | ||
- id: check-added-large-files | ||
- id: check-ast | ||
- id: check-case-conflict | ||
- id: check-merge-conflict | ||
- id: debug-statements | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
args: [--markdown-linebreak-ext=md] | ||
- repo: https://github.com/adrienverge/yamllint | ||
rev: "v1.26.0" | ||
hooks: | ||
- id: yamllint | ||
- repo: https://github.com/asottile/setup-cfg-fmt | ||
rev: v1.17.0 | ||
hooks: | ||
- id: setup-cfg-fmt | ||
- repo: https://github.com/psf/black | ||
rev: 21.7b0 | ||
hooks: | ||
- id: black | ||
- repo: https://github.com/PyCQA/isort | ||
rev: "5.9.3" | ||
hooks: | ||
- id: isort | ||
# TODO renable when erros are fixed/ignored | ||
# - repo: https://github.com/pycqa/pylint | ||
# rev: "v2.9.6" | ||
# hooks: | ||
# - id: pylint | ||
# TODO renable when erros are fixed/ignored | ||
- repo: https://gitlab.com/pycqa/flake8 | ||
rev: "3.9.2" | ||
hooks: | ||
- id: flake8 | ||
additional_dependencies: | ||
&fd [ | ||
flake8-annotations-complexity, | ||
flake8-bandit, | ||
flake8-blind-except, | ||
flake8-bugbear, | ||
flake8-builtins, | ||
flake8-cognitive-complexity, | ||
flake8-comprehensions, | ||
flake8-docstrings, | ||
flake8-eradicate, | ||
flake8-executable, | ||
flake8-expression-complexity, | ||
flake8-if-expr, | ||
flake8-implicit-str-concat, | ||
flake8-logging-format, | ||
flake8-pathlib, | ||
flake8-print, | ||
flake8-pytest, | ||
flake8-pytest-style, | ||
# flake8-quotes, # conflicts with blacks double quote preference | ||
flake8-raise, | ||
flake8-return, | ||
flake8-typing-imports, | ||
flake8-variables-names, | ||
flake8==3.9.2, | ||
pandas-vet, | ||
pep8-naming, | ||
# wemake-python-styleguide, # conflicts with black | ||
yesqa, | ||
] | ||
verbose: true | ||
args: &fa [--statistics, --exit-zero] | ||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: v0.910 | ||
hooks: | ||
- id: mypy | ||
additional_dependencies: [types-python-dateutil] | ||
- repo: https://github.com/nbQA-dev/nbQA | ||
rev: 1.1.0 | ||
hooks: | ||
- id: nbqa-black | ||
# Match version of black used for .py and .pynb | ||
sverhoeven marked this conversation as resolved.
Show resolved
Hide resolved
|
||
additional_dependencies: [black==21.7b0] | ||
- id: nbqa-isort | ||
additional_dependencies: [isort==5.9.3] | ||
- id: nbqa-mypy | ||
additional_dependencies: [mypy==0.910] | ||
# TODO renable when erros are fixed/ignored | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. old? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nope, https://pypi.org/project/isort/5.9.3/ and https://pypi.org/project/mypy/0.910/ are latest versions on PyPI Versions are there to make sure the .py and .ipynb are using same versions of linters/formatters. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I meant the #TODO which was above a block that was not disabled, but I guess we'll get to it once we addressed the remaining issues. |
||
- id: nbqa-flake8 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could it be that the notebooks (in docs) are not picked up by these checks? This check passes on There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the issue is
, I'm not sure what it's meant to do here, but if you remove it then There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The The There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I didn't know you could do that, thanks! This'll be useful in other projects |
||
additional_dependencies: *fd | ||
args: *fa | ||
# TODO renable when erros are fixed/ignored | ||
# - id: nbqa-pylint | ||
# additional_dependencies: [pylint==2.9.6] | ||
- repo: https://github.com/regebro/pyroma | ||
rev: "3.2" | ||
hooks: | ||
- id: pyroma |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
old?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same isort,mypi or do you mean something else then version?