Skip to content

Commit 2423a97

Browse files
cgrindelclaude
andcommitted
fix: add missing --force-exclusion flag to standardrb linter
Address code review findings: - Add --force-exclusion flag in standardrb_action() to honor exclusions from .standard.yml even when explicit files are passed - Add --force-exclusion flag in JSON output action for consistency - Update Gemfile to use ~> version constraint for standard gem to match RuboCop pattern and prevent breaking changes This ensures Standard Ruby respects exclusion patterns defined in configuration files, matching the behavior of the RuboCop implementation. 🤖 Generated with Claude Code Co-Authored-By: Claude <[email protected]>
1 parent 5323e09 commit 2423a97

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

example/Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
source 'https://rubygems.org'
44

55
gem 'rubocop', '~> 1.50'
6-
gem 'standard', '>= 1.35.1'
6+
gem 'standard', '~> 1.35'

example/Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ PLATFORMS
5858

5959
DEPENDENCIES
6060
rubocop (~> 1.50)
61-
standard (>= 1.35.1)
61+
standard (~> 1.35)
6262

6363
BUNDLED WITH
6464
2.6.9

lint/standardrb.bzl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,10 @@ def standardrb_action(
146146
# Force format to simple for human-readable output
147147
args.add("--format", "simple")
148148

149+
# Honor exclusions in .standard.yml even though we pass explicit list of
150+
# files
151+
args.add("--force-exclusion")
152+
149153
# Disable caching as Bazel handles caching at the action level
150154
args.add("--cache", "false")
151155

@@ -292,6 +296,10 @@ def _standardrb_aspect_impl(target, ctx):
292296
# Use JSON format for machine-readable output (converted to SARIF)
293297
json_args.add("--format", "json")
294298

299+
# Honor exclusions in .standard.yml even though we pass explicit list of
300+
# files
301+
json_args.add("--force-exclusion")
302+
295303
# Disable caching as Bazel handles caching at the action level
296304
json_args.add("--cache", "false")
297305
json_args.add_all(files_to_lint)

0 commit comments

Comments
 (0)