-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Syntax Cop Configuration Error #4932
Comments
@chihhungl and I ran into this together. To provide a little more context, the project we work on uses HoundCI to run rubocop against our PRs. For old repos, HoundCI runs PRs against their own rubocop config (which is different from rubocop's own default config). You can check in a The problem is that with our recent upgrade to 0.51.0, rubocop's own default config files do not pass rubocop's config validation. We believe this to be a regression introduced by #4466 |
@pocke, shouldn't we raise an error if the cop is actually configured, i.e. config contains parameters which differ from default ones? Or, probably, should the error message suggest removing WDYT? |
Rubocop should raises an error only if the cop is actually configured, right? I agree it. 👍 BTW, I think coping the configuration files from rubocop's |
Recently upgraded rubocop to 0.51.0. We have our own
rubocop.yml
which is inherited from.rubocop.enabled.yml
,.rubocop.disabled.yml
, and.rubocop.default.yml
. Each of them is the same as theenabled.yml
,disabled.yml
,default.yml
in the release0.51.0
.However, we tried to run
rubocop file.rb
on command line and we got the following error message.When we look at the
config.rb
in the release0.51.0
, it appears that this cop in our.rubocop.enabled.yml
fails the validation here inconfig.rb
.The logic here seems kinda odd: it returns unless the
Lint/Syntax
orSyntax
is included invalid_cop_names
, otherwise raise an error. In another word, ifLint/Syntax
orSyntax
is included invalid_cop_names
then raise an error.Our temporary solution is to comment out
Syntax cop
.Steps to reproduce the problem
Upgrade rubocop to
0.51.0
Copy
enabled.yml
,disabled.yml
, anddefault.yml
and rename them to.rubocop.enabled.yml
,.rubocop.disabled.yml
, and.rubocop.default.yml
.Create a new file name
.rubocop.yml
with the following content.rubocop.default.yml
to avoid duplicate inheritance.Expected behavior
It should check that file without exceptions.
Actual behavior
Got the following error
RuboCop version
The text was updated successfully, but these errors were encountered: