chore: lowercase non-exported shell variables#3513
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR standardizes shell-script variable naming by reserving uppercase for exported/environment variables and shifting internal/computed globals to lowercase, aligning global naming with the convention already used for function-local variables.
Changes:
- Renamed non-exported global variables to lowercase across multiple shell scripts (scripts/, runner/, templates, and testnet helpers).
- Promoted fixed-value constants to
readonlyuppercase (e.g., GHC/Cabal pins; TRUE/FALSE display symbols). - Added early assertions for required environment variables (e.g.,
WORKDIR,REPODIR) in sourced runner helpers to fail fast when misconfigured.
Reviewed changes
Copilot reviewed 27 out of 27 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| testnets_bootstrap_template/postgres-setup.sh | Lowercase internal path/db name variables while keeping PG* env exports. |
| testnets_bootstrap_template/faucet_setup.sh | Lowercase internal address variable used for faucet funding/query. |
| scripts/update_node_bins.sh | Lowercase internal repo/build/bin directory variables passed to build/link helper. |
| scripts/test_rollbacks.sh | Lowercase computed repo top dir used to run regression script. |
| scripts/test_node_reconnect.sh | Lowercase computed repo top dir used to run regression script. |
| scripts/test_node_ipc_shutdown.sh | Lowercase internal bootstrap dir variable for running IPC shutdown test. |
| scripts/test_block_production.sh | Lowercase computed repo top dir used to run regression script. |
| scripts/setup_test_env.sh | Lowercase internal cwd/repodir variables while preserving exported WORKDIR. |
| scripts/restart_dev_cluster.sh | Lowercase internal top dir and cluster state path variables. |
| scripts/reinstall_editable.sh | Lowercase internal top dir/repo path variables while preserving behavior. |
| scripts/postgres-start.sh | Lowercase internal argument/state variables and update usage/error messages accordingly. |
| scripts/postgres-start-nix.sh | Lowercase internal script_dir variable used to exec postgres-start.sh. |
| scripts/deploy_doc.sh | Lowercase internal top dir/doc source directory variables. |
| scripts/check_dev_env.sh | Promote TRUE/FALSE symbols to readonly uppercase; lowercase internal status variables. |
| scripts/build_and_link_node_bins.sh | Lowercase internal repo/build/bin directory variables and related messaging. |
| scripts/analyze_failures.sh | Lowercase internal run_dir/script_dir/repo_root variables; keep {RUN_DIR} placeholder substitution. |
| runner/source_dbsync.sh | Add required WORKDIR/REPODIR assertions; lowercase internal tar filename variable. |
| runner/source_cardano_node.sh | Add required WORKDIR assertion in functions that depend on it. |
| runner/source_cardano_cli.sh | Add required WORKDIR assertion in functions that depend on it. |
| runner/setup_venv.sh | Lowercase internal top dir/reqs-installed tracking variables; keep cleanup/unset behavior. |
| runner/runc.sh | Lowercase non-exported globals (container selection/mount arrays), keep readonly exported REPO_DIR. |
| runner/run_tests.sh | Lowercase computed argv arrays; make CLEANUP/RUN_SKIPS readonly after initialization. |
| runner/regression.sh | Make REPODIR readonly; lowercase lock/monitor PID variables while preserving semantics. |
| runner/node_upgrade_pytest.sh | Lowercase internal state/config variables; make STEP1_BIN readonly; update paths accordingly. |
| cardano_node_tests/cluster_scripts/testnets/dbsync_block_no.sh | Lowercase internal socket/state/db variables used for dbsync block query. |
| cabal_build_tests/run.sh | Lowercase distro/tag variables used for container build/run. |
| cabal_build_tests/install-node.sh | Make version pins readonly; lowercase internal computed version/hash variables. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Reserve uppercase for exported and environment variables; rename internal/computed globals to lowercase across the shell scripts to match the convention already used for function-local variables. Promote fixed-value constants to readonly uppercase: the GHC and Cabal version pins in install-node.sh and the TRUE/FALSE display symbols in check_dev_env.sh.
cff432c to
dfd0b76
Compare
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.
Reserve uppercase for exported and environment variables; rename internal/computed globals to lowercase across the shell scripts to match the convention already used for function-local variables.
Promote fixed-value constants to readonly uppercase: the GHC and Cabal version pins in install-node.sh and the TRUE/FALSE display symbols in check_dev_env.sh.