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

Fix an error for Capybara/RSpec/HaveSelector when passing no arguments #129

Merged
merged 1 commit into from
Aug 19, 2024

Conversation

Earlopain
Copy link
Contributor

ruby-lsp constanty runs RuboCop over code while typing, so this error will just happen.

Do note that there are currently 2 RuboCop offenses introduced through new rubocop versions:

Offenses:

lib/rubocop/cop/capybara/rspec/have_selector.rb:82:30: C: InternalAffairs/UndefinedConfig: DefaultSelector is not defined in the configuration for Capybara/RSpec/HaveSelector in config/default.yml.
            cop_config.fetch('DefaultSelector', 'css')
                             ^^^^^^^^^^^^^^^^^
tasks/cut_release.rake:41:21: W: [Correctable] Lint/ImplicitStringConcatenation: Combine '\0' and "## #{version} (#{Time.now.strftime('%F')})\n\n" into a single string literal, rather than using implicit string concatenation. Or, if they were intended to be separate method arguments, separate them with a comma.
                    '\0' "## #{version} (#{Time.now.strftime('%F')})\n\n")

The second one seems pretty straightforward, the other I'm not sure about. It seems fine to me but when the cop is ran the fetched config is just empty. I'm not sure why but a commit similar to this would fix it: rubocop/rubocop-rails@5180fa2 (i.e. adding rubocop-capybara to its own .rubocop.yml file.


Before submitting the PR make sure the following are checked:

  • Feature branch is up-to-date with main (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).

@Earlopain Earlopain requested a review from a team as a code owner August 18, 2024 19:51
@ydah
Copy link
Member

ydah commented Aug 19, 2024

@Earlopain Thank you! Could you rebase latest main branch?

Copy link
Member

@ydah ydah left a comment

Choose a reason for hiding this comment

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

@Earlopain Thank you!

@ydah ydah merged commit d307446 into rubocop:main Aug 19, 2024
25 checks passed
@Earlopain Earlopain deleted the have-selector-error branch August 19, 2024 09:24
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