Skip to content
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

📌 Loosen RuboCop dep requirements #63

Open
wants to merge 21 commits into
base: main
Choose a base branch
from

Conversation

pboling
Copy link
Contributor

@pboling pboling commented Nov 7, 2024

It is great to use this gem in tandem with standard, but when they get out of sync it is painful. It isn't clear why the patch restriction is useful (aside fromrubocop not following semantic versioning, while claiming it does). In practice it is not useful to me, as I constrain rubocop separately, so I've removed it. I don't expect this to get merged, but would like to understand the thinking behind the constraints. Maybe it would be useful to add them as comments to the gemspec.

Copy link
Contributor

@rzane rzane left a comment

Choose a reason for hiding this comment

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

domain lgtm
platform lgtm

@pboling
Copy link
Contributor Author

pboling commented Dec 4, 2024

If this is a desired change, should I work on fixing the test suite in GA?

@pboling
Copy link
Contributor Author

pboling commented Dec 20, 2024

⭕ What is the release cadence for betterlint? If the gem restrictions remain locked down to patch level as they are, and the gem is not released frequently, I'll have to stop using it in my projects, because the rest of the Ruby world is moving forward and this gem is now a blocker on several fronts, but most annoyingly on rubocop-rails and standard.

CC @rzane @lindan-betterment

P.S. the voluminous deprecation warnings are also a significant bother: #66

betterlint.gemspec Outdated Show resolved Hide resolved
@pboling pboling requested a review from smudge December 20, 2024 19:32
@pboling
Copy link
Contributor Author

pboling commented Dec 20, 2024

@smudge Needs another workflow run approval?

@pboling pboling requested a review from rzane December 20, 2024 21:42
Comment on lines 25 to 30
- ruby: "truffleruby-head"
appraisal: "rails-8-0"
taskname: "spec"
gemfile: "appraisal_root"
rubygems: latest
bundler: latest
Copy link
Member

Choose a reason for hiding this comment

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

We've been operating largely as an MRI-only shop. Not rejecting this outright, but I'd be interested in the motivation for including it in a separate heads matrix.

For now, I'd be inclined to defer this to a separate PR/discussion, and consolidate MRI head down into tests.yml (if building against head is even an active goal here).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Building against head is just a canary, an early warning about upcoming technical debt when you discover things will potentially break in the next Ruby release, once it is released.

IMO it is most useful as a discrete workflow because it should be allowed to fail, and while GitHub doesn't have a proper "allow failures" feature, they should, and they will.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll remove the truffleruby-head. I add it to my open source gems whenever I can because I like to support it.

Copy link
Contributor Author

@pboling pboling Dec 20, 2024

Choose a reason for hiding this comment

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

By the way, this churn getting the CI to work is because your setup is different from the type I usually run (I always add development dependencies to the gemspec, in violation of the default RuboCop rule, because it simplifies things for me...) I'll have it working shortly.

Error: The `RSpec/Capybara/FeatureMethods` cop has been removed since this cop has migrated to `RSpec/Dialect`. Please use `RSpec/Dialect` instead.
(obsolete configuration found in config/default.yml, please update it)
`RSpec/Capybara/*` has been extracted to the `rubocop-capybara` gem.
(obsolete configuration found in config/default.yml, please update it)
Error: unrecognized cop or department FactoryBot/AssociationStyle found in config/default.yml
unrecognized cop or department FactoryBot/ConsistentParenthesesStyle found in config/default.yml
unrecognized cop or department FactoryBot/SyntaxMethods found in config/default.yml
Comment on lines 33 to 34
s.add_dependency "rubocop-capybara", "~> 2.21"
s.add_dependency "rubocop-factory_bot", "~> 2.26"
Copy link
Member

Choose a reason for hiding this comment

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

I'd be interested in adding rubocop-capybara and rubocop-factory_bot in an independent PR as well. I'm not sure if they were intentionally excluded, but baking them into our in-house preferences would merit at least a separate set of sign-offs, and I'd like to keep the path clear for you to merge this PR sooner.

Copy link
Contributor Author

@pboling pboling Dec 21, 2024

Choose a reason for hiding this comment

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

There are rules in the default config which make it impossible to run without them. It seems they are currently accidental undeclared dependencies. I only added them because I was forced to.

Errors were:

Error: The `RSpec/Capybara/FeatureMethods` cop has been removed since this cop has migrated to `RSpec/Dialect`. Please use `RSpec/Dialect` instead.
(obsolete configuration found in config/default.yml, please update it)
`RSpec/Capybara/*` has been extracted to the `rubocop-capybara` gem.
(obsolete configuration found in config/default.yml, please update it)

and

Error: unrecognized cop or department FactoryBot/AssociationStyle found in config/default.yml
unrecognized cop or department FactoryBot/ConsistentParenthesesStyle found in config/default.yml
unrecognized cop or department FactoryBot/SyntaxMethods found in config/default.yml

AFACT, if they are removed, then the rules in the default config must be removed as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually, I did remove the Capybara rule it complained about, because the replacement suggestion didn't make much sense to me, saying both RSpec/Dialect, and rubocop-capybara, which don't sound related.

But since it had been there it was clear that rubocop-capybara was intended to be a dependency. I don't mind removing it, as I don't think there are any rules remaining that relate to it.

The factory-bot rules are still in the config though, so I think the gem is still required.

Copy link
Contributor Author

@pboling pboling Dec 21, 2024

Choose a reason for hiding this comment

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

The GitHub Actions workflows are now passing! This is ready for review.

I removed rubocop-capybara, but not rubocop-factory_bot, since the build won't pass without it (see comments above).

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.

3 participants