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

Add support more Capybara debugger entry points for Lint/Debugger #12820

Merged
merged 1 commit into from
Apr 6, 2024

Conversation

ydah
Copy link
Member

@ydah ydah commented Apr 5, 2024

This PR makes add support more Capybara debugger entry points for Lint/Debugger


Before submitting the PR make sure the following are checked:

  • The PR relates to only one subject with a clear title and description in grammatically correct, complete sentences.
  • Wrote good commit messages.
  • Commit message starts with [Fix #issue-number] (if the related issue exists).
  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • Added tests.
  • Ran bundle exec rake default. It executes all tests and runs RuboCop on its own code.
  • Added an entry (file) to the changelog folder named {change_type}_{change_description}.md if the new code introduces user-observable changes. See changelog entry format for details.

@ydah ydah force-pushed the support-more-debugger-entry-point branch 2 times, most recently from e3e8049 to 8e4e56e Compare April 5, 2024 14:19
This PR makes add support more Capybara debugger entry points for `Lint/Debugger`

- page.save_and_open_page
- page.save_and_open_screenshot
- page.save_page
- page.save_screenshot
- save_page
- save_screenshot
@ydah ydah force-pushed the support-more-debugger-entry-point branch from 8e4e56e to 5e74991 Compare April 5, 2024 14:23
@ydah
Copy link
Member Author

ydah commented Apr 5, 2024

One thing that bothers me is that I think one of the future improvements would be to create a cop in rubocop-capybara to detect the debugger entry point for capybara and remove the entry point for capybara from rubocop. I don't have a particularly strong opinion, but the benefit of extracting to rubocop-capybara is that Lint/Debugger doesn't allow you to specify the path to exclude for each entry point type, and this cop check is enabled by default even if you're not using Capybara. However, since method names are quite distinctive, the same method name might not be defined and there might not be many false positives. WDYT?

@koic
Copy link
Member

koic commented Apr 6, 2024

One thing that bothers me is that I think one of the future improvements would be to create a cop in rubocop-capybara to detect the debugger entry point for capybara and remove the entry point for capybara from rubocop

I generally agree. However, instead of creating a new Cop for RuboCop Capybara, it might be smarter to move the Lint/Debugger configuration specifically for Capybara to RuboCop Capybara. The following RuboCop Rails's PR may serve as a reference:
rubocop/rubocop-rails#1097

@bbatsov
Copy link
Collaborator

bbatsov commented Apr 6, 2024

As there's already some Capybara config in RuboCop I think it's fine to merge the configuration changes. We can discuss separately injection of configuration from plugins, as that's a broader topic.

@koic koic merged commit 8720332 into rubocop:master Apr 6, 2024
34 checks passed
@koic
Copy link
Member

koic commented Apr 6, 2024

Thanks!

@ydah ydah deleted the support-more-debugger-entry-point branch April 6, 2024 16:50
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.

None yet

3 participants