-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
129 lines (112 loc) · 3.53 KB
/
Copy pathTaskfile.yml
File metadata and controls
129 lines (112 loc) · 3.53 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
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# https://taskfile.dev
version: "3"
tasks:
ddev:
desc: "Run DDEV command"
cmds:
- ddev {{.TASK_ARGS}} {{.CLI_ARGS}}
internal: true
coding-standards:apply:
desc: "Apply coding standards"
cmds:
- task: coding-standards:composer:apply
- task: coding-standards:markdown:apply
- task: coding-standards:php:apply
- task: coding-standards:yaml:apply
coding-standards:check:
desc: "Check coding standards"
cmds:
- task: coding-standards:composer:check
- task: coding-standards:markdown:check
- task: coding-standards:php:check
- task: coding-standards:yaml:check
coding-standards:composer:apply:
desc: "Apply coding standards for composer"
cmds:
- task: ddev
vars:
TASK_ARGS: composer normalize
coding-standards:composer:check:
- task: coding-standards:composer:apply
- task: ddev
vars:
TASK_ARGS: composer normalize --dry-run
- task: ddev
vars:
TASK_ARGS: composer validate
coding-standards:markdown:apply:
desc: "Apply coding standards for Markdown"
cmds:
# Cf. .github/workflows/markdown.yaml
- docker compose run --rm markdownlint markdownlint '**/*.md' --fix
coding-standards:markdown:check:
desc: "Apply and check coding standards for Markdown"
cmds:
- task: coding-standards:markdown:apply
# Cf. .github/workflows/markdown.yaml
- docker compose run --rm markdownlint markdownlint '**/*.md'
coding-standards:php:apply:
desc: "Apply coding standards for PHP"
cmds:
# Cf. .github/workflows/php.yaml
- task: ddev
vars:
TASK_ARGS: phpcbf
coding-standards:php:check:
desc: "Apply and check coding standards for PHP"
cmds:
- task: coding-standards:php:apply
# Cf. .github/workflows/php.yaml
- task: ddev
vars:
TASK_ARGS: phpcs
coding-standards:yaml:apply:
desc: "Apply coding standards for YAML"
cmds:
# Cf. .github/workflows/yaml.yaml
- docker compose run --rm prettier '**/*.{yml,yaml}' --write
coding-standards:yaml:check:
desc: "Apply coding standards for YAML"
cmds:
- task: coding-standards:yaml:apply
# Cf. .github/workflows/yaml.yaml
- docker compose run --rm prettier '**/*.{yml,yaml}' --check
code-analysis:
desc: "Run static code analysis"
cmds:
- task: code-analysis:phpstan
code-analysis:phpstan:
desc: "Run PHPStan"
cmds:
- task: ddev
vars:
TASK_ARGS: phpstan
rector:
desc: "Run rector"
cmds:
- task: ddev
vars:
TASK_ARGS: php vendor/bin/rector
ddev:start:
desc: Start DDEV setup (https://github.com/ddev/ddev-drupal-contrib)
# https://github.com/ddev/ddev-drupal-contrib
deps:
- composer:install:lenient
cmds:
- ddev add-on get ddev/ddev-drupal-contrib
- ddev restart
- ddev poser --no-interaction
- ddev symlink-project
# Detect expected Drupal and PHP versions.
- ddev config --update
composer:install:lenient:
cmds:
# Create a temporary composer file to install https://github.com/mglaman/composer-drupal-lenient before the real install needs it.
- for:
- init --no-interaction
- config --no-plugins allow-plugins.mglaman/composer-drupal-lenient true
- require mglaman/composer-drupal-lenient:^1.0
cmd: ddev exec -- COMPOSER=composer.lenient.json composer {{.ITEM}}
# Clean up
- rm -f composer.lenient.*
internal: true