Skip to content

Commit 496cca7

Browse files
authored
Merge pull request #301 from per1234/shorten-yaml-lines
Reduce line length to <=120 in YAML files where feasible
2 parents 3daf502 + 75b402d commit 496cca7

File tree

15 files changed

+96
-26
lines changed

15 files changed

+96
-26
lines changed

.github/workflows/check-shell-task.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,11 @@ jobs:
101101
run: |
102102
cd "${{ env.INSTALL_PATH }}"
103103
tar --extract --file="${{ steps.download.outputs.name }}"
104-
EXTRACTION_FOLDER="$(basename "${{ steps.download.outputs.name }}" "${{ env.SHELLCHECK_RELEASE_ASSET_SUFFIX }}")"
104+
EXTRACTION_FOLDER="$(
105+
basename \
106+
"${{ steps.download.outputs.name }}" \
107+
"${{ env.SHELLCHECK_RELEASE_ASSET_SUFFIX }}"
108+
)"
105109
# Add installation to PATH:
106110
# See: https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-system-path
107111
echo "${{ env.INSTALL_PATH }}/$EXTRACTION_FOLDER" >> "$GITHUB_PATH"

.github/workflows/test-install-script.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,14 @@ jobs:
2626
runs-on: ubuntu-latest
2727

2828
env:
29-
PROJECT_OWNER_PLACEHOLDER: arduino # Placeholder value of the PROJECT_OWNER variable in the template script
30-
PROJECT_OWNER: arduino # Replacement value used for the tests
31-
PROJECT_NAME_PLACEHOLDER: TODO_PROJECT_NAME # Placeholder value of the PROJECT_NAME variable in the template script
32-
PROJECT_NAME: arduino-lint # Replacement value used for the tests
29+
# Placeholder value of the PROJECT_OWNER variable in the template script
30+
PROJECT_OWNER_PLACEHOLDER: arduino
31+
# Replacement value used for the tests
32+
PROJECT_OWNER: arduino
33+
# Placeholder value of the PROJECT_NAME variable in the template script
34+
PROJECT_NAME_PLACEHOLDER: TODO_PROJECT_NAME
35+
# Replacement value used for the tests
36+
PROJECT_NAME: arduino-lint
3337
SCRIPT_FOLDER: other/installation-script
3438

3539
steps:
@@ -254,7 +258,8 @@ jobs:
254258
-F \
255259
'${{ env.TOOL_NAME }} was found at ${{ env.FIRST_BINDIR }}/${{ env.TOOL_NAME }}. Please prepend "${{ env.BINDIR }}" to your $PATH'
256260
257-
# ${{ runner.temp }} is a Windows style path on the windows runner, but the script output uses the equivalent POSIX style path.
261+
# ${{ runner.temp }} is a Windows style path on the windows runner, but the script output uses the equivalent
262+
# POSIX style path.
258263
# So a regex is used for the output check on Windows.
259264
- name: Check script output with previous installation in PATH (Windows)
260265
if: runner.os == 'Windows'

Taskfile.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,14 +144,17 @@ tasks:
144144
cmds:
145145
- |
146146
if ! which clang-format &>/dev/null; then
147-
echo "clang-format not found or not in PATH. Please install: https://github.com/arduino/clang-static-binaries/releases"
147+
echo "clang-format not found or not in PATH."
148+
echo "Please install: https://github.com/arduino/clang-static-binaries/releases"
148149
exit 1
149150
fi
150151
- |
151152
INSTALLED_CLANG_FORMAT_VERSION_ARRAY=($(clang-format --version))
152153
INSTALLED_CLANG_FORMAT_VERSION="${INSTALLED_CLANG_FORMAT_VERSION_ARRAY[${#INSTALLED_CLANG_FORMAT_VERSION_ARRAY[@]}-1]}"
153154
if [[ "$INSTALLED_CLANG_FORMAT_VERSION" != "{{.EXPECTED_CLANG_FORMAT_VERSION}}" ]]; then
154-
echo "Installed version of clang-format $INSTALLED_CLANG_FORMAT_VERSION (at $(which clang-format)) does not match expected {{.EXPECTED_CLANG_FORMAT_VERSION}}"
155+
echo "Installed version of clang-format does not match expected:"
156+
echo "Installed: $INSTALLED_CLANG_FORMAT_VERSION (at $(which clang-format))"
157+
echo "Expected: {{.EXPECTED_CLANG_FORMAT_VERSION}}"
155158
exit 1
156159
fi
157160
@@ -522,7 +525,8 @@ tasks:
522525
# npx --call uses the native shell, which makes it too difficult to use npx for this application on Windows,
523526
# so the Windows user is required to have markdown-link-check installed and in PATH.
524527
if ! which markdown-link-check &>/dev/null; then
525-
echo "markdown-link-check not found or not in PATH. Please install: https://github.com/tcort/markdown-link-check#readme"
528+
echo "markdown-link-check not found or not in PATH."
529+
echo "Please install: https://github.com/tcort/markdown-link-check#readme"
526530
exit 1
527531
fi
528532
# Default behavior of the task on Windows is to exit the task when the first broken link causes a non-zero
@@ -723,7 +727,8 @@ tasks:
723727
cmds:
724728
- |
725729
if ! which shellcheck &>/dev/null; then
726-
echo "shellcheck not installed or not in PATH. Please install: https://github.com/koalaman/shellcheck#installing"
730+
echo "shellcheck not installed or not in PATH."
731+
echo "Please install: https://github.com/koalaman/shellcheck#installing"
727732
exit 1
728733
fi
729734
- |

workflow-templates/assets/check-dependencies-task/Taskfile.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ tasks:
1212
echo "Licensed does not have Windows support."
1313
echo "Please use Linux/macOS or download the dependencies cache from the GitHub Actions workflow artifact."
1414
else
15-
echo "licensed not found or not in PATH. Please install: https://github.com/github/licensed#as-an-executable"
15+
echo "licensed not found or not in PATH."
16+
echo "Please install: https://github.com/github/licensed#as-an-executable"
1617
fi
1718
exit 1
1819
fi

workflow-templates/assets/check-general-formatting-task/Taskfile.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ tasks:
88
cmds:
99
- |
1010
if ! which ec &>/dev/null; then
11-
echo "ec not found or not in PATH. Please install: https://github.com/editorconfig-checker/editorconfig-checker#installation"
11+
echo "ec not found or not in PATH."
12+
echo "Please install: https://github.com/editorconfig-checker/editorconfig-checker#installation"
1213
exit 1
1314
fi
1415
- ec

workflow-templates/assets/check-markdown-task/Taskfile.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ tasks:
1919
# npx --call uses the native shell, which makes it too difficult to use npx for this application on Windows,
2020
# so the Windows user is required to have markdown-link-check installed and in PATH.
2121
if ! which markdown-link-check &>/dev/null; then
22-
echo "markdown-link-check not found or not in PATH. Please install: https://github.com/tcort/markdown-link-check#readme"
22+
echo "markdown-link-check not found or not in PATH."
23+
echo "Please install: https://github.com/tcort/markdown-link-check#readme"
2324
exit 1
2425
fi
2526
# Default behavior of the task on Windows is to exit the task when the first broken link causes a non-zero

workflow-templates/assets/check-shell-task/Taskfile.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ tasks:
88
cmds:
99
- |
1010
if ! which shellcheck &>/dev/null; then
11-
echo "shellcheck not installed or not in PATH. Please install: https://github.com/koalaman/shellcheck#installing"
11+
echo "shellcheck not installed or not in PATH."
12+
echo "Please install: https://github.com/koalaman/shellcheck#installing"
1213
exit 1
1314
fi
1415
- |

workflow-templates/assets/go-task/Taskfile.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ vars:
66
DEFAULT_GO_MODULE_PATH: ./
77
DEFAULT_GO_PACKAGES:
88
sh: |
9-
echo $(cd {{default .DEFAULT_GO_MODULE_PATH .GO_MODULE_PATH}} && go list ./... | tr '\n' ' ' || echo '"ERROR: Unable to discover Go packages"')
9+
echo $(
10+
cd {{default .DEFAULT_GO_MODULE_PATH .GO_MODULE_PATH}} &&
11+
go list ./... | tr '\n' ' ' ||
12+
echo '"ERROR: Unable to discover Go packages"'
13+
)
1014
# `-ldflags` flag to use for `go build` command
1115
# TODO: define flag if required by the project, or leave empty if not needed.
1216
LDFLAGS:

workflow-templates/check-shell-task.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,11 @@ jobs:
101101
run: |
102102
cd "${{ env.INSTALL_PATH }}"
103103
tar --extract --file="${{ steps.download.outputs.name }}"
104-
EXTRACTION_FOLDER="$(basename "${{ steps.download.outputs.name }}" "${{ env.SHELLCHECK_RELEASE_ASSET_SUFFIX }}")"
104+
EXTRACTION_FOLDER="$(
105+
basename \
106+
"${{ steps.download.outputs.name }}" \
107+
"${{ env.SHELLCHECK_RELEASE_ASSET_SUFFIX }}"
108+
)"
105109
# Add installation to PATH:
106110
# See: https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-system-path
107111
echo "${{ env.INSTALL_PATH }}/$EXTRACTION_FOLDER" >> "$GITHUB_PATH"

workflow-templates/deploy-cobra-mkdocs-versioned-poetry.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,13 @@ jobs:
3636
id: determination
3737
run: |
3838
RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x"
39-
if [[ "${{ github.event_name }}" == "push" || ( "${{ github.event_name }}" == "create" && "${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX ) ]]; then
39+
if [[
40+
"${{ github.event_name }}" == "push" ||
41+
(
42+
"${{ github.event_name }}" == "create" &&
43+
"${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX
44+
)
45+
]]; then
4046
RESULT="true"
4147
else
4248
RESULT="false"
@@ -85,7 +91,12 @@ jobs:
8591
# Publishing implies creating a git commit on the gh-pages branch, we let @ArduinoBot own these commits.
8692
git config --global user.email "[email protected]"
8793
git config --global user.name "ArduinoBot"
88-
git fetch --no-tags --prune --depth=1 origin +refs/heads/gh-pages:refs/remotes/origin/gh-pages
94+
git fetch \
95+
--no-tags \
96+
--prune \
97+
--depth=1 \
98+
origin \
99+
+refs/heads/gh-pages:refs/remotes/origin/gh-pages
89100
poetry run mike deploy \
90101
--update-aliases \
91102
--push \

0 commit comments

Comments
 (0)