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

Changing inherited files' require files does not automatically restart the rubocop server #13661

Closed
ngudbhav opened this issue Jan 9, 2025 · 1 comment · Fixed by #13813
Closed

Comments

@ngudbhav
Copy link

ngudbhav commented Jan 9, 2025

Be clear, concise and precise in your description of the problem.
Open an issue with a descriptive title and a summary in grammatically correct,
complete sentences.

Use the template below when reporting bugs. Please, make sure that
you're running the latest stable RuboCop and that the problem you're reporting
hasn't been reported (and potentially fixed) already.

Before filing the ticket you should replace all text above the horizontal
rule with your own words.


Expected behavior

Rubocop Server should be automatically restarted

Actual behavior

Manual restart of rubocop server using rubocop --restart-server is required

Steps to reproduce the problem

Contents of rubocop.yml

inherit_from:
  - .rubocop-full.yml

Contents of rubocop-full.yml

require:
  - ./rubocop/rubocop.rb

Edit the contents of this ./rubocop/rubocop.rb and you have to manually restart the server.

While I understand that we can not watch all the files as that would require good memory, Should we keep a watch on one or two levels of require?

RuboCop version

Include the output of rubocop -V or bundle exec rubocop -V if using Bundler.
If you see extension cop versions (e.g. rubocop-performance, rubocop-rspec, and others)
output by rubocop -V, include them as well. Here's an example:

bundle exec rubocop -V                                                                                                                                              ─╯
1.69.2 (using Parser 3.3.6.0, rubocop-ast 1.37.0, analyzing as Ruby 3.1, running on ruby 3.1.6) +server [arm64-darwin23]
  - rubocop-factory_bot 2.26.1
  - rubocop-performance 1.23.1
  - rubocop-rails 2.28.0
  - rubocop-rake 0.6.0
  - rubocop-rspec 3.3.0
  - rubocop-rspec_rails 2.30.0

Copy link

github-actions bot commented Feb 9, 2025

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed soon if no further activity occurs. Thank you for your understanding!

@github-actions github-actions bot added the stale Issues that haven't been active in a while label Feb 9, 2025
@koic koic added enhancement and removed stale Issues that haven't been active in a while labels Feb 9, 2025
koic added a commit to koic/rubocop that referenced this issue Feb 9, 2025

Verified

This commit was signed with the committer’s verified signature.
ardabbour Abdul Rahman Dabbour
…ml under `inherit_from` and `require`

This PR makes server mode detect local paths in .rubocop.yml under `inherit_from` and `require` for automatically restart.

Since this adds some extra processing, server mode may experience a slight performance degradation,
but no significant delays are expected.
This change provides a trade-off by reducing the risk of users running with unexpected old configurations.

NOTE: Detection of incompatibility changes in the local configuration also includes changes to local file paths
specified by `inherit_from` and `require` in `.rubocop.yml`.
Changes involving remote files or those considered to be searched on `$LOAD_PATH` are not detected.

Resolves rubocop#13661 and Follow-up to rubocop#13327 (comment).
koic added a commit to koic/rubocop that referenced this issue Feb 9, 2025
…rom` and `require`

This PR makes server mode detect local paths in .rubocop.yml under `inherit_from` and `require` for automatically restart.

Since this adds some extra processing, server mode may experience a slight performance degradation,
but no significant delays are expected.
This change provides a trade-off by reducing the risk of users running with unexpected old configurations.

NOTE: Detection of incompatibility changes in the local configuration also includes changes to local file paths
specified by `inherit_from` and `require` in `.rubocop.yml`.
Changes involving remote files or those considered to be searched on `$LOAD_PATH` are not detected.

Resolves rubocop#13661 and Follow-up to rubocop#13327 (comment).
koic added a commit to koic/rubocop that referenced this issue Feb 9, 2025
…rom` and `require`

This PR makes server mode detect local paths in .rubocop.yml under `inherit_from` and `require` for automatically restart.

Since this adds some extra processing, server mode may experience a slight performance degradation,
but no significant delays are expected.
This change provides a trade-off by reducing the risk of users running with unexpected old configurations.

NOTE: Detection of incompatibility changes in the local configuration also includes changes to local file paths
specified by `inherit_from` and `require` in `.rubocop.yml`.
Changes involving remote files or those considered to be searched on `$LOAD_PATH` are not detected.

Resolves rubocop#13661 and follow-up to rubocop#13327 (comment).
koic added a commit to koic/rubocop that referenced this issue Feb 9, 2025
…rom` and `require`

This PR makes server mode detect local paths in .rubocop.yml under `inherit_from` and `require` for automatically restart.

Since this adds some extra processing, server mode may experience a slight performance degradation,
but no significant delays are expected.
This change provides a trade-off by reducing the risk of users running with unexpected old configurations.

NOTE: Detection of incompatibility changes in the local configuration also includes changes to local file paths
specified by `inherit_from` and `require` in .rubocop.yml.
Changes involving remote files or those considered to be searched on `$LOAD_PATH` are not detected.

Resolves rubocop#13661 and follow-up to rubocop#13327 (comment).
koic added a commit to koic/rubocop that referenced this issue Feb 10, 2025
…rom` and `require`

This PR makes server mode detect local paths in .rubocop.yml under `inherit_from` and `require` for automatically restart.

Since this adds some extra processing, server mode may experience a slight performance degradation,
but no significant delays are expected.
This change provides a trade-off by reducing the risk of users running with unexpected old configurations.

NOTE: Detection of incompatibility changes in the local configuration also includes changes to local file paths
specified by `inherit_from` and `require` in .rubocop.yml.
Changes involving remote files or those considered to be searched on `$LOAD_PATH` are not detected.

Resolves rubocop#13661 and follow-up to rubocop#13327 (comment).
bbatsov pushed a commit that referenced this issue Feb 10, 2025
…d `require`

This PR makes server mode detect local paths in .rubocop.yml under `inherit_from` and `require` for automatically restart.

Since this adds some extra processing, server mode may experience a slight performance degradation,
but no significant delays are expected.
This change provides a trade-off by reducing the risk of users running with unexpected old configurations.

NOTE: Detection of incompatibility changes in the local configuration also includes changes to local file paths
specified by `inherit_from` and `require` in .rubocop.yml.
Changes involving remote files or those considered to be searched on `$LOAD_PATH` are not detected.

Resolves #13661 and follow-up to #13327 (comment).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants