Fix Style/DirectiveScope offense failing the RuboCop build - #752
Merged
Conversation
anakinj
force-pushed
the
fix/rubocop-directive-scope
branch
from
September 2, 2026 13:52
151cf06 to
ec22feb
Compare
RuboCop's Style/DirectiveScope cop, added in a recent release and picked up automatically via `NewCops: enable`, flags a disable/enable pair that wraps exactly one statement. The pair around `module SecurityUtils` is such a case, so main has been failing the RuboCop build since 2026-08-28 without any code change (the same commit passed on 2026-08-21). Use the statement-scoped `disable-next` form instead. The suppression still covers the whole module, as the module definition is the single statement the directive applies to.
anakinj
force-pushed
the
fix/rubocop-directive-scope
branch
from
September 2, 2026 13:53
ec22feb to
95f4843
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.
Description
mainhas been failing the RuboCop build since 2026-08-28 with no code change behind it. The scheduled runs on the same commita2cb2723show the flip:RuboCop's
Style/DirectiveScopecop was added in a recent release and is picked up automatically throughNewCops: enable. It flags adisable/enablepair that wraps exactly one statement, which is the case for the pair aroundmodule SecurityUtilsinlib/jwt/jwa/hmac.rb:This switches to the statement-scoped
disable-nextform and drops the closingenable. The suppression still covers the whole module, since the module definition is the single statement the directive applies to.Comment-only change; no behaviour is affected.
Checklist
Before the PR can be merged be sure the following are checked: