Skip to content

Commit d28f313

Browse files
isidorelexler
andcommitted
. e add Bash script style guide and simplify github_issue.sh
Added concise Bash script style guide for future reference. Simplified github_issue.sh to match new style: robust shebang, minimal validation, and direct logic. Co-Authored-By: Lada Kesseler <23501754+lexler@users.noreply.github.com>
1 parent 1b7a777 commit d28f313

5 files changed

Lines changed: 25 additions & 4 deletions

File tree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Bash Script Style Process
2+
3+
- Use `#!/usr/bin/env bash` as shebang.
4+
- Always use `set -euxo pipefail` for safety and debugging.
5+
- Keep scripts minimal: no unnecessary comments or echoes.
6+
- Only do minimal input validation; print a usage message to stderr and exit if inputs are missing or invalid.
7+
- Do not check for installed commands if failure will be obvious on use.
8+
- Make script executable: `chmod +x <script>`.
9+
- Prefer concise, direct logic over verbosity.

.windsurf/FixingIssues.process.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ When fixing a bug reported in an issue or pull request:
55
If you don't have the URL of the issue or pull request, ask for it.
66

77
1. **Understand the Bug**:
8-
* Thoroughly read the issue/PR description and any related comments to understand the problem, expected behavior, and actual behavior.
9-
* If necessary, use tools like `read_url_content` to fetch details directly from GitHub.
8+
* Read the pull request via the github cli: `gh issue view <number> --json body` to understand the problem, expected behavior, and actual behavior.
109

1110
2. **Write a Failing Test**:
1211
* Create a new test case or modify an existing one in the relevant test suite (e.g., `approvaltests-tests` or `approvaltests-util-tests`).

.windsurf/UnitTestStyleGuide.process.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
# Unit Test Style Guide
22

3+
**ALWAYS** start your response with `` followed by a space when replying to me.
4+
35
## Refactoring
46

57
**NEVER** add new test cases while refactoring existing tests.
68

79
**ALWAYS** prefer self documenting code and smaller functions to comments.
810

9-
## Approvals vs Asserts
1011

11-
* Preferable tests over multiple asserts.
12+
## ApprovalTests vs Asserts
13+
14+
* Preferable ApprovalTests over multiple asserts.
1215
* Use toStrings and Printers. If the toString on an object is good, use it. If not, create a printing function either in the test or in production code and use that.
1316

1417
### Dates, GUIDS and other non-deterministic values

.windsurf/rules/running_scripts.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ Sample:
4444
| Lars | LarsEckart |
4545
| Jay | JayBazuzi |
4646
| Scott | ScottBob |
47+
| Lada | lexler |
4748

4849
Co-authors go 1 per line at the bottom of the message,
4950
in the format:

.windsurf/scripts/github_issue.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env bash
2+
set -euxo pipefail
3+
4+
if [ $# -ne 1 ]; then
5+
echo "Usage: $0 <issue_number>" >&2
6+
exit 1
7+
fi
8+
9+
gh issue view "$1" --json body

0 commit comments

Comments
 (0)