-
Notifications
You must be signed in to change notification settings - Fork 5
refactor(quality): replace blanket ShellCheck disables with targeted per-file disables (t135.2) #492
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(quality): replace blanket ShellCheck disables with targeted per-file disables (t135.2) #492
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| #!/usr/bin/env bash | ||
| # shellcheck disable=SC2034,SC2155,SC2317,SC2329,SC2016,SC2181,SC1091,SC2154,SC2015,SC2086,SC2129,SC2030,SC2031,SC2119,SC2120,SC2001,SC2162,SC2088,SC2089,SC2090,SC2029,SC2006,SC2153 | ||
| # shellcheck disable=SC1091,SC2034,SC2154,SC2155,SC2162,SC2181,SC2317 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# First, check if the file exists and read the relevant sections
if [ -f ".agents/scripts/git-platforms-helper.sh" ]; then
echo "=== Lines 1-10 of git-platforms-helper.sh ==="
head -10 ".agents/scripts/git-platforms-helper.sh" | cat -n
echo ""
echo "=== File size ==="
wc -l ".agents/scripts/git-platforms-helper.sh"
else
echo "File not found"
fiRepository: marcusquinn/aidevops Length of output: 582 🏁 Script executed: #!/bin/bash
# Search for SC2181 violations - checking $? instead of direct command evaluation
echo "=== SC2181 pattern: checking \$? in conditionals ==="
rg '\$\?' .agents/scripts/git-platforms-helper.sh -n | head -20
echo ""
echo "=== SC2317 pattern: code after return ==="
rg -A2 'return [0-9]' .agents/scripts/git-platforms-helper.sh -n | grep -E '^\s+[a-z]|return' | head -30Repository: marcusquinn/aidevops Length of output: 827 🏁 Script executed: #!/bin/bash
# Check for the disable directive on line 2
echo "=== Line 2 content (the disable directive) ==="
sed -n '2p' .agents/scripts/git-platforms-helper.sh
echo ""
echo "=== Count disabled rules ==="
sed -n '2p' .agents/scripts/git-platforms-helper.sh | grep -oP 'SC\d+' | wc -lRepository: marcusquinn/aidevops Length of output: 212 🏁 Script executed: #!/bin/bash
# Look for duplicate constants mentioned in review
echo "=== Checking for duplicate HELP_SHOW_MESSAGE ==="
rg 'HELP_SHOW_MESSAGE=' .agents/scripts/git-platforms-helper.sh -n
echo ""
echo "=== Checking for duplicate USAGE_COMMAND_OPTIONS ==="
rg 'USAGE_COMMAND_OPTIONS=' .agents/scripts/git-platforms-helper.sh -nRepository: marcusquinn/aidevops Length of output: 392 🏁 Script executed: #!/bin/bash
# Check main() function structure around lines 519-540
echo "=== Lines 519-540 (main function area) ==="
sed -n '519,540p' .agents/scripts/git-platforms-helper.sh | cat -nRepository: marcusquinn/aidevops Length of output: 1048 Remove ShellCheck disables and fix the underlying issues instead of suppressing them—the script has critical execution bugs. The targeted disable approach violates the zero-violations requirement. Verification confirms these suppressions mask real, fixable bugs:
These issues are not ShellCheck false positives—they are runtime correctness bugs that must be fixed to meet the zero-technical-debt standard. 🤖 Prompt for AI Agents |
||
| set -euo pipefail | ||
|
|
||
| # Git Platforms Helper Script | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SC2317 (unreachable code) is masking real bugs — don't suppress it, fix the root cause.
SC2317 fires because
check_statusandlist_appshave misplacedreturn 0statements that make subsequent code unreachable. Suppressing this warning hides functional bugs rather than silencing a false positive. See comments below on lines 175–188 and 150–153.🤖 Prompt for AI Agents