What changed, and why it matters
This commit adds a code-style linter to the project's continuous integration (CI) pipeline and makes two small supporting changes: it tells the shell linter to ignore a specific quoting warning in build scripts, and it adds a parameter to a test helper function with a note explaining it is used by a currently disabled test. There is no security-relevant code change here.
No security action required. Treat as normal CI/test hygiene improvement.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff adds a new GitHub Actions job named ‘lint’ that builds a Docker image from ci/lint_imagefile and runs the bitcoin-linter container against the repository. In ci/test/03_test_script.sh, two shellcheck disable=SC2086 comments are added around unquoted variable expansions of BITCOIN_CONFIG_ALL and CMAKE_GENERATOR so the linter does not flag intentional word-splitting of configure/CMake flags. In test/functional/test_framework/blocktools.py, a retarget_period parameter is added to create_coinbase with a noqa comment indicating it is used by a disabled mining_mainnet.py test. None of these changes alter runtime behavior of the Elements node or wallet.
Changed components
.github/workflows/ci.ymlci/test/03_test_script.shtest/functional/test_framework/blocktools.pyInspect captured patch +17 / −3
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 8883596..cb4fc8f 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -312,3 +312,15 @@ jobs:
path: ${{ env.CCACHE_DIR }}
# https://github.com/actions/cache/blob/main/tips-and-workarounds.md#update-a-cache
key: ${{ github.job }}-ccache-${{ github.run_id }}
+
+ lint:
+ name: 'lint'
+ runs-on: ubuntu-24.04
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+ - name: Build lint Docker image
+ run: DOCKER_BUILDKIT=1 docker build -t bitcoin-linter --file "./ci/lint_imagefile" ./
+ - name: Run linter
+ run: docker run --rm -v $(pwd):/bitcoin bitcoin-linter
\ No newline at end of file
diff --git a/ci/test/03_test_script.sh b/ci/test/03_test_script.sh
index fd19889..0d9482d 100755
--- a/ci/test/03_test_script.sh
+++ b/ci/test/03_test_script.sh
@@ -124,11 +124,13 @@ fi
# === CMake build (modern path used by the fork) ===
if [ -n "$NO_DEPENDS" ]; then
echo "Building with CMake (NO_DEPENDS=1)..."
- cmake -B build -S . ${CMAKE_GENERATOR:+-G "$CMAKE_GENERATOR"} "$BITCOIN_CONFIG_ALL"
+ # shellcheck disable=SC2086
+ cmake -B build -S . ${CMAKE_GENERATOR:+-G "$CMAKE_GENERATOR"} $BITCOIN_CONFIG_ALL
else
# depends path (still uses configure in some jobs)
./autogen.sh
- ./configure "$BITCOIN_CONFIG_ALL"
+ # shellcheck disable=SC2086
+ ./configure $BITCOIN_CONFIG_ALL
fi
cmake --build build --config Release --parallel "$MAKEJOBS"
diff --git a/test/functional/test_framework/blocktools.py b/test/functional/test_framework/blocktools.py
index 2917c14..5c21f6f 100755
--- a/test/functional/test_framework/blocktools.py
+++ b/test/functional/test_framework/blocktools.py
@@ -161,7 +161,7 @@ def script_BIP34_coinbase_height(height):
return CScript([CScriptNum(height)])
-def create_coinbase(height, pubkey=None, *, script_pubkey=None, extra_output_script=None, fees=0, nValue=50):
+def create_coinbase(height, pubkey=None, *, script_pubkey=None, extra_output_script=None, fees=0, nValue=50, retarget_period=REGTEST_RETARGET_PERIOD): # noqa: unused - used by mining_mainnet.py currently disabled
"""Create a coinbase transaction.
If pubkey is passed in, the coinbase output will be a P2PK output;
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.