Skip to content

Commit c02c3de

Browse files
committed
Add pre-commit config
1 parent 13cea53 commit c02c3de

File tree

4 files changed

+36
-1
lines changed

4 files changed

+36
-1
lines changed

.pre-commit-config.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
repos:
2+
- repo: https://github.com/asottile/pyupgrade
3+
rev: v2.10.0
4+
hooks:
5+
- id: pyupgrade
6+
args: [--py38-plus]
7+
exclude: &fixtures ^tests/fixtures/.+\.py$
8+
- repo: https://gitlab.com/pycqa/flake8
9+
rev: 3.8.4
10+
hooks:
11+
- id: flake8
12+
files: ^(python_typing_update|script|tests)/.+\.py$
13+
exclude: *fixtures
14+
- repo: https://github.com/PyCQA/isort
15+
rev: 5.7.0
16+
hooks:
17+
- id: isort
18+
exclude: *fixtures
19+
- repo: https://github.com/pre-commit/pre-commit-hooks
20+
rev: v3.4.0
21+
hooks:
22+
- id: trailing-whitespace
23+
exclude: .+\.md
24+
- id: end-of-file-fixer

.vscode/settings.default.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
"editor.insertSpaces": true,
44
"files.trimFinalNewlines": true,
55
"files.insertFinalNewline": true,
6+
"python.linting.enabled": true,
7+
"python.linting.flake8Enabled": true,
8+
"python.linting.pylintEnabled": true,
9+
"python.linting.mypyEnabled": true,
10+
"python.testing.pytestArgs": [],
11+
"python.testing.unittestEnabled": false,
12+
"python.testing.nosetestsEnabled": false,
13+
"python.testing.pytestEnabled": true,
614
"[markdown]": {
715
"files.trimTrailingWhitespace": false
816
},

requirements_test.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
-r requirements_test_pre_commit.txt
12
aiofiles==0.6.0
2-
flake8==3.8.4
33
mypy==0.812
44
pre-commit==2.11.1
55
pylint==2.7.2

requirements_test_pre_commit.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
flake8==3.8.4
2+
isort==5.7.0
3+
pyupgrade==2.10.0

0 commit comments

Comments
 (0)