Skip to content

rubocop: exclude .simplecov under vendor#4332

Merged
reitermarkus merged 1 commit intoHomebrew:masterfrom
apjanke:exclude-vendor-simplecov
Jun 13, 2018
Merged

rubocop: exclude .simplecov under vendor#4332
reitermarkus merged 1 commit intoHomebrew:masterfrom
apjanke:exclude-vendor-simplecov

Conversation

@apjanke
Copy link
Copy Markdown
Contributor

@apjanke apjanke commented Jun 11, 2018

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example. No: this is itself a style/test change, and the details of brew style aren't tested.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew tests with your changes locally?

For me, when I run brew style, it's complaining about the .simplecov file under the Aruba gem in the vendored portable ruby.

$ brew style                                                                  master ✭
Inspecting 664 files
.....................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................C..................

Offenses:

/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.3/lib/ruby/gems/2.3.0/gems/aruba-0.7.4/.simplecov:2:33: C: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
SimpleCov.start unless ENV.key? 'ARUBA_NO_COVERAGE'
                                ^^^^^^^^^^^^^^^^^^^
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.3/lib/ruby/gems/2.3.0/gems/aruba-0.7.4/.simplecov:6:14: C: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
  add_filter '.simplecov'
             ^^^^^^^^^^^^
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.3/lib/ruby/gems/2.3.0/gems/aruba-0.7.4/.simplecov:9:14: C: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
  add_filter 'Rakefile'
             ^^^^^^^^^^
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.3/lib/ruby/gems/2.3.0/gems/aruba-0.7.4/.simplecov:10:14: C: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
  add_filter 'lib/tasks'
             ^^^^^^^^^^^

I would think this file would be excluded by the Exclude: ... - '**/vendor/**/.simplecov' setting in .rubocop.yml. But it looks like the Include: **/.simplecov overrides that.

This PR explicitly excludes **/vendor/**/.simplecov to complete the vendor exclusion.

After:

$ brew style                                                             exclude-vendor-simplecov ✭
Inspecting 663 files
.......................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................

663 files inspected, no offenses detected

@reitermarkus
Copy link
Copy Markdown
Member

Maybe you could make the Include more specific instead, since we only have one .simplecov file, this would be a bit cleaner.

@MikeMcQuaid
Copy link
Copy Markdown
Member

Maybe you could make the Include more specific instead, since we only have one .simplecov file, this would be a bit cleaner.

👍 from me.

@apjanke
Copy link
Copy Markdown
Contributor Author

apjanke commented Jun 12, 2018

Amended to make the include more specific instead of adding an exclude.

@reitermarkus reitermarkus merged commit 05c3924 into Homebrew:master Jun 13, 2018
@reitermarkus
Copy link
Copy Markdown
Member

Thanks, @apjanke!

@lock lock bot added the outdated PR was locked due to age label Jul 13, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Jul 13, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

outdated PR was locked due to age

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants