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

Add method call parens ignores for RSpec #8

Closed
wants to merge 1 commit into from

Conversation

Fryguy
Copy link
Member

@Fryguy Fryguy commented Oct 23, 2020

For example when we do this:

expect(foo).to eq(bar)
expect(baz).to_not eq(quux)
expect(baz).not_to eq(quux)

@Fryguy Fryguy added the enhancement New feature or request label Oct 23, 2020
@Fryguy
Copy link
Member Author

Fryguy commented Oct 23, 2020

@bdunne Please review.

@bdunne
Copy link
Member

bdunne commented Oct 26, 2020

Was this an issue somewhere? This cop currently ignores everything in the spec directory, that's why we don't have these in the list. Are you planning to remove the spec directory from the ignored list?

@Fryguy
Copy link
Member Author

Fryguy commented Oct 26, 2020

Then it must not be working because I get this error everywhere. See ManageIQ/manageiq#20731 (comment) for example

Fryguy added a commit to Fryguy/manageiq-style that referenced this pull request Nov 10, 2020
When Excludes are present in an inherited configuration file, Rubocop
will expand_path them.  However, the Excludes in .rubocop_base.yml were
being resolved relative to the gem itself.  Because of this they were
ultimately ignored.

The reason this happens is because Rubocop looks at the filename, and if
it starts with .rubocop, it assumes that is a project-level file, and
will expand relative to the file itself.  Rubocop's own default config
intentionally does _not_ start with .rubocop, as so the default config
is expanded relative to the project. See
https://github.com/rubocop-hq/rubocop/blob/eb3d3583/lib/rubocop/config.rb#L190-L203

The simplest fix for now is to just rename our files to not have
.rubocop at the start of the file name.  We can still keep our
.rubocop_base.yml to avoid renaming it in all of the gems.

Fixes ManageIQ#7
Closes ManageIQ#8
@bdunne bdunne closed this in #12 Nov 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants