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

RegexpLiteral cop not being disabled in the rubocop-todo.yml file #1001

Closed
fabiopelosin opened this issue Apr 13, 2014 · 2 comments
Closed
Assignees

Comments

@fabiopelosin
Copy link
Contributor

The rubocop-todo.yml apparently doesn't disables the RegexpLiteral cop. The entry added to the todo file is the following:

# Offense count: 4
RegexpLiteral:
  MaxSlashes: 3
$ rubocop --auto-gen-config
Inspecting 74 files
.CCCC.CCWC.CC..CCCCCCCCCCCWCCCCWC..W.CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC

Offenses:
[...]

74 files inspected, 574 offenses detected
Created rubocop-todo.yml.
Run `rubocop --config rubocop-todo.yml`, or
add inherit_from: rubocop-todo.yml in a .rubocop.yml file.

$ rubocop
Offenses:

lib/cocoapods-core/specification/linter.rb:226:17: C: Use %r only for regular expressions matching more than 3 '/' characters.
        if h =~ %r{http://EXAMPLE}
                ^^^^^^^^^^^^^^^^^^
lib/cocoapods-core/specification/linter.rb:288:21: C: Use %r only for regular expressions matching more than 3 '/' characters.
          if git =~ %r{http://EXAMPLE}
                    ^^^^^^^^^^^^^^^^^^
lib/cocoapods-core/specification/linter.rb:331:17: C: Use %r only for regular expressions matching more than 3 '/' characters.
        if s =~ %r{https://twitter.com/EXAMPLE}
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

74 files inspected, 3 offenses detected
@bbatsov
Copy link
Collaborator

bbatsov commented Apr 14, 2014

It's not disabled (and by that I mean it's reporting offenses) because it seems MaxSlashes was miscalculated. @jonas054 Will you have a look at this?

@jonas054
Copy link
Collaborator

Yes!

@jonas054 jonas054 self-assigned this Apr 14, 2014
bbatsov added a commit that referenced this issue Apr 18, 2014
[Fix #1001] Fix --auto-gen-config logic for RegexpLiteral
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

3 participants