-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
47 lines (40 loc) · 1.16 KB
/
Taskfile.yml
File metadata and controls
47 lines (40 loc) · 1.16 KB
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
# https://taskfile.dev
version: '3'
#vars:
# GREETING: Hello, World!
tasks:
# default:
# cmds:
# - echo "{{.GREETING}}"
# silent: true
lint:*:
vars:
YEAR: '{{index .MATCH 0}}'
cmds:
- vendor/bin/phpcs --standard=PSR12 ./{{.YEAR}}
- vendor/bin/phpcbf --standard=PSR12 ./{{.YEAR}}
- vendor/bin/phpstan analyse ./{{.YEAR}}
tests:*:
vars:
YEAR: '{{index .MATCH 0}}'
cmds:
- vendor/bin/phpunit {{.YEAR}}/tests/
create-year:*:
vars:
YEAR: '{{index .MATCH 0}}'
cmds:
- mkdir -p {{.YEAR}}
- mkdir -p {{.YEAR}}/inputs
- mkdir -p {{.YEAR}}/src
- mkdir -p {{.YEAR}}/tests
- |
jq '.autoload."psr-4" += {"adventofcode\\Year{{.YEAR}}\\": "{{index .MATCH 0}}/src/", "adventofcode\\Year{{.YEAR}}\\Test\\": "{{index .MATCH 0}}/tests/"}' composer.json > temp.json && mv temp.json composer.json
- composer normalize
setup-day:*:*:
vars:
YEAR: '{{index .MATCH 0}}'
DAY: '{{index .MATCH 1}}'
cmds:
- touch {{.YEAR}}/day-{{.DAY}}.php
- touch {{.YEAR}}/inputs/day-{{.DAY}}.input
- touch {{.YEAR}}/inputs/day-{{.DAY}}-sample.input