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: https://github.com/rubocop/rubocop-rails/commit/5180fa2c25cef467eececd9c80739f7cad6adbbf (i.e. adding rubocop-capybara to its own .rubocop.yml file.
Before submitting the PR make sure the following are checked:
[x] Feature branch is up-to-date with main (if not - rebase it).
[x] Squashed related commits together.
[x] Added tests.
[ ] Updated documentation.
[x] 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).
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: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: https://github.com/rubocop/rubocop-rails/commit/5180fa2c25cef467eececd9c80739f7cad6adbbf (i.e. adding
rubocop-capybara
to its own.rubocop.yml
file.Before submitting the PR make sure the following are checked:
main
(if not - rebase it).CHANGELOG.md
if the new code introduces user-observable changes.bundle exec rake
) passes (be sure to run this locally, since it may produce updated documentation that you will need to commit).