forked from opsani/statesman
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tasks.py
41 lines (29 loc) · 1.1 KB
/
tasks.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import invoke
@invoke.task(name="format")
def _format(task):
task.run("poetry run isort .")
task.run(
"""poetry run autoflake --recursive \
--ignore-init-module-imports \
--remove-all-unused-imports \
--remove-unused-variables \
--in-place .""",
)
task.run("poetry run autopep8 --in-place --aggressive --aggressive statesman.py statesman_test.py")
task.run("poetry run pyformat --in-place statesman.py statesman_test.py")
@invoke.task()
def test(task):
task.run("poetry run pytest --cov=statesman --cov-report=term-missing:skip-covered --cov-config=setup.cfg .", pty=True)
@invoke.task()
def typecheck(task):
task.run("poetry run mypy . || true")
@invoke.task(name="lint-docs")
def lint_docs(task):
task.run("poetry run flake8-markdown \"**/*.md\" || true", pty=True)
@invoke.task(lint_docs)
def lint(task):
task.run("poetry run flakehell lint --count", pty=True)
@invoke.task(name="pre-commit")
def pre_commit(task):
task.run("poetry run pre-commit install", pty=True)
task.run("poetry run pre-commit run --all-files", pty=True)