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

Remove extracted cops in Capybara, FactoryBot and Rails departments. #1848

Merged
merged 1 commit into from
May 3, 2024

Conversation

ydah
Copy link
Member

@ydah ydah commented Mar 29, 2024

This PR remove extracted cop departments. (Capybara, FactoryBot, Rails)


Before submitting the PR make sure the following are checked:

  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • [-] Added tests.
  • Updated documentation.
  • Added an entry to the CHANGELOG.md if the new code introduces user-observable changes.
  • The build (bundle exec rake) passes (be sure to run this locally, since it may produce updated documentation that you will need to commit).

@ydah ydah requested a review from a team as a code owner March 29, 2024 17:12
@ydah ydah added this to the 3.0 milestone Mar 29, 2024
@ydah ydah changed the title Remove extracted cop departments. (Capybara, FactoryBot, Rails) Remove extracted cops in Capybara, FactoryBot and Rails departments. Mar 29, 2024
VersionAdded: '1.18'
VersionChanged: '2.0'
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Capybara/CurrentPathExpectation

RSpec/Capybara/FeatureMethods:
Copy link
Member

Choose a reason for hiding this comment

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

Can we replace featuremethods with RSpec/Dialect configuration?
Would close a bunch of issues, too:
Uploading 01ADFB5F-F2D7-400B-AD48-8D4AEF039F11.jpeg…

Copy link
Collaborator

Choose a reason for hiding this comment

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

Good idea @pirj. I’ve added this as an issue in the 3.0 milestone.

@bquorning
Copy link
Collaborator

@ydah Now that we have a separate 2-x-stable branch, I think we are ready to merge this pull request after the conflicts are fixed.

@ydah
Copy link
Member Author

ydah commented May 3, 2024

I updated this PR.

Copy link
Collaborator

@bquorning bquorning left a comment

Choose a reason for hiding this comment

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

👏🏼

@ydah
Copy link
Member Author

ydah commented May 3, 2024

It is also a blocker for subsequent PR, so this PR will be merged. We can also follow up.

@ydah ydah merged commit b5b8a7f into master May 3, 2024
24 checks passed
@ydah ydah deleted the remove-extracted branch May 3, 2024 11:04
h-lame added a commit to meetcleo/apipie-rails that referenced this pull request Jul 5, 2024
In rubocop/rubocop-rspec#1848 rubocop-rspec extracted
some cops to separate gems, and because we referenced one of them in our
rubocop_todo.yml the whole rubocop process wouldn't run because it doesn't like
config for cops it doesn't know about. We introducing the missing gem,
`rubocop-rspec_rails`, and fix the name in the config to let us run rubocop
again.

There is one infraction that exists in the source so we fix that to get us to a
green rubocop run.
mathieujobin pushed a commit to Apipie/apipie-rails that referenced this pull request Jul 9, 2024
#939)

* Update how we use Rack::Utils to get status codes

As part of rack/rack#2137 (released in Rack 3) Rack
changed the values of `Rack::Utils::SYMBOL_TO_STATUS_CODE` so asking for
`:unprocessable_entity` now returns `nil`. The guidance has always been to use
`Rack::Util.status_code` (present in the API since Rack 1.1) so let's just do
that.

* Handle a missing `rack.input` in the env

Ever since rack/rack#2018 `rack.input` has been
optional so we can't assume it's there and call `read` or `rewind` on it in
`Apipie::Extractor::Recorder`. Using safe navigation to call these methods
seems like the simplest approach because we want to look for
`rack.request.form_hash` instead in both the situation where `rack.input` is
missing, or it's empty.

* Add rubocop-rspec_rails and get rubocop run to green

In rubocop/rubocop-rspec#1848 rubocop-rspec extracted
some cops to separate gems, and because we referenced one of them in our
rubocop_todo.yml the whole rubocop process wouldn't run because it doesn't like
config for cops it doesn't know about. We introducing the missing gem,
`rubocop-rspec_rails`, and fix the name in the config to let us run rubocop
again.

There is one infraction that exists in the source so we fix that to get us to a
green rubocop run.

* Only add rubocop-rspec_rails for ruby >-= 2.7

It's only available for 2.7+ and we still run this build on 2.6.
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