Skip to content

Commit 9567dbd

Browse files
committed
Split shell commands into multiple lines for readability
The project's GitHub Actions workflows and tasks contain complex shell command lines. With the use of the line continuation operator, these commands can be split into multiple code lines. This improves readability by providing a visualization of the command structure and avoiding excessive line lengths. It also improves maintainability by making diffs for changes to these commands more clear. Previously this was done in many commands, but not consistently throughout the project.
1 parent 6e225bb commit 9567dbd

File tree

62 files changed

+963
-285
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+963
-285
lines changed

.github/workflows/check-ci-sync.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,21 @@ jobs:
4040
version: 3.x
4141

4242
- name: Sync files
43-
run: task --silent ci:sync
43+
run: |
44+
task \
45+
--silent \
46+
ci:sync
4447
4548
- name: Check file duplicates sync
4649
run: |
4750
git add .
48-
if ! git diff --color --exit-code HEAD; then
51+
52+
if
53+
! git diff \
54+
--color \
55+
--exit-code \
56+
HEAD
57+
then
4958
echo "::error::File duplicates are out of sync. Please run \"task fix\""
5059
exit 1
5160
fi

.github/workflows/check-clang-format.yml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ jobs:
5555
version: 3.x
5656

5757
- name: Validate ClangFormat configuration files
58-
run: task --silent clang-format:validate
58+
run: |
59+
task \
60+
--silent \
61+
clang-format:validate
5962
6063
check-config:
6164
runs-on: ubuntu-latest
@@ -95,7 +98,9 @@ jobs:
9598
- name: Install ClangFormat
9699
run: |
97100
cd "${{ env.CLANG_FORMAT_INSTALL_PATH }}"
98-
tar --extract --file="${{ steps.download-clang-format.outputs.name }}"
101+
tar \
102+
--extract \
103+
--file="${{ steps.download-clang-format.outputs.name }}"
99104
# Add installation to PATH:
100105
# See: https://docs.github.com/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions#adding-a-system-path
101106
echo "${{ env.CLANG_FORMAT_INSTALL_PATH }}/clang_Linux_64bit" >> "$GITHUB_PATH"
@@ -111,7 +116,9 @@ jobs:
111116
- name: Install yq
112117
run: |
113118
cd "${{ env.YQ_INSTALL_PATH }}"
114-
tar --extract --file="${{ steps.download-yq.outputs.name }}"
119+
tar \
120+
--extract \
121+
--file="${{ steps.download-yq.outputs.name }}"
115122
# Add installation to PATH:
116123
# See: https://docs.github.com/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions#adding-a-system-path
117124
echo "${{ env.YQ_INSTALL_PATH }}/yq" >> "$GITHUB_PATH"
@@ -171,7 +178,9 @@ jobs:
171178
- name: Install ClangFormat
172179
run: |
173180
cd "${{ env.CLANG_FORMAT_INSTALL_PATH }}"
174-
tar --extract --file="${{ steps.download.outputs.name }}"
181+
tar \
182+
--extract \
183+
--file="${{ steps.download.outputs.name }}"
175184
# Add installation to PATH:
176185
# See: https://docs.github.com/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions#adding-a-system-path
177186
echo "${{ env.CLANG_FORMAT_INSTALL_PATH }}/clang_Linux_64bit" >> "$GITHUB_PATH"
@@ -209,7 +218,10 @@ jobs:
209218
version: 3.x
210219

211220
- name: Check ClangFormat test data
212-
run: task --silent clang-format:check-testdata
221+
run: |
222+
task \
223+
--silent \
224+
clang-format:check-testdata
213225
214226
convert:
215227
runs-on: ubuntu-latest

.github/workflows/check-community-health-sync.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,21 @@ jobs:
4646
version: 3.x
4747

4848
- name: Sync files
49-
run: task --silent github:sync
49+
run: |
50+
task \
51+
--silent \
52+
github:sync
5053
5154
- name: Check file duplicates sync
5255
run: |
5356
git add .
54-
if ! git diff --color --exit-code HEAD; then
57+
58+
if
59+
! git diff \
60+
--color \
61+
--exit-code \
62+
HEAD
63+
then
5564
echo "::error::File duplicates are out of sync. Please run \"task fix\""
5665
exit 1
5766
fi

.github/workflows/check-config-sync.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,21 @@ jobs:
3232
version: 3.x
3333

3434
- name: Sync files
35-
run: task --silent config:sync
35+
run: |
36+
task \
37+
--silent \
38+
config:sync
3639
3740
- name: Check file duplicates sync
3841
run: |
3942
git add .
40-
if ! git diff --color --exit-code HEAD; then
43+
44+
if
45+
! git diff \
46+
--color \
47+
--exit-code \
48+
HEAD
49+
then
4150
echo "::error::File duplicates are out of sync. Please run \"task fix\""
4251
exit 1
4352
fi

.github/workflows/check-eslint.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,7 @@ jobs:
4545
version: 3.x
4646

4747
- name: Validate workflows
48-
run: task --silent eslint:validate
48+
run: |
49+
task \
50+
--silent \
51+
eslint:validate

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ jobs:
5555
version: 3.x
5656

5757
- name: Check filenames
58-
run: task --silent general:check-filenames
58+
run: |
59+
task \
60+
--silent \
61+
general:check-filenames
5962
6063
check-symlinks:
6164
needs: run-determination
@@ -75,4 +78,7 @@ jobs:
7578
version: 3.x
7679

7780
- name: Check symlinks
78-
run: task --silent general:check-symlinks
81+
run: |
82+
task \
83+
--silent \
84+
general:check-symlinks

.github/workflows/check-general-formatting-task.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,21 @@ jobs:
7171
- name: Install editorconfig-checker
7272
run: |
7373
cd "${{ env.EC_INSTALL_PATH }}"
74-
tar --extract --file="${{ steps.download.outputs.name }}"
74+
75+
tar \
76+
--extract \
77+
--file="${{ steps.download.outputs.name }}"
78+
7579
# Give the binary a standard name
76-
mv "${{ env.EC_INSTALL_PATH }}/bin/ec-linux-amd64" "${{ env.EC_INSTALL_PATH }}/bin/ec"
80+
mv \
81+
"${{ env.EC_INSTALL_PATH }}/bin/ec-linux-amd64" \
82+
"${{ env.EC_INSTALL_PATH }}/bin/ec"
7783
# Add installation to PATH:
7884
# See: https://docs.github.com/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions#adding-a-system-path
7985
echo "${{ env.EC_INSTALL_PATH }}/bin" >> "$GITHUB_PATH"
8086
8187
- name: Check formatting
82-
run: task --silent general:check-formatting
88+
run: |
89+
task \
90+
--silent \
91+
general:check-formatting

.github/workflows/check-license.yml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,9 @@ jobs:
8383
ruby-version: ruby # Install latest version
8484

8585
- name: Install licensee
86-
run: gem install licensee
86+
run: |
87+
gem install \
88+
licensee
8789
8890
- name: Check license file for ${{ matrix.check-license.path }}
8991
run: |
@@ -95,14 +97,26 @@ jobs:
9597
# See: https://github.com/licensee/licensee
9698
LICENSEE_OUTPUT="$(licensee detect --json --confidence=100)"
9799
98-
DETECTED_LICENSE_FILE="$(echo "$LICENSEE_OUTPUT" | jq .matched_files[0].filename | tr --delete '\r')"
100+
DETECTED_LICENSE_FILE="$(
101+
echo "$LICENSEE_OUTPUT" \
102+
| \
103+
jq .matched_files[0].filename \
104+
| \
105+
tr --delete '\r'
106+
)"
99107
echo "Detected license file: $DETECTED_LICENSE_FILE"
100108
if [ "$DETECTED_LICENSE_FILE" != "\"${{ matrix.check-license.expected-filename }}\"" ]; then
101109
echo "::error file=${DETECTED_LICENSE_FILE}::detected license file $DETECTED_LICENSE_FILE doesn't match expected: ${{ matrix.check-license.expected-filename }}"
102110
EXIT_STATUS=1
103111
fi
104112
105-
DETECTED_LICENSE_TYPE="$(echo "$LICENSEE_OUTPUT" | jq .matched_files[0].matched_license | tr --delete '\r')"
113+
DETECTED_LICENSE_TYPE="$(
114+
echo "$LICENSEE_OUTPUT" \
115+
| \
116+
jq .matched_files[0].matched_license \
117+
| \
118+
tr --delete '\r'
119+
)"
106120
echo "Detected license type: $DETECTED_LICENSE_TYPE"
107121
if [ "$DETECTED_LICENSE_TYPE" != "\"${{ matrix.check-license.expected-type }}\"" ]; then
108122
echo "::error file=${DETECTED_LICENSE_FILE}::detected license type $DETECTED_LICENSE_TYPE doesn't match expected \"${{ matrix.check-license.expected-type }}\""

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,4 +112,7 @@ jobs:
112112
version: 3.x
113113

114114
- name: Check links
115-
run: task --silent markdown:check-links
115+
run: |
116+
task \
117+
--silent \
118+
markdown:check-links

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

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,11 @@ jobs:
8080
version: 3.x
8181

8282
- name: Validate package.json
83-
run: task --silent npm:validate PROJECT_PATH="${{ matrix.project.path }}"
83+
run: |
84+
task \
85+
--silent \
86+
npm:validate \
87+
PROJECT_PATH="${{ matrix.project.path }}"
8488
8589
check-sync:
8690
name: check-sync (${{ matrix.project.path }})
@@ -113,10 +117,16 @@ jobs:
113117
version: 3.x
114118

115119
- name: Install npm dependencies
116-
run: task npm:install-deps PROJECT_PATH="${{ matrix.project.path }}"
120+
run: |
121+
task npm:install-deps \
122+
PROJECT_PATH="${{ matrix.project.path }}"
117123
118124
- name: Check package-lock.json
119-
run: git diff --color --exit-code "${{ matrix.project.path }}/package-lock.json"
125+
run: |
126+
git diff \
127+
--color \
128+
--exit-code \
129+
"${{ matrix.project.path }}/package-lock.json"
120130
121131
check-config:
122132
name: check-config (${{ matrix.project.path }})

0 commit comments

Comments
 (0)