Replies: 1 comment
-
The following patch cause the following errors: diff --git a/lib/rubocop/performance/inject.rb b/lib/rubocop/performance/inject.rb
index e255a881a..9bdde53d0 100644
--- a/lib/rubocop/performance/inject.rb
+++ b/lib/rubocop/performance/inject.rb
@@ -7,7 +7,7 @@ module RuboCop
module Inject
def self.defaults!
path = CONFIG_DEFAULT.to_s
- hash = ConfigLoader.send(:load_yaml_configuration, path)
+ hash = ConfigLoader.send(:load_file, File.new(path))
config = Config.new(hash, path).tap(&:make_excludes_absolute)
puts "configuration from #{path}" if ConfigLoader.debug?
config = ConfigLoader.merge_with_default(config, path) I think this is an unexpected behavior. % bundle exec rubocop
Error: unrecognized cop Performance/AncestorsInclude found in performance/config/default.yml
unrecognized cop Performance/ArraySemiInfiniteRangeSlice found in performance/config/default.yml
unrecognized cop Performance/BigDecimalWithNumericArgument found in performance/config/default.yml
unrecognized cop Performance/BindCall found in performance/config/default.yml
unrecognized cop Performance/BlockGivenWithExplicitBlock found in performance/config/default.yml
(snip) So, I think rubocop-extension-generator is designed to write custom cops configuration in config/default.yml of custom gem. # config/default.yml
Company/MagicCop
Enabled: true
Params: ['abc'] e.g. config/default.yml of RuboCop Performance: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi team, I've been using https://github.com/rubocop/rubocop-extension-generator to generate custom cop gem, besides everything generated by default, I separated custom cops out from
default.yml
torubocop_custom_cop.yml
, however, seems it's not been able to load anything from therubocop_custom_cop.yml
.By reading the config related code, it seems the only thing I need to do is: renjiexu/rubocop-extension-generator@7b5741d.
This seems to be a bug of rubocop-extension-generator but the
inject.rb
was widely used in variousrubocop-extensions
gems, would like to confirm this before submitting the PR.Thanks 🙏
Beta Was this translation helpful? Give feedback.
All reactions