Skip to content

Conversation

@fatkodima
Copy link
Contributor

Fixes #1478.

end

def offense_range(nodes)
range_between(nodes[1].source_range.begin_pos, nodes[0].source_range.end_pos)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case, doing it this way also allows you to remove include RangeHelp on L20, making it simpler.

Suggested change
range_between(nodes[1].source_range.begin_pos, nodes[0].source_range.end_pos)
nodes[1].source_range.begin.join(nodes[0].source_range.end)

class EnvLocal < Base
extend AutoCorrector
extend TargetRailsVersion
include RangeHelp
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updating L89 allows this line to be removed.

Suggested change
include RangeHelp

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, updated

@fatkodima fatkodima force-pushed the fix-false-negative-for-env_local branch from 426069a to 8fcb712 Compare July 12, 2025 17:28
@koic koic merged commit 40a1512 into rubocop:master Jul 14, 2025
16 checks passed
@koic
Copy link
Member

koic commented Jul 14, 2025

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing case for Rails/EnvLocal

2 participants