8000 Setup black and flake8 pre-commit hooks. · dry-python/dry-python.github.io@1b71c82 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1b71c82

Browse files
committed
Setup black and flake8 pre-commit hooks.
1 parent 4069a1e commit 1b71c82

File tree

3 files changed

+24
-6
lines changed

3 files changed

+24
-6
lines changed

.flake8

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[flake8]
2+
max-line-length = 88

.pre-commit-config.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,23 @@ repos:
77
- id: end-of-file-fixer
88
- id: file-contents-sorter
99
files: .gitignore
10+
- repo: https://github.com/asottile/pyupgrade
11+
rev: v1.26.1
12+
hooks:
13+
- id: pyupgrade
14+
- repo: https://github.com/asottile/reorder_python_imports
15+
rev: v1.9.0
16+
hooks:
17+
- id: reorder-python-imports
18+
- repo: https://github.com/psf/black
19+
rev: 19.10b0
20+
hooks:
21+
- id: black
1022
- repo: https://github.com/prettier/prettier
1123 D020
rev: 1.19.1
1224
hooks:
1325
- id: prettier
26+
- repo: https://github.com/PyCQA/flake8
27+
rev: 3.7.9
28+
hooks:
29+
- id: flake8

tasks.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33

44
@task
55
def lint(c):
6-
c.run('poetry run pre-commit run -a')
7-
c.run('poetry run yamllint --strict .')
8-
c.run('npm run lint:css')
9-
c.run('npm run lint:js')
10-
c.run('npm run lint:md')
11-
c.run('npm run lint:pug')
6+
c.run("poetry run pre-commit run -a")
7+
c.run("poetry run yamllint --strict .")
8+
c.run("npm run lint:css")
9+
c.run("npm run lint:js")
10+
c.run("npm run lint:md")
11+
c.run("npm run lint:pug")
1212
c.run("vale '--glob=*.md' docs")

0 commit comments

Comments
 (0)
0