Skip to content

Commit

Permalink
Add isort autoformatting using pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mdesmet committed Oct 27, 2022
1 parent d105f0b commit f044506
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
12 changes: 12 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[flake8]
# See https://flake8.pycqa.org/en/2.5.5/warnings.html
select =
E # pep8 errors
W # pep8 warnings
F # PyFlake codes
ignore =
W503 # line break before binary operator (makes Flake8 work like black)
W504 # line break after binary operator
E203 # whitespace before ‘:’ (makes Flake8 work like black)
E741 # do not use variables named ‘l’, ‘O’, or ‘I’
E501 # line too long (82 > 79 characters)
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
run: pip install pre-commit

- name: "Run pre-commit checks"
run: pre-commit run --all-files
run: pre-commit run --hook-stage manual --all-files

build:
runs-on: ubuntu-latest
Expand Down
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,9 @@ repos:
additional_dependencies:
- "types-pytz"
- "types-requests"

- repo: https://github.com/pycqa/isort
rev: 5.6.4
hooks:
- id: isort
args: [ "--profile", "black"]
5 changes: 4 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
"pytest",
"pytest-runner",
"click",
"pre-commit",
"black",
"isort",
]

setup(
Expand Down Expand Up @@ -75,7 +78,7 @@
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Database :: Front-Ends",
],
python_requires='>=3.7',
python_requires=">=3.7",
install_requires=["pytz", "requests"],
extras_require={
"all": all_require,
Expand Down

0 comments on commit f044506

Please sign in to comment.