-
Notifications
You must be signed in to change notification settings - Fork 166
added pre-commit hooks #173
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
Changes from all commits
f430251
705a32d
fa6a729
bfd759b
6d180c4
e83db0b
deb6411
125e356
5ef74dc
22f83f2
5a83078
c194397
7e84413
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
repos: | ||
- repo: https://gitlab.com/pycqa/flake8 | ||
rev: 3.7.9 | ||
hooks: | ||
- id: flake8 | ||
|
||
- repo: https://github.com/pre-commit/mirrors-isort | ||
rev: v4.3.21 | ||
hooks: | ||
- id: isort | ||
|
||
|
||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v2.4.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
- id: check-yaml | ||
- id: check-added-large-files |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,14 @@ | ||
language: python | ||
matrix: | ||
include: | ||
- python: 3.4 | ||
- python: 3.5 | ||
- python: 3.6 | ||
- python: 3.7 | ||
dist: xenial | ||
sudo: true | ||
- python: pypy3 | ||
install: | ||
- pip install -e ".[test]" | ||
- make install | ||
script: | ||
- isort --recursive --diff validators tests && isort --recursive --check-only validators tests | ||
- flake8 validators tests | ||
- py.test --doctest-glob="*.rst" --doctest-modules --ignore=setup.py | ||
- make lint | ||
- make test |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
lint: | ||
isort --diff validators tests | ||
isort --check-only validators tests | ||
|
||
flake8 validators tests | ||
|
||
install: | ||
pip install -e ".[test]" | ||
|
||
test: | ||
py.test --doctest-glob="*.rst" --doctest-modules --ignore=setup.py |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[isort] | ||
known_first_party=sqlalchemy_utils,tests | ||
line_length=88 | ||
multi_line_output=3 | ||
order_by_type=false | ||
include_trailing_comma=True | ||
|
||
[flake8] | ||
ignore = D10,E203,E501,W503,E231,E265,W504,E122,E121 | ||
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. Is there a reason for adding all these ignores? 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. Some of these were already set, and there were already a lot of violation for flake8 so for the most common ones I added it to ignore. If I remove them then I would have to do a lot of editing to code which I am not too sure if you would like it. 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. @kvesteri could you please confirm if these ignores are ok? I can then submit my PR. Thanks |
||
max-line-length = 88 | ||
select = A,B,C4,D,E,F,M,Q,T,W,ABS,BLK | ||
inline-quotes = " | ||
docstring-convention = google | ||
exclude = | ||
.git, | ||
__pycache__, | ||
src/validators/libs |
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.
Why did you change this line length from 79 to 88? In general I'd prefer this PR kept everything the same as it was and just add the pre-commit hooks.
Uh oh!
There was an error while loading. Please reload this page.
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.
Sure, I will change it back, but 88 seems to be the default for black formatter and I thought that some time in the future we will introduce black as the formatter so I changed it. 88 seems to be the sweet spot. Anyways I will change it.