Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lint GitHub Actions and Dependabot #126002

Merged
merged 7 commits into from
Oct 28, 2024
Merged

Conversation

hugovk
Copy link
Member

@hugovk hugovk commented Oct 26, 2024

Extra linting

Add extra linting of GitHub Actions and Dependabot config files.

check-dependabot and check-github-workflows don't currently have any warnings.

actionlint has lots. Here are all the warnings without fixes or ignores:

Details
.github/workflows/reusable-wasi.yml:46:7: shellcheck reported issue in this script: SC2086:info:1:38: Double quote to prevent globbing and word splitting [shellcheck]
   |
46 |       run: echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
   |       ^~~~
.github/workflows/reusable-change-detection.yml:66:7: shellcheck reported issue in this script: SC2086:info:2:28: Double quote to prevent globbing and word splitting [shellcheck]
   |
66 |       run: |
   |       ^~~~
.github/workflows/reusable-change-detection.yml:66:7: shellcheck reported issue in this script: SC2086:info:4:20: Double quote to prevent globbing and word splitting [shellcheck]
   |
66 |       run: |
   |       ^~~~
.github/workflows/reusable-change-detection.yml:66:7: shellcheck reported issue in this script: SC2086:info:18:31: Double quote to prevent globbing and word splitting [shellcheck]
   |
66 |       run: |
   |       ^~~~
.github/workflows/reusable-change-detection.yml:66:7: shellcheck reported issue in this script: SC2015:info:18:143: Note that A && B || C is not if-then-else. C may run when A is true [shellcheck]
   |
66 |       run: |
   |       ^~~~
.github/workflows/reusable-change-detection.yml:66:7: shellcheck reported issue in this script: SC2086:info:18:171: Double quote to prevent globbing and word splitting [shellcheck]
   |
66 |       run: |
   |       ^~~~
.github/workflows/reusable-change-detection.yml:66:7: shellcheck reported issue in this script: SC2086:info:23:6: Double quote to prevent globbing and word splitting [shellcheck]
   |
66 |       run: |
   |       ^~~~
.github/workflows/reusable-change-detection.yml:66:7: shellcheck reported issue in this script: SC2091:warning:24:4: Remove surrounding $() to avoid executing output (or use eval if intentional) [shellcheck]
   |
66 |       run: |
   |       ^~~~
.github/workflows/reusable-change-detection.yml:66:7: shellcheck reported issue in this script: SC2086:info:26:34: Double quote to prevent globbing and word splitting [shellcheck]
   |
66 |       run: |
   |       ^~~~
.github/workflows/reusable-change-detection.yml:66:7: shellcheck reported issue in this script: SC2086:info:29:33: Double quote to prevent globbing and word splitting [shellcheck]
   |
66 |       run: |
   |       ^~~~
.github/workflows/reusable-change-detection.yml:66:7: shellcheck reported issue in this script: SC2086:info:37:72: Double quote to prevent globbing and word splitting [shellcheck]
   |
66 |       run: |
   |       ^~~~
.github/workflows/reusable-change-detection.yml:66:7: shellcheck reported issue in this script: SC2086:info:41:29: Double quote to prevent globbing and word splitting [shellcheck]
   |
66 |       run: |
   |       ^~~~
.github/workflows/reusable-change-detection.yml:66:7: shellcheck reported issue in this script: SC2086:info:44:30: Double quote to prevent globbing and word splitting [shellcheck]
   |
66 |       run: |
   |       ^~~~
.github/workflows/reusable-change-detection.yml:114:7: shellcheck reported issue in this script: SC2086:info:1:93: Double quote to prevent globbing and word splitting [shellcheck]
    |
114 |       run: |
    |       ^~~~
.github/workflows/reusable-ubuntu.yml:36:7: shellcheck reported issue in this script: SC2129:style:1:1: Consider using { cmd1; cmd2; } >> file instead of individual redirects [shellcheck]
   |
36 |       run: |
   |       ^~~~
.github/workflows/reusable-ubuntu.yml:36:7: shellcheck reported issue in this script: SC2086:info:1:53: Double quote to prevent globbing and word splitting [shellcheck]
   |
36 |       run: |
   |       ^~~~
.github/workflows/reusable-ubuntu.yml:36:7: shellcheck reported issue in this script: SC2086:info:2:75: Double quote to prevent globbing and word splitting [shellcheck]
   |
36 |       run: |
   |       ^~~~
.github/workflows/reusable-ubuntu.yml:36:7: shellcheck reported issue in this script: SC2086:info:3:83: Double quote to prevent globbing and word splitting [shellcheck]
   |
36 |       run: |
   |       ^~~~
.github/workflows/reusable-ubuntu.yml:48:7: shellcheck reported issue in this script: SC2086:info:1:69: Double quote to prevent globbing and word splitting [shellcheck]
   |
48 |       run: python3 Tools/ssl/multissltests.py --steps=library --base-directory $MULTISSL_DIR --openssl $OPENSSL_VER --system Linux
   |       ^~~~
.github/workflows/reusable-ubuntu.yml:48:7: shellcheck reported issue in this script: SC2086:info:1:93: Double quote to prevent globbing and word splitting [shellcheck]
   |
48 |       run: python3 Tools/ssl/multissltests.py --steps=library --base-directory $MULTISSL_DIR --openssl $OPENSSL_VER --system Linux
   |       ^~~~
.github/workflows/reusable-ubuntu.yml:50:7: shellcheck reported issue in this script: SC2086:info:1:38: Double quote to prevent globbing and word splitting [shellcheck]
   |
50 |       run: |
   |       ^~~~
.github/workflows/reusable-ubuntu.yml:58:7: shellcheck reported issue in this script: SC2086:info:1:39: Double quote to prevent globbing and word splitting [shellcheck]
   |
58 |       run: |
   |       ^~~~
.github/workflows/reusable-ubuntu.yml:58:7: shellcheck reported issue in this script: SC2086:info:1:85: Double quote to prevent globbing and word splitting [shellcheck]
   |
58 |       run: |
   |       ^~~~
.github/workflows/reusable-ubuntu.yml:58:7: shellcheck reported issue in this script: SC2086:info:2:38: Double quote to prevent globbing and word splitting [shellcheck]
   |
58 |       run: |
   |       ^~~~
.github/workflows/reusable-ubuntu.yml:58:7: shellcheck reported issue in this script: SC2086:info:2:83: Double quote to prevent globbing and word splitting [shellcheck]
   |
58 |       run: |
   |       ^~~~
.github/workflows/reusable-ubuntu.yml:62:7: shellcheck reported issue in this script: SC2086:info:1:10: Double quote to prevent globbing and word splitting [shellcheck]
   |
62 |       run: mkdir -p $CPYTHON_RO_SRCDIR $CPYTHON_BUILDDIR
   |       ^~~~
.github/workflows/reusable-ubuntu.yml:62:7: shellcheck reported issue in this script: SC2086:info:1:29: Double quote to prevent globbing and word splitting [shellcheck]
   |
62 |       run: mkdir -p $CPYTHON_RO_SRCDIR $CPYTHON_BUILDDIR
   |       ^~~~
.github/workflows/reusable-ubuntu.yml:64:7: shellcheck reported issue in this script: SC2086:info:1:25: Double quote to prevent globbing and word splitting [shellcheck]
   |
64 |       run: sudo mount --bind -o ro $GITHUB_WORKSPACE $CPYTHON_RO_SRCDIR
   |       ^~~~
.github/workflows/reusable-ubuntu.yml:64:7: shellcheck reported issue in this script: SC2086:info:1:43: Double quote to prevent globbing and word splitting [shellcheck]
   |
64 |       run: sudo mount --bind -o ro $GITHUB_WORKSPACE $CPYTHON_RO_SRCDIR
   |       ^~~~
.github/workflows/reusable-ubuntu.yml:66:7: shellcheck reported issue in this script: SC2086:info:1:41: Double quote to prevent globbing and word splitting [shellcheck]
   |
66 |       run: echo "IMAGE_VERSION=${ImageVersion}" >> $GITHUB_ENV
   |       ^~~~
.github/workflows/reusable-ubuntu.yml:74:7: shellcheck reported issue in this script: SC2086:info:1:116: Double quote to prevent globbing and word splitting [shellcheck]
   |
74 |       run: >-
   |       ^~~~
.github/workflows/reusable-ubuntu.yml:74:153: 1st argument of function call is not assignable. "bool" cannot be assigned to "string". called function type is "fromJSON(string) -> any" [expression]
.github/workflows/reusable-ubuntu.yml:95:7: shellcheck reported issue in this script: SC2086:info:1:148: Double quote to prevent globbing and word splitting [shellcheck]
   |
95 |       run: >-
   |       ^~~~
.github/workflows/reusable-ubuntu.yml:105:7: shellcheck reported issue in this script: SC2086:info:1:12: Double quote to prevent globbing and word splitting [shellcheck]
    |
105 |       run: sudo mount $CPYTHON_RO_SRCDIR -oremount,rw
    |       ^~~~
.github/workflows/reusable-tsan.yml:29:7: shellcheck reported issue in this script: SC2086:info:1:41: Double quote to prevent globbing and word splitting [shellcheck]
   |
29 |       run: echo "IMAGE_VERSION=${ImageVersion}" >> $GITHUB_ENV
   |       ^~~~
.github/workflows/reusable-tsan.yml:49:7: shellcheck reported issue in this script: SC2129:style:1:1: Consider using { cmd1; cmd2; } >> file instead of individual redirects [shellcheck]
   |
49 |       run: |
   |       ^~~~
.github/workflows/reusable-tsan.yml:49:7: shellcheck reported issue in this script: SC2086:info:1:141: Double quote to prevent globbing and word splitting [shellcheck]
   |
49 |       run: |
   |       ^~~~
.github/workflows/reusable-tsan.yml:49:7: shellcheck reported issue in this script: SC2086:info:2:20: Double quote to prevent globbing and word splitting [shellcheck]
   |
49 |       run: |
   |       ^~~~
.github/workflows/reusable-tsan.yml:49:7: shellcheck reported issue in this script: SC2086:info:3:23: Double quote to prevent globbing and word splitting [shellcheck]
   |
49 |       run: |
   |       ^~~~
.github/workflows/reusable-tsan.yml:54:7: shellcheck reported issue in this script: SC2086:info:1:38: Double quote to prevent globbing and word splitting [shellcheck]
   |
54 |       run: |
   |       ^~~~
.github/workflows/reusable-tsan.yml:71:7: shellcheck reported issue in this script: SC2038:warning:1:1: Use 'find .. -print0 | xargs -0 ..' or 'find .. -exec .. +' to allow non-alphanumeric filenames [shellcheck]
   |
71 |       run: find ${GITHUB_WORKSPACE} -name 'tsan_log.*' | xargs head -n 1000
   |       ^~~~
.github/workflows/reusable-tsan.yml:71:7: shellcheck reported issue in this script: SC2086:info:1:6: Double quote to prevent globbing and word splitting [shellcheck]
   |
71 |       run: find ${GITHUB_WORKSPACE} -name 'tsan_log.*' | xargs head -n 1000
   |       ^~~~
.github/workflows/reusable-macos.yml:33:7: shellcheck reported issue in this script: SC2086:info:1:41: Double quote to prevent globbing and word splitting [shellcheck]
   |
33 |       run: echo "IMAGE_VERSION=${ImageVersion}" >> $GITHUB_ENV
   |       ^~~~
.github/workflows/build.yml:62:9: shellcheck reported issue in this script: SC2086:info:1:41: Double quote to prevent globbing and word splitting [shellcheck]
   |
62 |         run: echo "IMAGE_VERSION=${ImageVersion}" >> $GITHUB_ENV
   |         ^~~~
.github/workflows/build.yml:101:9: shellcheck reported issue in this script: SC2086:info:1:41: Double quote to prevent globbing and word splitting [shellcheck]
    |
101 |         run: echo "IMAGE_VERSION=${ImageVersion}" >> $GITHUB_ENV
    |         ^~~~
.github/workflows/build.yml:111:9: shellcheck reported issue in this script: SC2086:info:1:38: Double quote to prevent globbing and word splitting [shellcheck]
    |
111 |         run: echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
    |         ^~~~
.github/workflows/build.yml:147:32: 1st argument of function call is not assignable. "bool" cannot be assigned to "string". called function type is "fromJSON(string) -> any" [expression]
.github/workflows/build.yml:182:30: 1st argument of function call is not assignable. "bool" cannot be assigned to "string". called function type is "fromJSON(string) -> any" [expression]
.github/workflows/build.yml:216:31: 1st argument of function call is not assignable. "bool" cannot be assigned to "string". called function type is "fromJSON(string) -> any" [expression]
.github/workflows/build.yml:250:7: shellcheck reported issue in this script: SC2086:info:1:41: Double quote to prevent globbing and word splitting [shellcheck]
    |
250 |       run: echo "IMAGE_VERSION=${ImageVersion}" >> $GITHUB_ENV
    |       ^~~~
.github/workflows/build.yml:261:7: shellcheck reported issue in this script: SC2129:style:1:1: Consider using { cmd1; cmd2; } >> file instead of individual redirects [shellcheck]
    |
261 |       run: |
    |       ^~~~
.github/workflows/build.yml:261:7: shellcheck reported issue in this script: SC2086:info:1:53: Double quote to prevent globbing and word splitting [shellcheck]
    |
261 |       run: |
    |       ^~~~
.github/workflows/build.yml:261:7: shellcheck reported issue in this script: SC2086:info:2:75: Double quote to prevent globbing and word splitting [shellcheck]
    |
261 |       run: |
    |       ^~~~
.github/workflows/build.yml:261:7: shellcheck reported issue in this script: SC2086:info:3:83: Double quote to prevent globbing and word splitting [shellcheck]
    |
261 |       run: |
    |       ^~~~
.github/workflows/build.yml:273:7: shellcheck reported issue in this script: SC2086:info:1:69: Double quote to prevent globbing and word splitting [shellcheck]
    |
273 |       run: python3 Tools/ssl/multissltests.py --steps=library --base-directory $MULTISSL_DIR --openssl $OPENSSL_VER --system Linux
    |       ^~~~
.github/workflows/build.yml:273:7: shellcheck reported issue in this script: SC2086:info:1:93: Double quote to prevent globbing and word splitting [shellcheck]
    |
273 |       run: python3 Tools/ssl/multissltests.py --steps=library --base-directory $MULTISSL_DIR --openssl $OPENSSL_VER --system Linux
    |       ^~~~
.github/workflows/build.yml:275:7: shellcheck reported issue in this script: SC2086:info:1:38: Double quote to prevent globbing and word splitting [shellcheck]
    |
275 |       run: |
    |       ^~~~
.github/workflows/build.yml:282:7: shellcheck reported issue in this script: SC2086:info:1:116: Double quote to prevent globbing and word splitting [shellcheck]
    |
282 |       run: ./configure CFLAGS="-fdiagnostics-format=json" --config-cache --enable-slower-safety --with-pydebug --with-openssl=$OPENSSL_DIR
    |       ^~~~
.github/workflows/build.yml:314:7: shellcheck reported issue in this script: SC2129:style:1:1: Consider using { cmd1; cmd2; } >> file instead of individual redirects [shellcheck]
    |
314 |       run: |
    |       ^~~~
.github/workflows/build.yml:314:7: shellcheck reported issue in this script: SC2086:info:1:53: Double quote to prevent globbing and word splitting [shellcheck]
    |
314 |       run: |
    |       ^~~~
.github/workflows/build.yml:314:7: shellcheck reported issue in this script: SC2086:info:2:75: Double quote to prevent globbing and word splitting [shellcheck]
    |
314 |       run: |
    |       ^~~~
.github/workflows/build.yml:314:7: shellcheck reported issue in this script: SC2086:info:3:83: Double quote to prevent globbing and word splitting [shellcheck]
    |
314 |       run: |
    |       ^~~~
.github/workflows/build.yml:326:7: shellcheck reported issue in this script: SC2086:info:1:69: Double quote to prevent globbing and word splitting [shellcheck]
    |
326 |       run: python3 Tools/ssl/multissltests.py --steps=library --base-directory $MULTISSL_DIR --openssl $OPENSSL_VER --system Linux
    |       ^~~~
.github/workflows/build.yml:326:7: shellcheck reported issue in this script: SC2086:info:1:93: Double quote to prevent globbing and word splitting [shellcheck]
    |
326 |       run: python3 Tools/ssl/multissltests.py --steps=library --base-directory $MULTISSL_DIR --openssl $OPENSSL_VER --system Linux
    |       ^~~~
.github/workflows/build.yml:328:7: shellcheck reported issue in this script: SC2086:info:1:38: Double quote to prevent globbing and word splitting [shellcheck]
    |
328 |       run: |
    |       ^~~~
.github/workflows/build.yml:335:7: shellcheck reported issue in this script: SC2086:info:1:39: Double quote to prevent globbing and word splitting [shellcheck]
    |
335 |       run: |
    |       ^~~~
.github/workflows/build.yml:335:7: shellcheck reported issue in this script: SC2086:info:1:85: Double quote to prevent globbing and word splitting [shellcheck]
    |
335 |       run: |
    |       ^~~~
.github/workflows/build.yml:335:7: shellcheck reported issue in this script: SC2086:info:2:38: Double quote to prevent globbing and word splitting [shellcheck]
    |
335 |       run: |
    |       ^~~~
.github/workflows/build.yml:335:7: shellcheck reported issue in this script: SC2086:info:2:83: Double quote to prevent globbing and word splitting [shellcheck]
    |
335 |       run: |
    |       ^~~~
.github/workflows/build.yml:339:7: shellcheck reported issue in this script: SC2086:info:1:10: Double quote to prevent globbing and word splitting [shellcheck]
    |
339 |       run: mkdir -p $CPYTHON_RO_SRCDIR $CPYTHON_BUILDDIR
    |       ^~~~
.github/workflows/build.yml:339:7: shellcheck reported issue in this script: SC2086:info:1:29: Double quote to prevent globbing and word splitting [shellcheck]
    |
339 |       run: mkdir -p $CPYTHON_RO_SRCDIR $CPYTHON_BUILDDIR
    |       ^~~~
.github/workflows/build.yml:341:7: shellcheck reported issue in this script: SC2086:info:1:25: Double quote to prevent globbing and word splitting [shellcheck]
    |
341 |       run: sudo mount --bind -o ro $GITHUB_WORKSPACE $CPYTHON_RO_SRCDIR
    |       ^~~~
.github/workflows/build.yml:341:7: shellcheck reported issue in this script: SC2086:info:1:43: Double quote to prevent globbing and word splitting [shellcheck]
    |
341 |       run: sudo mount --bind -o ro $GITHUB_WORKSPACE $CPYTHON_RO_SRCDIR
    |       ^~~~
.github/workflows/build.yml:343:7: shellcheck reported issue in this script: SC2086:info:1:41: Double quote to prevent globbing and word splitting [shellcheck]
    |
343 |       run: echo "IMAGE_VERSION=${ImageVersion}" >> $GITHUB_ENV
    |       ^~~~
.github/workflows/build.yml:351:7: shellcheck reported issue in this script: SC2086:info:5:18: Double quote to prevent globbing and word splitting [shellcheck]
    |
351 |       run: |
    |       ^~~~
.github/workflows/build.yml:365:7: shellcheck reported issue in this script: SC2086:info:1:12: Double quote to prevent globbing and word splitting [shellcheck]
    |
365 |       run: sudo mount $CPYTHON_RO_SRCDIR -oremount,rw
    |       ^~~~
.github/workflows/build.yml:367:7: shellcheck reported issue in this script: SC2086:info:1:38: Double quote to prevent globbing and word splitting [shellcheck]
    |
367 |       run: |
    |       ^~~~
.github/workflows/build.yml:367:7: shellcheck reported issue in this script: SC2086:info:1:83: Double quote to prevent globbing and word splitting [shellcheck]
    |
367 |       run: |
    |       ^~~~
.github/workflows/build.yml:371:7: shellcheck reported issue in this script: SC2086:info:3:32: Double quote to prevent globbing and word splitting [shellcheck]
    |
371 |       run: |
    |       ^~~~
.github/workflows/build.yml:371:7: shellcheck reported issue in this script: SC2086:info:4:38: Double quote to prevent globbing and word splitting [shellcheck]
    |
371 |       run: |
    |       ^~~~
.github/workflows/build.yml:371:7: shellcheck reported issue in this script: SC2086:info:5:18: Double quote to prevent globbing and word splitting [shellcheck]
    |
371 |       run: |
    |       ^~~~
.github/workflows/build.yml:371:7: shellcheck reported issue in this script: SC2086:info:5:62: Double quote to prevent globbing and word splitting [shellcheck]
    |
371 |       run: |
    |       ^~~~
.github/workflows/build.yml:425:7: shellcheck reported issue in this script: SC2086:info:1:41: Double quote to prevent globbing and word splitting [shellcheck]
    |
425 |       run: echo "IMAGE_VERSION=${ImageVersion}" >> $GITHUB_ENV
    |       ^~~~
.github/workflows/build.yml:440:7: shellcheck reported issue in this script: SC2129:style:1:1: Consider using { cmd1; cmd2; } >> file instead of individual redirects [shellcheck]
    |
440 |       run: |
    |       ^~~~
.github/workflows/build.yml:440:7: shellcheck reported issue in this script: SC2086:info:1:53: Double quote to prevent globbing and word splitting [shellcheck]
    |
440 |       run: |
    |       ^~~~
.github/workflows/build.yml:440:7: shellcheck reported issue in this script: SC2086:info:2:75: Double quote to prevent globbing and word splitting [shellcheck]
    |
440 |       run: |
    |       ^~~~
.github/workflows/build.yml:440:7: shellcheck reported issue in this script: SC2086:info:3:83: Double quote to prevent globbing and word splitting [shellcheck]
    |
440 |       run: |
    |       ^~~~
.github/workflows/build.yml:449:18: property "os" is not defined in object type {} [expression]
    |
449 |         key: ${{ matrix.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
    |                  ^~~~~~~~~
.github/workflows/build.yml:452:7: shellcheck reported issue in this script: SC2086:info:1:69: Double quote to prevent globbing and word splitting [shellcheck]
    |
452 |       run: python3 Tools/ssl/multissltests.py --steps=library --base-directory $MULTISSL_DIR --openssl $OPENSSL_VER --system Linux
    |       ^~~~
.github/workflows/build.yml:452:7: shellcheck reported issue in this script: SC2086:info:1:93: Double quote to prevent globbing and word splitting [shellcheck]
    |
452 |       run: python3 Tools/ssl/multissltests.py --steps=library --base-directory $MULTISSL_DIR --openssl $OPENSSL_VER --system Linux
    |       ^~~~
.github/workflows/build.yml:454:7: shellcheck reported issue in this script: SC2086:info:1:38: Double quote to prevent globbing and word splitting [shellcheck]
    |
454 |       run: |
    |       ^~~~
.github/workflows/reusable-windows.yml:33:76: 1st argument of function call is not assignable. "bool" cannot be assigned to "string". called function type is "fromJSON(string) -> any" [expression]
.github/workflows/reusable-windows.yml:43:80: 1st argument of function call is not assignable. "bool" cannot be assigned to "string". called function type is "fromJSON(string) -> any" [expression]
.github/workflows/jit.yml:136:9: shellcheck reported issue in this script: SC2155:warning:2:8: Declare and assign separately to avoid masking return values [shellcheck]
    |
136 |         run: |
    |         ^~~~
.github/workflows/jit.yml:146:9: shellcheck reported issue in this script: SC2155:warning:2:8: Declare and assign separately to avoid masking return values [shellcheck]
    |
146 |         run: |
    |         ^~~~
.github/workflows/jit.yml:146:9: shellcheck reported issue in this script: SC2097:warning:11:1: This assignment is only seen by the forked process [shellcheck]
    |
146 |         run: |
    |         ^~~~
.github/workflows/jit.yml:146:9: shellcheck reported issue in this script: SC2098:warning:12:8: This expansion will not see the mentioned assignment [shellcheck]
    |
146 |         run: |
    |         ^~~~
.github/workflows/jit.yml:174:9: shellcheck reported issue in this script: SC2155:warning:2:8: Declare and assign separately to avoid masking return values [shellcheck]
    |
174 |         run: |
    |         ^~~~

Fix warnings

This PR fixes .github/workflows/build.yml:449:18: property "os" is not defined in object type {} [expression], which is a bug, and would have helped for #125786.

This also fixes SC2086: Double quote to prevent globbing and word splitting, but this could potentially be ignored too.

I ignored all the rest, these can be tackled at another time if someone is motivated and they look worthwhile:

Details
.github/workflows/reusable-change-detection.yml:66:7: shellcheck reported issue in this script: SC2015:info:18:145: Note that A && B || C is not if-then-else. C may run when A is true [shellcheck]
   |
66 |       run: |
   |       ^~~~
.github/workflows/reusable-change-detection.yml:66:7: shellcheck reported issue in this script: SC2091:warning:24:4: Remove surrounding $() to avoid executing output (or use eval if intentional) [shellcheck]
   |
66 |       run: |
   |       ^~~~
.github/workflows/reusable-ubuntu.yml:36:7: shellcheck reported issue in this script: SC2129:style:1:1: Consider using { cmd1; cmd2; } >> file instead of individual redirects [shellcheck]
   |
36 |       run: |
   |       ^~~~
.github/workflows/reusable-ubuntu.yml:74:155: 1st argument of function call is not assignable. "bool" cannot be assigned to "string". called function type is "fromJSON(string) -> any" [expression]
.github/workflows/reusable-tsan.yml:49:7: shellcheck reported issue in this script: SC2129:style:1:1: Consider using { cmd1; cmd2; } >> file instead of individual redirects [shellcheck]
   |
49 |       run: |
   |       ^~~~
.github/workflows/reusable-tsan.yml:71:7: shellcheck reported issue in this script: SC2038:warning:1:1: Use 'find .. -print0 | xargs -0 ..' or 'find .. -exec .. +' to allow non-alphanumeric filenames [shellcheck]
   |
71 |       run: find "${GITHUB_WORKSPACE}" -name 'tsan_log.*' | xargs head -n 1000
   |       ^~~~
.github/workflows/build.yml:147:32: 1st argument of function call is not assignable. "bool" cannot be assigned to "string". called function type is "fromJSON(string) -> any" [expression]
.github/workflows/build.yml:182:30: 1st argument of function call is not assignable. "bool" cannot be assigned to "string". called function type is "fromJSON(string) -> any" [expression]
.github/workflows/build.yml:216:31: 1st argument of function call is not assignable. "bool" cannot be assigned to "string". called function type is "fromJSON(string) -> any" [expression]
.github/workflows/build.yml:261:7: shellcheck reported issue in this script: SC2129:style:1:1: Consider using { cmd1; cmd2; } >> file instead of individual redirects [shellcheck]
    |
261 |       run: |
    |       ^~~~
.github/workflows/build.yml:314:7: shellcheck reported issue in this script: SC2129:style:1:1: Consider using { cmd1; cmd2; } >> file instead of individual redirects [shellcheck]
    |
314 |       run: |
    |       ^~~~
.github/workflows/build.yml:443:7: shellcheck reported issue in this script: SC2129:style:1:1: Consider using { cmd1; cmd2; } >> file instead of individual redirects [shellcheck]
    |
443 |       run: |
    |       ^~~~
.github/workflows/reusable-windows.yml:33:76: 1st argument of function call is not assignable. "bool" cannot be assigned to "string". called function type is "fromJSON(string) -> any" [expression]
.github/workflows/reusable-windows.yml:43:80: 1st argument of function call is not assignable. "bool" cannot be assigned to "string". called function type is "fromJSON(string) -> any" [expression]
.github/workflows/jit.yml:136:9: shellcheck reported issue in this script: SC2155:warning:2:8: Declare and assign separately to avoid masking return values [shellcheck]
    |
136 |         run: |
    |         ^~~~
.github/workflows/jit.yml:146:9: shellcheck reported issue in this script: SC2155:warning:2:8: Declare and assign separately to avoid masking return values [shellcheck]
    |
146 |         run: |
    |         ^~~~
.github/workflows/jit.yml:146:9: shellcheck reported issue in this script: SC2097:warning:11:1: This assignment is only seen by the forked process [shellcheck]
    |
146 |         run: |
    |         ^~~~
.github/workflows/jit.yml:146:9: shellcheck reported issue in this script: SC2098:warning:12:8: This expansion will not see the mentioned assignment [shellcheck]
    |
146 |         run: |
    |         ^~~~
.github/workflows/jit.yml:174:9: shellcheck reported issue in this script: SC2155:warning:2:8: Declare and assign separately to avoid masking return values [shellcheck]
    |
174 |         run: |
    |         ^~~~

Also let's bump the other pre-commit hooks whilst we're here.

@hugovk hugovk added the infra CI, GitHub Actions, buildbots, Dependabot, etc. label Oct 26, 2024
Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just a few changes I'm not sure about

- name: Setup directory envs for out-of-tree builds
run: |
echo "CPYTHON_BUILDDIR=$(realpath -m ${GITHUB_WORKSPACE}/../cpython-builddir)" >> $GITHUB_ENV
echo "CPYTHON_BUILDDIR=$(realpath -m "${GITHUB_WORKSPACE}"/../cpython-builddir)" >> "$GITHUB_ENV"
Copy link
Member

@AlexWaygood AlexWaygood Oct 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need different quotes here for the nested strings?

Suggested change
echo "CPYTHON_BUILDDIR=$(realpath -m "${GITHUB_WORKSPACE}"/../cpython-builddir)" >> "$GITHUB_ENV"
echo 'CPYTHON_BUILDDIR=$(realpath -m "${GITHUB_WORKSPACE}"/../cpython-builddir)' >> "$GITHUB_ENV"

Or just skip this one, since it's already inside double quotes?

Suggested change
echo "CPYTHON_BUILDDIR=$(realpath -m "${GITHUB_WORKSPACE}"/../cpython-builddir)" >> "$GITHUB_ENV"
echo "CPYTHON_BUILDDIR=$(realpath -m ${GITHUB_WORKSPACE}/../cpython-builddir)" >> "$GITHUB_ENV"

Copy link
Member Author

@hugovk hugovk Oct 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's this warning:

367 |       run: |
    |       ^~~~
.github/workflows/build.yml:367:7: shellcheck reported issue in this script: SC2086:info:1:83: Double quote to prevent globbing and word splitting [shellcheck]

Looking up the code: https://www.shellcheck.net/wiki/SC2086

This applies:

Note that $( ) starts a new context, and variables in it have to be quoted independently:

echo "This $variable is quoted $(but this $variable is not)"
echo "This $variable is quoted $(and now this "$variable" is too)"

Or just skip this one, since it's already inside double quotes?

That would trigger this:

.github/workflows/build.yml:367:7: shellcheck reported issue in this script: SC2016:info:1:6: Expressions don't expand in single quotes, use double quotes for that [shellcheck]
    |
367 |       run: |
    |       ^~~~

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh. It looks strange to me, but I'll trust you that this is the right thing to do!

- name: Configure ccache action
uses: hendrikmuhs/[email protected]
with:
save: ${{ github.event_name == 'push' }}
max-size: "200M"
- name: Setup directory envs for out-of-tree builds
run: |
echo "CPYTHON_RO_SRCDIR=$(realpath -m ${GITHUB_WORKSPACE}/../cpython-ro-srcdir)" >> $GITHUB_ENV
echo "CPYTHON_BUILDDIR=$(realpath -m ${GITHUB_WORKSPACE}/../cpython-builddir)" >> $GITHUB_ENV
echo "CPYTHON_RO_SRCDIR=$(realpath -m "${GITHUB_WORKSPACE}"/../cpython-ro-srcdir)" >> "$GITHUB_ENV"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same question as above for this and the following line

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same answer :)

timeout-minutes: 60
needs: check_source
if: needs.check_source.outputs.run_tests == 'true'
strategy:
matrix:
os: [ubuntu-22.04]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change itself looks ok, but I was wondering if it was just for consistency or if there is another reason.

Copy link
Member

@AlexWaygood AlexWaygood Oct 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's because on main the matrix.os variable here is currently undefined:

key: ${{ matrix.os }}-multissl-openssl-${{ env.OPENSSL_VER }}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's right.

This was added in #124403, where we replaced ${{ runner.os }} (which evaluates to Linux) with ${{ matrix.os }} (which evaluates to ubuntu-22.04), so the cache would be cleared when we update to 24.04.

In that PR, you can see we added os: to the top one, but forgot for the bottom one (and we didn't have a linter).

See also #123699 (comment) for more background, cc @zware.

Copy link
Member

@zware zware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly, I find the variable quoting to be nitpicky noise since nearly all of the variables in question are guaranteed not to include spaces, but it's technically more correct so 🤷‍♂️

Thanks for catching the matrix that I missed :)

@hugovk
Copy link
Member Author

hugovk commented Oct 26, 2024

Honestly, I find the variable quoting to be nitpicky noise since nearly all of the variables in question are guaranteed not to include spaces, but it's technically more correct so 🤷‍♂️

Yeah, I'm more than happy to remove that commit.

I guess it's only technically correct for this stuff:

Quoting variables prevents word splitting and glob expansion, and prevents the script from breaking when input contains spaces, line feeds, glob characters and such.

And if we don't have stuff like that we don't need to quote.

We don't necessarily need a lint rule that requires all being quoted, if the cost is too nitpicky or noisy.

Thanks for catching the matrix that I missed :)

You're welcome, I also missed it in review :)

@hugovk hugovk enabled auto-merge (squash) October 28, 2024 18:32
@hugovk hugovk merged commit e1190c0 into python:main Oct 28, 2024
37 checks passed
@hugovk hugovk deleted the lint-github-actions branch October 31, 2024 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
infra CI, GitHub Actions, buildbots, Dependabot, etc. skip issue skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants