Skip to content

Commit f044506

Browse files
committed
Add isort autoformatting using pre-commit
1 parent d105f0b commit f044506

File tree

4 files changed

+23
-2
lines changed

4 files changed

+23
-2
lines changed

.flake8

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[flake8]
2+
# See https://flake8.pycqa.org/en/2.5.5/warnings.html
3+
select =
4+
E # pep8 errors
5+
W # pep8 warnings
6+
F # PyFlake codes
7+
ignore =
8+
W503 # line break before binary operator (makes Flake8 work like black)
9+
W504 # line break after binary operator
10+
E203 # whitespace before ‘:’ (makes Flake8 work like black)
11+
E741 # do not use variables named ‘l’, ‘O’, or ‘I’
12+
E501 # line too long (82 > 79 characters)

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
run: pip install pre-commit
3030

3131
- name: "Run pre-commit checks"
32-
run: pre-commit run --all-files
32+
run: pre-commit run --hook-stage manual --all-files
3333

3434
build:
3535
runs-on: ubuntu-latest

.pre-commit-config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,9 @@ repos:
1313
additional_dependencies:
1414
- "types-pytz"
1515
- "types-requests"
16+
17+
- repo: https://github.com/pycqa/isort
18+
rev: 5.6.4
19+
hooks:
20+
- id: isort
21+
args: [ "--profile", "black"]

setup.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@
3939
"pytest",
4040
"pytest-runner",
4141
"click",
42+
"pre-commit",
43+
"black",
44+
"isort",
4245
]
4346

4447
setup(
@@ -75,7 +78,7 @@
7578
"Programming Language :: Python :: Implementation :: PyPy",
7679
"Topic :: Database :: Front-Ends",
7780
],
78-
python_requires='>=3.7',
81+
python_requires=">=3.7",
7982
install_requires=["pytz", "requests"],
8083
extras_require={
8184
"all": all_require,

0 commit comments

Comments
 (0)