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
Make custom cop inherit RuboCop::Cop::Base
#59
Open
koic
wants to merge
2
commits into
puppetlabs:master
Choose a base branch
from
koic:use_cop_base_api
base: master
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NOTE: I found out that deprecated API is used at rubocop/rubocop#11554. |
Follow rubocop/rubocop#7868. The legacy `Cop::Cop` API is soft deprecated and this PR use new `Cop::Base` API instead. > maintain any RuboCop extensions, as the legacy API will be removed in > RuboCop 2.0. https://metaredux.com/posts/2020/10/21/rubocop-1-0.html
This commit suppresses the following RuboCop offenses. ```console Offenses: lib/rubocop/cop/i18n/gettext/decorate_string.rb:7:11: C: InternalAffairs/CopDescription: Description should be started with a word such as verb instead of This cop .... # This cop is looks for strings that appear to be sentences but are not decorated. ... ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lib/rubocop/cop/i18n/rails_i18n/decorate_string.rb:7:11: C: InternalAffairs/CopDescription: Description should be started with a word such as verb instead of This cop .... # This cop is looks for strings that appear to be sentences but are not decorated. ... ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lib/rubocop/cop/i18n/rails_i18n/decorate_string.rb:121:29: C: InternalAffairs/UndefinedConfig: EnforcedSentenceType is not defined in the configuration for I18n/RailsI18n/DecorateString in config/default.yml. case cop_config['EnforcedSentenceType'].to_s.downcase ^^^^^^^^^^^^^^^^^^^^^^ lib/rubocop/cop/i18n/rails_i18n/decorate_string.rb:131:35: C: InternalAffairs/UndefinedConfig: Regexp is not defined in the configuration for I18n/RailsI18n/DecorateString in config/default.yml. Regexp.new(cop_config['Regexp']) if cop_config['Regexp'] ^^^^^^^^ lib/rubocop/cop/i18n/rails_i18n/decorate_string.rb:131:60: C: InternalAffairs/UndefinedConfig: Regexp is not defined in the configuration for I18n/RailsI18n/DecorateString in config/default.yml. Regexp.new(cop_config['Regexp']) if cop_config['Regexp'] ^^^^^^^^ lib/rubocop/cop/i18n/rails_i18n/decorate_string.rb:147:44: C: InternalAffairs/UndefinedConfig: IgnoreExceptions is not defined in the configuration for I18n/RailsI18n/DecorateString in config/default.yml. return false unless cop_config['IgnoreExceptions'] ^^^^^^^^^^^^^^^^^^ rubocop-i18n.gemspec:6:1: W: [Correctable] Gemspec/RequireMFA: metadata['rubygems_mfa_required'] must be set to 'true'. Gem::Specification.new do |spec| ... ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ spec/spec_helper.rb:13:19: C: [Correctable] Style/RedundantConstantBase: Remove redundant ::. unless defined?(::TestQueue) ^^ spec/spec_helper.rb:25:23: C: [Correctable] Style/YodaCondition: Reverse the order of the operands RUBY_ENGINE == v.to_s. v.is_a?(Symbol) ? RUBY_ENGINE == v.to_s : v ^^^^^^^^^^^^^^^^^^^^^ 23 files inspected, 9 offenses detected, 3 offenses autocorrectable ``` NOTE: This commit make MFA enabled in rubocop-i18n.gemspec so releases to rubygems.org will require MFA.
koic
force-pushed
the
use_cop_base_api
branch
from
February 11, 2023 18:15
29c311b
to
6a3ca3b
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Follow rubocop/rubocop#7868.
The legacy
Cop::Cop
API is soft deprecated and this PR use newCop::Base
API instead.https://metaredux.com/posts/2020/10/21/rubocop-1-0.html
And this PR suppresses the following RuboCop offenses.
NOTE: This commit make MFA enabled in rubocop-i18n.gemspec so releases to rubygems.org will require MFA.