8000 Extract linters from pre-commit. (#345) · ra2003/dry-python.github.io@c18c3da · GitHub
[go: up one dir, main page]

Skip to content

Commit c18c3da

Browse files
authored
Extract linters from pre-commit. (dry-python#345)
* Extract flake8 from pre-commit. * Extract npm scripts into invoke tasks.
1 parent 4db1228 commit c18c3da

File tree

6 files changed

+75
-17
lines changed

6 files changed

+75
-17
lines changed

.flake8

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
[flake8]
22
max-line-length = 88
3+
exclude = .svn,CVS,.bzr,.hg,.git,__pycache__,.tox,.eggs,*.egg,node_modules,site

.pre-commit-config.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,3 @@ repos:
2323
rev: 1.19.1
2424
hooks:
2525
- id: prettier
26-
- repo: https://github.com/PyCQA/flake8
27-
rev: 3.7.9
28-
hooks:
29-
- id: flake8

package.json

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,5 @@
3333
"vscode-html-languageserver-bin": "^1.4.0",
3434
"webpack": "^4.41.5",
3535
"webpack-cli": "^3.3.10"
36-
},
37-
"scripts": {
38-
"build:slides": "webpack",
39-
"lint:css": "stylelint --ignore-path .gitignore '**/*.css'",
40-
"lint:js": "eslint --ext .js --ignore-path .gitignore .",
41-
"lint:md": "remark --frail .",
42-
"lint:pug": "pug-lint **/*.pug"
4336
}
4437
}

poetry.lock

Lines changed: 67 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ mkdocs-material = "^4.6.0"
1212
[tool.poetry.dev-dependencies]
1313
dependencies = "^0.15"
1414
django = "^3.0.2"
15+
flake8 = "^3.7.9"
1516
invoke = "^1.4.0"
1617
pre-commit = "^1.21.0"
1718
stories = "^0.10.1"

tasks.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,19 @@
55
def lint(c):
66
c.run("poetry run pre-commit run -a")
77
c.run("poetry run python -m mddoctest")
8+
c.run("poetry run flake8 .")
89
c.run("poetry run yamllint --strict .")
9-
c.run("npm run lint:css")
10-
c.run("npm run lint:js")
11-
c.run("npm run lint:md")
12-
c.run("npm run lint:pug")
10+
c.run("npx stylelint --ignore-path .gitignore '**/*.css'")
11+
c.run("npx eslint --ext .js --ignore-path .gitignore .")
12+
c.run("npx remark --frail .")
13+
c.run("npx pug-lint **/*.pug")
1314
c.run("vale '--glob=*.md' docs")
1415

1516

1617
@task
1718
def build(c):
1819
c.run("poetry run mkdocs build")
19-
c.run("npm run build:slides")
20+
c.run("npx webpack")
2021

2122

2223
@task

0 commit comments

Comments
 (0)
0