-
Notifications
You must be signed in to change notification settings - Fork 0
/
tasks.py
42 lines (30 loc) · 852 Bytes
/
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
42
"""Script for running any/all command line tasks.
All command line tasks should be defined in this file. The only
exception to this is managing dependencies via Pipenv.
"""
# Third-party dependencies:
from invoke import task
@task
def fmt(c):
"""Format JSON and code."""
# See https://unix.stackexchange.com/a/244947.
c.run("jq . cv/cv.json | sponge cv/cv.json")
c.run("black cv/cv.py")
@task
def lint(c):
"""Run the linter."""
c.run("pylint cv/cv.py")
@task
def types(c):
"""Check types."""
c.run("mypy cv/cv.py")
# Invoke requires us to have a context parameter, even though it is
# unused.
# pylint: disable=unused-argument
@task(pre=[fmt, lint, types])
def check(c):
"""Run all code checks."""
@task
def cv(c):
"""Run the script that generates the CV files."""
c.run("cd cv && python cv.py")