Skip to content

Commit 75b402d

Browse files
committed
Reduce line length to <=120 in YAML files where feasible
120 columns is the recommended line length for YAML code in Arduino tooling projects. The yamllint tool used by the "Check YAML" template produces a warning when a line exceeds this length. This is not a hard limit and in some cases it is either impossible or not beneficial to make lines less than 120 in length so some violations of the guideline are unavoidable. However, a survey of the YAML files in the repository revealed some opportunities for improving the code by reducing the lengths.
1 parent 3ebb027 commit 75b402d

15 files changed

+96
-26
lines changed

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

+5-1
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

+10-5
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

+9-4
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

+2-1
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

+2-1
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

+2-1
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

+2-1
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

+5-1
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

+5-1
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

+13-2
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 \

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

+13-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,13 @@ jobs:
3131
id: determination
3232
run: |
3333
RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x"
34-
if [[ "${{ github.event_name }}" == "push" || ( "${{ github.event_name }}" == "create" && "${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX ) ]]; then
34+
if [[
35+
"${{ github.event_name }}" == "push" ||
36+
(
37+
"${{ github.event_name }}" == "create" &&
38+
"${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX
39+
)
40+
]]; then
3541
RESULT="true"
3642
else
3743
RESULT="false"
@@ -71,7 +77,12 @@ jobs:
7177
# Publishing implies creating a git commit on the gh-pages branch, we let @ArduinoBot own these commits.
7278
git config --global user.email "[email protected]"
7379
git config --global user.name "ArduinoBot"
74-
git fetch --no-tags --prune --depth=1 origin +refs/heads/gh-pages:refs/remotes/origin/gh-pages
80+
git fetch \
81+
--no-tags \
82+
--prune \
83+
--depth=1 \
84+
origin \
85+
+refs/heads/gh-pages:refs/remotes/origin/gh-pages
7586
poetry run mike deploy \
7687
--update-aliases \
7788
--push \

workflow-templates/publish-go-nightly-task.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ jobs:
9191
env:
9292
KEYCHAIN: "sign.keychain"
9393
INSTALLER_CERT_MAC_PATH: "/tmp/ArduinoCerts2020.p12"
94-
KEYCHAIN_PASSWORD: keychainpassword # Arbitrary password for a keychain that exists only for the duration of the job, so not secret
94+
# Arbitrary password for a keychain that exists only for the duration of the job, so not secret
95+
KEYCHAIN_PASSWORD: keychainpassword
9596
run: |
9697
echo "${{ secrets.INSTALLER_CERT_MAC_P12 }}" | base64 --decode > "${{ env.INSTALLER_CERT_MAC_PATH }}"
9798
security create-keychain -p "${{ env.KEYCHAIN_PASSWORD }}" "${{ env.KEYCHAIN }}"

workflow-templates/release-go-crosscompile-task.yml

+8-2
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ jobs:
8989
env:
9090
KEYCHAIN: "sign.keychain"
9191
INSTALLER_CERT_MAC_PATH: "/tmp/ArduinoCerts2020.p12"
92-
KEYCHAIN_PASSWORD: keychainpassword # Arbitrary password for a keychain that exists only for the duration of the job, so not secret
92+
# Arbitrary password for a keychain that exists only for the duration of the job, so not secret
93+
KEYCHAIN_PASSWORD: keychainpassword
9394
run: |
9495
echo "${{ secrets.INSTALLER_CERT_MAC_P12 }}" | base64 --decode > "${{ env.INSTALLER_CERT_MAC_PATH }}"
9596
security create-keychain -p "${{ env.KEYCHAIN_PASSWORD }}" "${{ env.KEYCHAIN }}"
@@ -180,7 +181,12 @@ jobs:
180181

181182
- name: Update checksum
182183
run: |
183-
declare -a checksum_lines=("${{ needs.notarize-macos.outputs.checksum-darwin_amd64 }}" "${{ needs.notarize-macos.outputs.checksum-darwin_arm64 }}")
184+
declare \
185+
-a \
186+
checksum_lines=(
187+
"${{ needs.notarize-macos.outputs.checksum-darwin_amd64 }}" \
188+
"${{ needs.notarize-macos.outputs.checksum-darwin_arm64 }}"
189+
)
184190
for checksum_line in "${checksum_lines[@]}"
185191
do
186192
CHECKSUM=$(echo ${checksum_line} | cut -d " " -f 1)

workflow-templates/release-go-task.yml

+10-2
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ jobs:
9797
env:
9898
KEYCHAIN: "sign.keychain"
9999
INSTALLER_CERT_MAC_PATH: "/tmp/ArduinoCerts2020.p12"
100-
KEYCHAIN_PASSWORD: keychainpassword # Arbitrary password for a keychain that exists only for the duration of the job, so not secret
100+
# Arbitrary password for a keychain that exists only for the duration of the job, so not secret
101+
KEYCHAIN_PASSWORD: keychainpassword
101102
run: |
102103
echo "${{ secrets.INSTALLER_CERT_MAC_P12 }}" | base64 --decode > "${{ env.INSTALLER_CERT_MAC_PATH }}"
103104
security create-keychain -p "${{ env.KEYCHAIN_PASSWORD }}" "${{ env.KEYCHAIN }}"
@@ -193,7 +194,14 @@ jobs:
193194
run: |
194195
wget -q -P /tmp https://github.com/fsaintjacques/semver-tool/archive/3.2.0.zip
195196
unzip -p /tmp/3.2.0.zip semver-tool-3.2.0/src/semver >/tmp/semver && chmod +x /tmp/semver
196-
if [[ "$(/tmp/semver get prerel "${GITHUB_REF/refs\/tags\//}")" ]]; then echo "IS_PRE=true" >> $GITHUB_OUTPUT; fi
197+
if [[
198+
"$(
199+
/tmp/semver get prerel \
200+
"${GITHUB_REF/refs\/tags\//}"
201+
)"
202+
]]; then
203+
echo "IS_PRE=true" >> $GITHUB_OUTPUT
204+
fi
197205
198206
- name: Create Github Release and upload artifacts
199207
uses: ncipollo/release-action@v1

workflow-templates/release-tag.yml

+8-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,14 @@ jobs:
5353
- name: Identify Prerelease
5454
id: prerelease
5555
run: |
56-
if [[ "$("${{ env.SEMVER_TOOL_PATH }}" get prerel "${GITHUB_REF/refs\/tags\//}")" ]]; then echo "IS_PRE=true" >> $GITHUB_OUTPUT"; fi
56+
if [[
57+
"$(
58+
"${{ env.SEMVER_TOOL_PATH }}" get prerel \
59+
"${GITHUB_REF/refs\/tags\//}"
60+
)"
61+
]]; then
62+
echo "IS_PRE=true" >> $GITHUB_OUTPUT"
63+
fi
5764
5865
- name: Create Github release
5966
uses: ncipollo/release-action@v1

0 commit comments

Comments
 (0)