Skip to content

Commit 875a654

Browse files
committed
docs: add technical docstrings and harden pr-check-test-files.sh
Signed-off-by: Dominiq Barbero <[email protected]>
1 parent 7f35aef commit 875a654

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

.github/scripts/pr-check-test-files.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,40 @@
11
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
# ======================================================================================================================================================
5+
# @file: pr-check-test-files.sh
6+
#
7+
# @Description A CI check written in bash that enforces the '_test.py' suffix to ensure Pytest can automatically discover
8+
# new or renamed test files in a Pull Request.
9+
#
10+
# @logic:
11+
# 1. Identifies files as (A) Added, (R) Renamed, or (C) Copied using 'git diff' to check destination filename ($file2).
12+
# 2. Validates paths against allowed test directories (unit/integration).
13+
# 3. Excludes specific utility (ex., conftest.py, utils.py) and non-Python files.
14+
# 4. Parses tab-separated Git output via IFS=$'\t' to ensure robust filename handling.
15+
# 5. Routes files using case statement based on git status
16+
#
17+
# @types:
18+
# - String: Used for file paths and git status codes.
19+
# - Array: Used for 'TEST_DIRS', 'EXCEPTION_NAMES', and accumulating errors.
20+
#
21+
# @Parameters:
22+
# - None: This script does not accept CLI arguments. It derives the input from the current Git state compared against origin/main.
23+
#
24+
# @Dependencies:
25+
# - Git: (for diff)
26+
# - Bash: (runs the script)
27+
# - Pytest: (naming standard)
28+
#
29+
# @Permissions:
30+
# - Requires Execute permissions (chmod +x) to run. Also needs Read access to the git repository to perform the diff.
31+
#
32+
# @Return
33+
# - 0: All test files follow the naming standard.
34+
# - 1: Exits with status 1 and outputs error messages in red.
35+
# Includes a yellow instructional block providing reason why the file failed.
36+
# ======================================================================================================================================================
37+
238
RED="\033[31m"
339
YELLOW="\033[33m"
440
RESET="\033[0m"

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ This changelog is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.
8080
- Added merge conflict bot workflow (`.github/workflows/bot-merge-conflict.yml`) and helper script (`.github/scripts/bot-merge-conflict.js`) to detect and notify about PR merge conflicts, with retry logic for unknown mergeable states, idempotent commenting, and push-to-main recheck logic (#1247)
8181
- Added workflow to prevent assigning intermediate issues to contributors without prior Good First Issue completion (#1143).
8282
- Added `Client.from_env()` and network-specific factory methods (e.g., `Client.for_testnet()`) to simplify client initialization and reduce boilerplate. [[#1251](https://github.com/hiero-ledger/hiero-sdk-python/issues/1251)]
83+
- Improved unit test coverage for `TransactionId` class, covering parsing logic, hashing, and scheduled transactions.
84+
- Chained Good First Issue assignment with mentor assignment to bypass GitHub's anti-recursion protection - mentor assignment now occurs immediately after successful user assignment in the same workflow execution. (#1369)
85+
- Add GitHub Actions script and workflow for automatic spam list updates.
86+
- Added technical docstrings and hardening (set -euo pipefail) to the pr-check-test-files.sh script
8387

8488
### Changed
8589

0 commit comments

Comments
 (0)