Improve Bash guideline wording#135
Merged
Merged
Conversation
Up to standards ✅🟢 Issues
|
There was a problem hiding this comment.
Pull request overview
This pull request refines the Bash style guide’s wording and examples (style + error-handling guidance), and records the changes in the changelog for a new dated release entry.
Changes:
- Clarifies wording in quoting guidance and
localvariable scope rationale. - Refines error-handling examples (clearer messaging,
trapcleanup structure, and added explanatory comments). - Adds a
2026.6.9release entry and updates changelog reference links accordingly.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| docs/guidelines/style.md | Wording tweaks for quoting guidance and local variable scope rationale. |
| docs/guidelines/error-handling.md | Improves error-handling examples/messages and refines trap + cleanup function example. |
| CHANGELOG.md | Adds the 2026.6.9 release entry and updates reference links. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - **Naming Convention**: Use `snake_case` for variable names. | ||
| - **Scope Management**: Use the `local` keyword to limit a variable's scope to a function. | ||
| - **Reason**: Declaring a variable as `local` prevents accidental overwrites of global variables with the same name. It also ensures that once the function completes, the variable is unset and released from memory. (1) | ||
| - **Reason**: Declaring a variable as `local` prevents accidental overwrites to global variables with the same name. It also ensures that once the function completes, the variable is unset and released from memory. (1) |
Comment on lines
34
to
+35
| - **Guideline**: When a command fails, provide a clear error message that explains what went wrong. | ||
| - **Reason**: Clear error messages help users, including yourself, understand what failed and why, making troubleshooting easier. | ||
| - **Reason**: Error messages help users, including yourself, understand what failed and why, making troubleshooting easier. |
Comment on lines
+128
to
+132
| echo "[INFO] Cleaning up..." | ||
| rm "$TMP_FILE" || { | ||
| echo "[ERROR] Failed to remove temporary file" >&2 | ||
| echo "[NOTE] Please remove it manually: '$TMP_FILE'" >&2 | ||
| } |
Comment on lines
+28
to
+29
| - **TODO**: Update guideline review tracking for `Aesthetics`, `Bash Idioms`, | ||
| `Error Handling`, and `Style`, and remove an outdated wording-review example. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request updates the style guide with improvements to the Bash idioms section, error handling, and general style guidelines. It also updates the changelog for a new release and makes minor improvements to CI workflow references and documentation clarity.
Guideline and documentation improvements:
Bashismssection toBash Idioms, reframed it to focus on Bash-specific patterns, and expanded the rationale to discuss safety, clarity, performance, consistency, and POSIX portability tradeoffs.forandwhileloops with better wording and terminology.trap, and better variable handling in cleanup functions. [1] [2] [3] [4] [5]localkeyword. [1] [2]Changelog and CI updates:
2026.6.9) toCHANGELOG.mdand updated release links. [1] [2]actions/checkoutandastral-sh/setup-uvin CI workflows.