-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yml
83 lines (69 loc) · 2.16 KB
/
Taskfile.yml
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# This file was written by Damien Dart, <[email protected]>. This is
# free and unencumbered software released into the public domain. For
# more information, please refer to the accompanying "UNLICENCE file.
---
version: '3'
output: 'prefixed'
tasks:
default:
deps:
- task: 'ci'
ci:
cmds:
- task: 'start'
- task: 'dependencies'
- task: 'lint'
desc: 'Run all CI-related tasks'
dependencies:
cmds:
- cmd: 'shellcheck -V 1&>/dev/null || (echo "ERROR: Shellcheck is not installed!"; exit 1)'
- task: 'dependencies:python'
desc: 'Run all dependency-installing tasks'
dependencies:python:
cmds:
- '.venv/bin/python -m pip install -r requirements-dev.txt'
desc: 'Install Python dependencies for development'
lint:
cmds:
- task: 'lint:python'
- task: 'lint:shell'
desc: 'Run all linting-related tasks'
lint:python:
cmds:
- task: 'lint:python:black'
- task: 'lint:python:flake8'
- task: 'lint:python:mypy'
desc: 'Run all Python-linting tasks'
lint:python:black:
cmds:
- '.venv/bin/black --check --diff install bin/git-hometime bin/markdown-tidy bin/po bin/rpncalc bin/timeshit'
desc: 'Lint Python scripts with Black'
lint:python:flake8:
cmds:
- '.venv/bin/flake8 install bin/git-hometime bin/markdown-tidy bin/po bin/rpncalc bin/timeshit'
desc: 'Lint Python scripts with Flake8'
lint:python:mypy:
cmds:
- '.venv/bin/mypy --scripts-are-modules bin/git-hometime bin/rpncalc'
desc: 'Type check Python scripts with mypy'
lint:shell:
cmds:
- >-
shellcheck
.bash_profile
.bashrc
.profile
.shellrc
bin/fuzzy-*
desc: 'Lint shell configuration files and scripts with ShellCheck'
start:
cmds:
- 'python3 -m venv .venv'
- cmd: |
if [ -z "$VIRTUAL_ENV" ]; then
echo "Run \"source .venv/bin/activate\" to activate the virtual environment"
else
echo "Active Python virtual environment: $VIRTUAL_ENV"
fi
silent: true
desc: 'Create a Python virtual environment for development and testing'