-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Centralize Ruby Version to .ruby-version
#345
Conversation
@@ -2,7 +2,6 @@ inherit_gem: | |||
rubocop-shopify: rubocop.yml | |||
|
|||
AllCops: | |||
TargetRubyVersion: 2.7 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to bump Rubocop to 1.61.0 in order for this to work https://github.com/Shopify/erb-lint/blob/main/Gemfile.lock#L78
I think we can also remove the ruby version here https://github.com/Shopify/erb-lint/blob/main/.github/workflows/linting.yml#L12 since GA will read from |
The `.ruby-version` file is the ecosystem standard for defining a Ruby version. This PR adds the `.ruby-version` file, ensures a `required_ruby_version` is set, and removes all other references to Ruby in this repository, aligning it with the standard. > [!IMPORTANT] > Please verify the following before merging: Verify that the changes in the PR meets the following requirements or adjust manually to make it compliant: - [ ] `.ruby-version` file is present with the correct Ruby version defined - [ ] A `required_ruby_version` in your gemspec is set - [ ] There is no Ruby version present in the `dev.yml` Ruby task (before: `- ruby: x.x.x`, after: `- ruby`) - [ ] There is no Ruby version/requirement referenced in the `Gemfile` (no lines with `ruby <some-version>`) - [ ] A `Gemfile.lock` is built with the defined Ruby version - [ ] The version of Rubocop installed is 1.61.0 or greater - [ ] There is no `TargetRubyVersion` defined in `rubocop.yml` - [ ] There is no Ruby argument present in `ruby/setup-ruby` Github Actions that do **not** run on a Ruby matrix (no lines with `ruby-version: “x.x”`) This PR will be merged if there isn't any activity after 4 weeks.
Old versions of rubocop read the ruby version from .ruby-version first. We made the change upstream which is not captured in versions of rubocop (< 0.87). Upstream commit: rubocop/rubocop@02b2c3a Co-authored-by: Étienne Barrié <etienne.barrie@shopify.com>
ecfebbf
to
6af65c5
Compare
51386f8
to
844dc6f
Compare
Ignore the .intersect? autocorrect
844dc6f
to
aee9cbe
Compare
55df99e
to
0881563
Compare
309ff45
to
e919ba5
Compare
What are you trying to accomplish?
The
.ruby-version
file is the ecosystem standard for defining a Ruby version. This PR adds the.ruby-version
file, ensures arequired_ruby_version
is set, and removes all other references to Ruby in this repository, aligning it with the standard.What should reviewers focus on?
Important
Please verify the following before merging:
Verify that the changes in the PR meets the following requirements or adjust manually to make it compliant:
.ruby-version
file is present with the correct Ruby version definedrequired_ruby_version
in your gemspec is setdev.yml
Ruby task (before:- ruby: x.x.x
, after:- ruby
)Gemfile
(no lines withruby <some-version>
)Gemfile.lock
is built with the defined Ruby versionTargetRubyVersion
defined inrubocop.yml
ruby/setup-ruby
Github Actions that do not run on a Ruby matrix (no lines withruby-version: “x.x”
)This PR will be merged if there isn't any activity after 4 weeks.