Skip to content

Conversation

@larouxn
Copy link
Contributor

@larouxn larouxn commented Feb 7, 2026

Description

Modernizes and generally simplifies our RuboCop usage via the following:

  • migrate from require to plugins
  • remove explicit new cops in favour of NewCops: enable
  • remove version boundaries from rubocop-packaging and rubocop-performance gems
  • add and enable rubocop-rake gem
  • auto-correct (safe only) a bunch of offenses
  • manually correct "useless private scoping of constant" offences
  • regen .rubocop_todo.yml to add remaining few complex offences
Screenshot From 2026-02-07 18-29-52 As a future improvement we could consider adding the `rubocop-rspec` gem. image

Todos

List any remaining work that needs to be done, i.e:

None if CI looks good. Passed locally.

Additional Notes

Local testing and RuboCop, for reference.

Screenshot From 2026-02-07 18-38-54 Screenshot From 2026-02-07 18-39-04

@olleolleolle
Copy link
Member

olleolleolle commented Feb 8, 2026

This is not me blocking a merge, but this change means we are taking on following the changes in RuboCop henceforth.

@larouxn
Copy link
Contributor Author

larouxn commented Feb 8, 2026

That is true, with the addition NewCops: enable. Granted we can always disable new cops as they are added if we find they don't make sense for faraday. Probably easier to do that than maintain a list of manually enabled cops. 🤔

- migrate from `require` to `plugins`
- remove explicit new cops in favour of `NewCops: enable`
- remove version boundaries from `rubocop-packaging` and `rubocop-performance` gems
- add and enable `rubocop-rake` gem
- auto-correct (safe only) a bunch of offenses
- manually correct "useless private scoping of constant" offences
- regen `.rubocop_todo.yml` to add remaining few complex offences
Copy link
Member

@olleolleolle olleolleolle left a comment

Choose a reason for hiding this comment

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

I guess we can take this step.

# Used to detect missing arguments
NO_ARGUMENT = Object.new

LOCK_ERR = "can't modify middleware stack after making a request"
Copy link
Member

Choose a reason for hiding this comment

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

Minor:

Perhaps these constants were intended to be private constants, and their placement in the private section was just a... foiled attempt at that.

Perhaps making them private_constant would be useless, and that since they've been exposed as visible API for a long while, it's de facto our current public API.

So, with those thoughts, I recommend this move.

@olleolleolle olleolleolle merged commit c6988a8 into lostisland:main Feb 9, 2026
9 checks passed
@larouxn larouxn deleted the modernize_rubocop branch February 9, 2026 15:43
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.

2 participants