chore: Add diff-only RuboCop wrapper script (WA-VERIFY-029)#1010
Open
kitcommerce wants to merge 2 commits intonextfrom
Open
chore: Add diff-only RuboCop wrapper script (WA-VERIFY-029)#1010kitcommerce wants to merge 2 commits intonextfrom
kitcommerce wants to merge 2 commits intonextfrom
Conversation
Contributor
Author
|
Build gate failed — ShellCheck SC2001
echo "$CHANGED_FILES" | sed 's/^/ /'ShellCheck SC2001 (style): Use Fix: Replace the printf '%s\n' "$CHANGED_FILES" | while IFS= read -r line; do printf ' %s\n' "$line"; done
# OR simply:
echo "${CHANGED_FILES//$'\n'/$'\n '}"Or the simplest fix — use Please push a fix to the branch. |
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.
Summary
Adds
script/rubocop_diff, a lightweight shell script that runs RuboCop only on the Ruby/Rails files changed versus a configurable base ref. This avoids the cost of linting the entire codebase during local development and CI pre-checks.Features
origin/next; overridable via first positional argument or$RUBOCOP_DIFF_BASEenv var.git diff --name-only --diff-filter=ACMRrestricted to*.rb,*.rake, and*.rufiles.No Ruby changes detectedand exits 0.cdto repo root so it works from any working directory.script/conventions (shebang,set -euo pipefail, header comment block).Usage
Verification
Confirm FAIL on known offense
Confirm PASS after fixing offense
Confirm no-op when no Ruby files changed
Closes #871