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 #10731] Show tip for suggested extensions that are installed but not loaded in .rubocop.yml #10800

Merged
merged 1 commit into from Aug 4, 2022

Conversation

nobuyo
Copy link
Contributor

@nobuyo nobuyo commented Jul 9, 2022

Fixes #10731.

This PR adds a new tip for suggesting extensions that are installed but not loaded.

# Gemfile

# frozen_string_literal: true

source('https://rubygems.org')

git_source(:github) do |repo_name|
  "https://github.com/#{repo_name}"
end

gem 'minitest'
gem 'rake'
gem 'rspec'
gem 'rubocop'
gem 'rubocop-rake'
gem 'rubocop-rspec'
# .rubocop.yml

require:
  - rubocop-rake

AllCops:
  NewCops: enable
  TargetRubyVersion: 3.1

Layout/LineLength:
  Max: 40

Run rubocop:

$ bundle exec rubocop
Inspecting 2 files
..

2 files inspected, no offenses detected

Tip: Based on detected gems, the following RuboCop extension libraries might be helpful:
  * rubocop-minitest (https://rubygems.org/gems/rubocop-minitest)

The following RuboCop extension libraries are installed but not loaded in config:
  * rubocop-rspec

You can opt out of this message by adding the following to your config (see https://docs.rubocop.org/rubocop/extensions.html#extension-suggestions for more options):
  AllCops:
    SuggestExtensions: false

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.

@nobuyo nobuyo force-pushed the show-tip-for-non-loaded-extensions branch from bdafdef to 696c287 Compare July 9, 2022 07:39
@nobuyo nobuyo marked this pull request as draft July 9, 2022 08:12
@nobuyo nobuyo force-pushed the show-tip-for-non-loaded-extensions branch from 696c287 to 4482acb Compare July 18, 2022 05:19
@nobuyo nobuyo force-pushed the show-tip-for-non-loaded-extensions branch from 4482acb to d757b8f Compare July 18, 2022 05:27
@nobuyo nobuyo marked this pull request as ready for review July 18, 2022 05:47
@nobuyo
Copy link
Contributor Author

nobuyo commented Aug 2, 2022

@bbatsov @koic I'd be happy if you take a look at this :)

@bbatsov bbatsov merged commit 0658f99 into rubocop:master Aug 4, 2022
@bbatsov
Copy link
Collaborator

bbatsov commented Aug 4, 2022

Sorry for the slow response - I like it! Thanks for working on this! 🙇‍♂️

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.

Enhancement: Tip for suggested extensions that are included, but not loaded
2 participants