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 #10871] Restore RuboCop::ConfigLoader.project_root as deprecated #10872

Merged

Conversation

koic
Copy link
Member

@koic koic commented Aug 5, 2022

Fixes #10871 and utkarsh2102/rubocop-packaging#44.

This PR restores RuboCop::ConfigLoader.project_root as deprecated.

It fixes the following build error.

% cd path/to/github.com/utkarsh2102/rubocop-packaging
% bundle update && bundle exec rake
(snip)

Failures:

  1) RuboCop::Cop::Packaging::BundlerSetupInTests when `require
  bundler/setup` is used in a Rakefile does not register an offense
     Failure/Error: let(:project_root) {
  RuboCop::ConfigLoader.project_root }

     NoMethodError:
       undefined method `project_root' for RuboCop::ConfigLoader:Class
     # ./spec/rubocop/cop/packaging/bundler_setup_in_tests_spec.rb:6:in
       `block (2 levels) in <top (required)>'
     # ./spec/rubocop/cop/packaging/bundler_setup_in_tests_spec.rb:39:in
       `block (3 levels) in <top (required)>'
     # ./spec/rubocop/cop/packaging/bundler_setup_in_tests_spec.rb:43:in
       `block (3 levels) in <top (required)>'

I considered a soft deprecation, but decided to issue a warning as it is probably of limited use.


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.

koic added a commit to koic/rubocop-packaging that referenced this pull request Aug 5, 2022
Fixes utkarsh2102#44.

Fix a build error when using RuboCop 1.33+.

The upstream will be resolved by the release of rubocop/rubocop#10872.
Aprt from that, this patch can be resolved by RuboCop::Packaging alone
independently from the upstream.
koic added a commit to koic/rubocop-packaging that referenced this pull request Aug 5, 2022
Fixes utkarsh2102#44.

Fix a build error when using RuboCop 1.33+.

The upstream will be resolved by the release of rubocop/rubocop#10872.
Apart from that, this patch can be resolved by RuboCop::Packaging alone
independently from the upstream.
koic added a commit to koic/rubocop-packaging that referenced this pull request Aug 5, 2022
Fixes utkarsh2102#44.

Fix a build error when using RuboCop 1.33+.

The upstream will be resolved by the release of rubocop/rubocop#10872.
Apart from that, this patch can be resolved by RuboCop::Packaging alone
independently from the upstream.
@bbatsov
Copy link
Collaborator

bbatsov commented Aug 5, 2022

We can also start making use of https://www.rubydoc.info/gems/yard/file/docs/Tags.md#deprecated

…eprecated

Fixes rubocop#10871 and utkarsh2102/rubocop-packaging#44.

This PR restores `RuboCop::ConfigLoader.project_root` as deprecated.

It fixes the following build error.

```console
% cd path/to/github.com/utkarsh2102/rubocop-packaging
% bundle update && bundle exec rake
(snip)

Failures:

  1) RuboCop::Cop::Packaging::BundlerSetupInTests when `require
  bundler/setup` is used in a Rakefile does not register an offense
     Failure/Error: let(:project_root) {
  RuboCop::ConfigLoader.project_root }

     NoMethodError:
       undefined method `project_root' for RuboCop::ConfigLoader:Class
     # ./spec/rubocop/cop/packaging/bundler_setup_in_tests_spec.rb:6:in
       `block (2 levels) in <top (required)>'
     # ./spec/rubocop/cop/packaging/bundler_setup_in_tests_spec.rb:39:in
       `block (3 levels) in <top (required)>'
     # ./spec/rubocop/cop/packaging/bundler_setup_in_tests_spec.rb:43:in
       `block (3 levels) in <top (required)>'
```

I considered a soft deprecation, but decided to issue a warning as it
is probably of limited use.
@koic koic force-pushed the restore_rubocop_config_loader_project_root branch from 5dd7b0d to 6c20212 Compare August 5, 2022 14:34
@koic
Copy link
Member Author

koic commented Aug 5, 2022

That sounds like a good idea! I've updated it. And I will open a separate PR looking for and marking other deprecated APIs as well.

@bbatsov bbatsov merged commit 8ccd832 into rubocop:master Aug 5, 2022
@koic koic deleted the restore_rubocop_config_loader_project_root branch August 6, 2022 10:53
koic added a commit that referenced this pull request Aug 7, 2022
@koic
Copy link
Member Author

koic commented Aug 7, 2022

I checked and it was already marked with @deprecated. The only unmarked deprecated EnforceSuperclass module marked by 4224d30.

WJWH pushed a commit to WJWH/rubocop that referenced this pull request Aug 8, 2022
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.

Broken compatibility with rubocop-packages after latest *minor* update 1.33.0
2 participants