Skip to content

Ruby Version Detection #714

@apainintheneck

Description

@apainintheneck

I've found some unexpected behavior with automatic Ruby version detection when using standard with my project.

The docs say that the Ruby version is inferred from any .ruby-version, .tool-versions, Gemfile.lock, and *.gemspec files that might be present (reference) which makes me think that I don't need to specify it explicitly since there is a gemspec for project.

The most recent upgrade from standard 1.47.0 to 1.49.0 caused the linter to fail on Ruby 3.4 with these errors while succeeding on previous Ruby versions.

lib/rfc_reader/command.rb:99:38: Style/ItBlockParameter: Use `it` block parameter.
lib/rfc_reader/command.rb:101:34: Style/ItBlockParameter: Use `it` block parameter.
lib/rfc_reader/error_context.rb:53:18: Style/ItBlockParameter: Use `it` block parameter.
lib/rfc_reader/search.rb:88:22: Style/ItBlockParameter: Use `it` block parameter.
lib/rfc_reader/search.rb:89:23: Style/ItBlockParameter: Use `it` block parameter.

I'm assuming that the problem here is that it's detecting Ruby 3.4 for some reason and basing the rules on that Ruby version instead of using the minimum Ruby version defined in the gemspec.

It's not obvious to me if this is intended behavior, a bug in rubocop or a bug in standard but I figured that I'd open an issue here first to see if you had any ideas.

Also, I did try setting the Ruby version explicitly by creating a .standard.yml file with ruby_version: 3.0 and then it worked as expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions