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 wrong debug path inspection escape #68

Conversation

viralpraxis
Copy link
Collaborator

be rubocop -d

configuration from ~/.asdf/installs/ruby/3.3.6/lib/ruby/gems/3.3.0/gems/rubocop-performance-1.23.0/config/default.yml
configuration from ~/.asdf/installs/ruby/3.3.6/lib/ruby/gems/3.3.0/gems/rubocop-performance-1.23.0/config/default.yml
Default configuration from ~/.asdf/installs/ruby/3.3.6/lib/ruby/gems/3.3.0/gems/rubocop-1.69.0/config/default.yml
configuration from ~/.asdf/installs/ruby/3.3.6/lib/ruby/gems/3.3.0/gems/rubocop-rails-2.27.0/config/default.yml
configuration from ~/.asdf/installs/ruby/3.3.6/lib/ruby/gems/3.3.0/gems/rubocop-rails-2.27.0/config/default.yml
configuration from ~/.asdf/installs/ruby/3.3.6/lib/ruby/gems/3.3.0/gems/rubocop-rake-0.6.0/config/default.yml
configuration from ~/.asdf/installs/ruby/3.3.6/lib/ruby/gems/3.3.0/gems/rubocop-rake-0.6.0/config/default.yml
configuration from ~/.asdf/installs/ruby/3.3.6/lib/ruby/gems/3.3.0/gems/rubocop-capybara-2.21.0/config/default.yml
configuration from ~/.asdf/installs/ruby/3.3.6/lib/ruby/gems/3.3.0/gems/rubocop-capybara-2.21.0/lib/../config/default.yml
configuration from ~/.asdf/installs/ruby/3.3.6/lib/ruby/gems/3.3.0/gems/rubocop-factory_bot-2.26.1/config/default.yml
configuration from ~/.asdf/installs/ruby/3.3.6/lib/ruby/gems/3.3.0/gems/rubocop-factory_bot-2.26.1/lib/../config/default.yml
configuration from ~/.asdf/installs/ruby/3.3.6/lib/ruby/gems/3.3.0/gems/rubocop-rspec-3.2.0/config/default.yml
configuration from ~/.asdf/installs/ruby/3.3.6/lib/ruby/gems/3.3.0/gems/rubocop-rspec-3.2.0/config/default.yml
configuration from ~/.asdf/installs/ruby/3.3.6/lib/ruby/gems/3.3.0/gems/rubocop-rspec_rails-2.30.0/config/default.yml
configuration from ~/.asdf/installs/ruby/3.3.6/lib/ruby/gems/3.3.0/gems/rubocop-rspec_rails-2.30.0/lib/../config/default.yml
configuration from ~/.asdf/installs/ruby/3.3.6/lib/ruby/gems/3.3.0/gems/rubocop-thread_safety-0.6.0/config/default.yml
configuration from #{path}

I was intrigued by this un-interpolated #{path} at the end, and it seems to be a bug in the gem. The reason for the \ in the injection code remains a mystery. :^)

```console
be rubocop -d

configuration from ~/.asdf/installs/ruby/3.3.6/lib/ruby/gems/3.3.0/gems/rubocop-performance-1.23.0/config/default.yml
configuration from ~/.asdf/installs/ruby/3.3.6/lib/ruby/gems/3.3.0/gems/rubocop-performance-1.23.0/config/default.yml
Default configuration from ~/.asdf/installs/ruby/3.3.6/lib/ruby/gems/3.3.0/gems/rubocop-1.69.0/config/default.yml
configuration from ~/.asdf/installs/ruby/3.3.6/lib/ruby/gems/3.3.0/gems/rubocop-rails-2.27.0/config/default.yml
configuration from ~/.asdf/installs/ruby/3.3.6/lib/ruby/gems/3.3.0/gems/rubocop-rails-2.27.0/config/default.yml
configuration from ~/.asdf/installs/ruby/3.3.6/lib/ruby/gems/3.3.0/gems/rubocop-rake-0.6.0/config/default.yml
configuration from ~/.asdf/installs/ruby/3.3.6/lib/ruby/gems/3.3.0/gems/rubocop-rake-0.6.0/config/default.yml
configuration from ~/.asdf/installs/ruby/3.3.6/lib/ruby/gems/3.3.0/gems/rubocop-capybara-2.21.0/config/default.yml
configuration from ~/.asdf/installs/ruby/3.3.6/lib/ruby/gems/3.3.0/gems/rubocop-capybara-2.21.0/lib/../config/default.yml
configuration from ~/.asdf/installs/ruby/3.3.6/lib/ruby/gems/3.3.0/gems/rubocop-factory_bot-2.26.1/config/default.yml
configuration from ~/.asdf/installs/ruby/3.3.6/lib/ruby/gems/3.3.0/gems/rubocop-factory_bot-2.26.1/lib/../config/default.yml
configuration from ~/.asdf/installs/ruby/3.3.6/lib/ruby/gems/3.3.0/gems/rubocop-rspec-3.2.0/config/default.yml
configuration from ~/.asdf/installs/ruby/3.3.6/lib/ruby/gems/3.3.0/gems/rubocop-rspec-3.2.0/config/default.yml
configuration from ~/.asdf/installs/ruby/3.3.6/lib/ruby/gems/3.3.0/gems/rubocop-rspec_rails-2.30.0/config/default.yml
configuration from ~/.asdf/installs/ruby/3.3.6/lib/ruby/gems/3.3.0/gems/rubocop-rspec_rails-2.30.0/lib/../config/default.yml
configuration from ~/.asdf/installs/ruby/3.3.6/lib/ruby/gems/3.3.0/gems/rubocop-thread_safety-0.6.0/config/default.yml
configuration from #{path}
```

I was intrigued by this un-interpolated `#{path}` at the end, and it seems to be a bug in the gem.
The reason for the `\` in the injection code remains a mystery. :^)
@viralpraxis viralpraxis self-assigned this Dec 9, 2024
@viralpraxis
Copy link
Collaborator Author

Also, it seems there's an effort to simplify injection: rubocop/rubocop#11265.

It's already being used by rubocop-factory_bot. I'll check if it's applicable to our case

@viralpraxis viralpraxis merged commit 7040b35 into rubocop:master Dec 9, 2024
20 checks passed
@viralpraxis viralpraxis deleted the fix-wrong-debug-path-inspection-escape branch December 9, 2024 07:38
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.

1 participant