Open ydah opened 1 year ago
I ran into this too.
And my patch is below :
--- a/lib/rubocop/cop/grep/grep.rb
+++ b/lib/rubocop/cop/grep/grep.rb
@@ -54,6 +54,15 @@ module RuboCop
opt |= Regexp::IGNORECASE if rule['Ignorecase']
opt
end
+
+ # workaround for https://github.com/pocke/rubocop-grep/issues/4
+ def self.badge
+ if name == "RuboCop::Cop::Grep::Grepx"
+ @badge ||= Badge.for("RuboCop::Cop::Grep::Grep")
+ else
+ super
+ end
+ end
end
We have confirmed that this will correctly output Grep/Grep
instead of Grep/Grepx
in the offence message.
@pocke I sent a pull request. https://github.com/pocke/rubocop-grep/pull/6
I would be very happy if you could take a look at it ! :)
I thought updating steep
gem would solve this problem.
Submitted another pull request #8 🙏
(As far as I tested, it seems like this will probably be fixed in steep 1.4.0.dev.5 or later.)
Hello.
Grep/Grep
cop occurs an error when running. I have prepared.rubocop.yml
as follows from the README:The following error occurs:
Maybe, It appears that https://github.com/pocke/rubocop-grep/commit/efca29388d13257b217dc03cb432abaab722f00e, which hacked for steep, is the cause. It appears that an error is occurring because the
each
method is being called for nil because it referencescop_config
inGrep/Grepx
at runtime. https://github.com/pocke/rubocop-grep/blob/aed0a2734d6f1d0b4926550a51e63e2bcc31d803/lib/rubocop/cop/grep/grep.rb#L13This will work with the following fixes, but the cop name in the offense log is still wrong (Grep/Grepx).
The following offense logs occur:
Steps to reproduce the problem
RuboCop version