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

Warning: unrecognized parameter Style/AlignParameters:IndentationWidth #3095

Closed
donv opened this issue Apr 30, 2016 · 9 comments
Closed

Warning: unrecognized parameter Style/AlignParameters:IndentationWidth #3095

donv opened this issue Apr 30, 2016 · 9 comments

Comments

@donv
Copy link

donv commented Apr 30, 2016

Expected behavior

No warning.

Actual behavior

Warning: unrecognized parameter Style/AlignParameters:IndentationWidth found in /path/to/my/.rubocop.yml

However, the cop works as expected.

Steps to reproduce the problem

Add config:

Style/AlignParameters:
  EnforcedStyle: with_fixed_indentation
  IndentationWidth: 4

Run rubocop

RuboCop version

$ rubocop -V
0.39.0 (using Parser 2.3.0.7, running on ruby 2.3.0 x86_64-darwin14)
@mikegee
Copy link
Contributor

mikegee commented Apr 30, 2016

Yup, IndentationWidth isn't a parameter:

% bin/rubocop --show-cop Style/AlignParameters
# Supports --auto-correct
Style/AlignParameters:
  Description: Align the parameters of a method call if they span more than one line.
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-double-indent
  Enabled: true
  EnforcedStyle: with_first_parameter
  SupportedStyles:
  - with_first_parameter
  - with_fixed_indentation

I'm not sure why you would expect no warning when providing an unrecognized parameter.

@donv
Copy link
Author

donv commented Apr 30, 2016

@mikegee Thanks for responding.

The IndentationWidth parameter has effect through the AutocorrectAlignment mixin, so it is actually a parameter, although maybe not officially.

I would very much like it to become official.

BTW: Where are the cop parameters documented?

@donv
Copy link
Author

donv commented Apr 30, 2016

OK, found docs here: https://github.com/bbatsov/rubocop/blob/master/config/default.yml

Would be nice to add IndentationWidth as a parameter to Style/AlignParameters cop.

@jfelchner
Copy link
Contributor

jfelchner commented Jun 3, 2016

@alexdowad I don't know if this is the same problem or not, but ever since 0.40.0 I'm now getting:

Warning: unrecognized parameter Lint/UnusedBlockArgument:IgnoreEmptyBlocks

Even though that config is in the default config

Copied and pasted from my config:

Lint/UnusedBlockArgument:
  Enabled:                       true
  IgnoreEmptyBlocks:             true

@jfelchner
Copy link
Contributor

nm. I see what the problem is. I'll submit a PR for it.

bbatsov pushed a commit that referenced this issue Jun 3, 2016
…red (#3192)

In 8f01fbe a very old patch was applied to a new tree.  Because of this, the
changes made in that commit to the default config actually added the same key
for the `Lint/UnusedBlockArgument` cop a second time.  Because of how YAML
parses, the previous definition, which defined the `IgnoreEmptyBlocks`
parameter was lost and because of _that_, any configuration that defined it
would now throw a warning.

Also brought up in #3095
@bbatsov bbatsov closed this as completed in 9b1e345 Jun 6, 2016
@donv
Copy link
Author

donv commented Jun 6, 2016

Thanks!

Neodelf pushed a commit to Neodelf/rubocop that referenced this issue Oct 15, 2016
…red (rubocop#3192)

In 8f01fbe a very old patch was applied to a new tree.  Because of this, the
changes made in that commit to the default config actually added the same key
for the `Lint/UnusedBlockArgument` cop a second time.  Because of how YAML
parses, the previous definition, which defined the `IgnoreEmptyBlocks`
parameter was lost and because of _that_, any configuration that defined it
would now throw a warning.

Also brought up in rubocop#3095
Neodelf pushed a commit to Neodelf/rubocop that referenced this issue Oct 15, 2016
…eters

It was supported anyways, through the AutocorrectAlign mixin, but not
explicitly allowed as a parameter.
@faelin
Copy link

faelin commented Aug 4, 2021

Same issue for Layout/ExtraSpacing:AllowBeforeTrailingComments — causes a warning even though it has a default value.

@dvandersluis
Copy link
Member

@faelin I cannot reproduce, what warning are you seeing and what version are you using?

@faelin
Copy link

faelin commented Aug 9, 2021

It was apparently a versioning problem.

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

No branches or pull requests

5 participants