[PR #1572] [MERGED] Apply shellcheck to all vscodium shell scripts #1764

Closed
opened 2025-09-10 23:54:56 -05:00 by giteasync · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/VSCodium/vscodium/pull/1572
Author: @zpiatt
Created: 7/21/2023
Status: Merged
Merged: 7/21/2023
Merged by: @daiyam

Base: masterHead: shellcheck-applied-01


📝 Commits (2)

  • 3be84ac apply shellcheck; standardize style
  • 512cfc8 make requested changes; update api curl

📊 Changes

14 files changed (+84 additions, -79 deletions)

View changed files

📝 build/build.sh (+7 -3)
📝 build/build_docker.sh (+6 -3)
📝 build/linux/appimage/build.sh (+4 -4)
📝 build/update_api.sh (+11 -8)
📝 build/update_patches.sh (+10 -10)
📝 build/windows/msi/build-updates-disabled.sh (+3 -4)
📝 build/windows/msi/build.sh (+1 -3)
📝 build/windows/rtf/make.sh (+1 -1)
📝 icons/build_icons.sh (+32 -34)
📝 stores/snapcraft/check_version.sh (+4 -4)
📝 stores/winget/check_version.sh (+1 -1)
📝 update_version.sh (+1 -1)
📝 utils.sh (+2 -2)
📝 version.sh (+1 -1)

📄 Description

All shell scripts within the VSCodium repository's now pass shellcheck.

  1. Fixed glob used in command name ( https://github.com/VSCodium/vscodium/issues/1570 ).
  2. Fixed typo causing logical error piping into true ( https://github.com/VSCodium/vscodium/issues/1570 ).
  3. Fixed options specified in getopts but not handled by case statement https://www.shellcheck.net/wiki/SC2213
  4. Handled invalid flags ( with implied continue ) in case statements ( https://www.shellcheck.net/wiki/SC2220 ).
  5. Read error codes directly (style) ( https://www.shellcheck.net/wiki/SC2181 ).
  6. Fixed all instances of reading/writing files in same pipeline (https://www.shellcheck.net/wiki/SC2094).
  7. Removed legacy back-ticks ( used $( command ) with spaces) (https://www.shellcheck.net/wiki/SC2006).
  8. Removed useless cat (https://www.shellcheck.net/wiki/SC2002).
  9. Added -r to read commands (https://www.shellcheck.net/wiki/SC2162).

Special shellcheck considerations:

  1. shellcheck recommends many style changes for both readability and consistency ( both subjective ). Where applicable I've ignored these messages to conform with the style preference of the project. One example is: https://www.shellcheck.net/wiki/SC2129
  2. shellcheck notes when it is unable to follow variables or files when sourced. When applicable, I ignored this message (https://www.shellcheck.net/wiki/SC1091) with a directive (https://github.com/koalaman/shellcheck/wiki/directive).
  3. I believe the shellcheck disable messages are a value add, because they cut down on the noise when searching for actual errors.

Other small changes:

  1. I standardized all > /dev/null 2>&1 to simply &> /dev/null. I found it both ways and chose the latter.
  2. I standardized newlines in if statements and for loops.
  3. I standardized all shebangs with #!/usr/bin/env bash.
  4. I standardized all tests with [[ ]].

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/VSCodium/vscodium/pull/1572 **Author:** [@zpiatt](https://github.com/zpiatt) **Created:** 7/21/2023 **Status:** ✅ Merged **Merged:** 7/21/2023 **Merged by:** [@daiyam](https://github.com/daiyam) **Base:** `master` ← **Head:** `shellcheck-applied-01` --- ### 📝 Commits (2) - [`3be84ac`](https://github.com/VSCodium/vscodium/commit/3be84acaf426ded89c3119f6b279a5cd7fc1e58b) apply shellcheck; standardize style - [`512cfc8`](https://github.com/VSCodium/vscodium/commit/512cfc8683b884c9cb999766b2da1aabea6bcf4d) make requested changes; update api curl ### 📊 Changes **14 files changed** (+84 additions, -79 deletions) <details> <summary>View changed files</summary> 📝 `build/build.sh` (+7 -3) 📝 `build/build_docker.sh` (+6 -3) 📝 `build/linux/appimage/build.sh` (+4 -4) 📝 `build/update_api.sh` (+11 -8) 📝 `build/update_patches.sh` (+10 -10) 📝 `build/windows/msi/build-updates-disabled.sh` (+3 -4) 📝 `build/windows/msi/build.sh` (+1 -3) 📝 `build/windows/rtf/make.sh` (+1 -1) 📝 `icons/build_icons.sh` (+32 -34) 📝 `stores/snapcraft/check_version.sh` (+4 -4) 📝 `stores/winget/check_version.sh` (+1 -1) 📝 `update_version.sh` (+1 -1) 📝 `utils.sh` (+2 -2) 📝 `version.sh` (+1 -1) </details> ### 📄 Description All shell scripts within the `VSCodium` repository's now pass `shellcheck`. 1. Fixed glob used in command name ( [https://github.com/VSCodium/vscodium/issues/1570](https://github.com/VSCodium/vscodium/issues/1570) ). 2. Fixed typo causing logical error piping into `true` ( [https://github.com/VSCodium/vscodium/issues/1570](https://github.com/VSCodium/vscodium/issues/1570) ). 3. Fixed options specified in `getopts` but not handled by case statement [https://www.shellcheck.net/wiki/SC2213](https://www.shellcheck.net/wiki/SC2213) 4. Handled invalid flags ( with implied continue ) in case statements ( [https://www.shellcheck.net/wiki/SC2220](https://www.shellcheck.net/wiki/SC2220) ). 5. Read error codes directly (style) ( [https://www.shellcheck.net/wiki/SC2181](https://www.shellcheck.net/wiki/SC2181) ). 6. Fixed all instances of reading/writing files in same pipeline ([https://www.shellcheck.net/wiki/SC2094](https://www.shellcheck.net/wiki/SC2094)). 8. Removed legacy back-ticks ( used `$( command )` with spaces) ([https://www.shellcheck.net/wiki/SC2006](https://www.shellcheck.net/wiki/SC2006)). 9. Removed useless `cat` ([https://www.shellcheck.net/wiki/SC2002](https://www.shellcheck.net/wiki/SC2002)). 10. Added `-r` to `read` commands ([https://www.shellcheck.net/wiki/SC2162](https://www.shellcheck.net/wiki/SC2162)). Special `shellcheck` considerations: 1. `shellcheck` recommends many style changes for both readability and consistency ( both subjective ). Where applicable I've ignored these messages to conform with the style preference of the project. One example is: [https://www.shellcheck.net/wiki/SC2129](https://www.shellcheck.net/wiki/SC2129) 2. `shellcheck` notes when it is unable to follow variables or files when sourced. When applicable, I ignored this message ([https://www.shellcheck.net/wiki/SC1091](https://www.shellcheck.net/wiki/SC1091)) with a directive ([https://github.com/koalaman/shellcheck/wiki/directive](https://github.com/koalaman/shellcheck/wiki/directive)). 3. I believe the `shellcheck` disable messages are a value add, because they cut down on the noise when searching for actual errors. Other small changes: 1. I standardized all `> /dev/null 2>&1` to simply `&> /dev/null`. I found it both ways and chose the latter. 2. I standardized newlines in `if` statements and `for` loops. 3. I standardized all shebangs with `#!/usr/bin/env bash`. 4. I standardized all tests with `[[ ]]`. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
giteasync added the pull-request label 2025-09-10 23:54:56 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: VSCodium/vscodium#1764