@@ -142,13 +142,15 @@ tasks:
142
142
desc : Check for broken links
143
143
deps :
144
144
- task : docs:generate
145
+ - task : npm:install-deps
145
146
cmds :
146
147
- |
147
148
if [[ "{{.OS}}" == "Windows_NT" ]]; then
148
149
# npx --call uses the native shell, which makes it too difficult to use npx for this application on Windows,
149
150
# so the Windows user is required to have markdown-link-check installed and in PATH.
150
151
if ! which markdown-link-check &>/dev/null; then
151
- echo "markdown-link-check not found or not in PATH. Please install: https://github.com/tcort/markdown-link-check#readme"
152
+ echo "markdown-link-check not found or not in PATH."
153
+ echo "Please install: https://github.com/tcort/markdown-link-check#readme"
152
154
exit 1
153
155
fi
154
156
# Default behavior of the task on Windows is to exit the task when the first broken link causes a non-zero
@@ -158,7 +160,14 @@ tasks:
158
160
# Using -regex instead of -name to avoid Task's behavior of globbing even when quoted on Windows
159
161
# The odd method for escaping . in the regex is required for windows compatibility because mvdan.cc/sh gives
160
162
# \ characters special treatment on Windows in an attempt to support them as path separators.
161
- for file in $(find . -regex ".*[.]md"); do
163
+ for file in $(
164
+ find . \
165
+ -type d -name '.git' -prune -o \
166
+ -type d -name '.licenses' -prune -o \
167
+ -type d -name '__pycache__' -prune -o \
168
+ -type d -name 'node_modules' -prune -o \
169
+ -regex ".*[.]md" -print
170
+ ); do
162
171
markdown-link-check \
163
172
--quiet \
164
173
--config "./.markdown-link-check.json" \
@@ -169,7 +178,14 @@ tasks:
169
178
else
170
179
npx --package=markdown-link-check --call='
171
180
STATUS=0
172
- for file in $(find . -regex ".*[.]md"); do
181
+ for file in $(
182
+ find . \
183
+ -type d -name '.git' -prune -o \
184
+ -type d -name '.licenses' -prune -o \
185
+ -type d -name '__pycache__' -prune -o \
186
+ -type d -name 'node_modules' -prune -o \
187
+ -regex ".*[.]md" -print
188
+ ); do
173
189
markdown-link-check \
174
190
--quiet \
175
191
--config "./.markdown-link-check.json" \
@@ -183,15 +199,25 @@ tasks:
183
199
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-markdown-task/Taskfile.yml
184
200
markdown:fix :
185
201
desc : Automatically correct linting violations in Markdown files where possible
202
+ deps :
203
+ - task : npm:install-deps
186
204
cmds :
187
205
- npx markdownlint-cli --fix "**/*.md"
188
206
189
207
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-markdown-task/Taskfile.yml
190
208
markdown:lint :
191
209
desc : Check for problems in Markdown files
210
+ deps :
211
+ - task : npm:install-deps
192
212
cmds :
193
213
- npx markdownlint-cli "**/*.md"
194
214
215
+ # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/npm-task/Taskfile.yml
216
+ npm:install-deps :
217
+ desc : Install dependencies managed by npm
218
+ cmds :
219
+ - npm install
220
+
195
221
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/poetry-task/Taskfile.yml
196
222
poetry:install-deps :
197
223
desc : Install dependencies managed by Poetry
0 commit comments