-
Notifications
You must be signed in to change notification settings - Fork 120
/
Taskfile.yaml
59 lines (51 loc) · 1.55 KB
/
Taskfile.yaml
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
# https://taskfile.dev
version: '3'
vars:
BROKEN_LINKS_REPORT: broken-links-report.md
tasks:
default:
- task: lint
lint:
desc: Run all linters.
deps:
- task: lint:broken-links
- task: lint:editorconfig
lint:editorconfig:
desc: Check that files follow .editorconfig rules.
aliases: [ec]
cmds:
- '{{.EC}}'
vars:
EC_VERSION: v3.0.3
EC: go run github.com/editorconfig-checker/editorconfig-checker/v3/cmd/editorconfig-checker@{{.EC_VERSION}}
lint:broken-links:
desc: Use xurls to check markdown files for broken links.
aliases: [links]
cmds:
- "{{.XURLS}} *.md | sort -u | grep -Ev '{{.RE_IGNORE}}' | {{.XURLS}} -fix >/dev/null 2> >(tee {{.BROKEN_LINKS_REPORT}} >&2)"
vars:
XURLS_VERSION: v2.5.0
XURLS: go run mvdan.cc/xurls/v2/cmd/xurls@{{.XURLS_VERSION}}
URL_IGNORE_LIST: |
instagram.com
linkedin.com
marketplace.visualstudio.com
twitter.com
RE_IGNORE: '{{splitList "\n" .URL_IGNORE_LIST | join "|" | trimSuffix "|"}}'
lint:broken-links:create-gh-issue:
desc: Create a GitHub issue based on a broken links report.
aliases: [gh]
preconditions:
- test -f {{.BROKEN_LINKS_REPORT}}
cmds:
- >-
echo TODO - TEST AND IMPLEMENT:
gh issue create
--title "Broken Links Report $(date +%s)"
--body-file {{.BROKEN_LINKS_REPORT}}
--label broken-links
--label 'automated-issue'
clean:
desc: Remove generated files.
cmds:
- rm -f {{.BROKEN_LINKS_REPORT}}