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

Metrics/LineLength AllowURI is too permissive #1335

Closed
smangelsdorf opened this issue Sep 14, 2014 · 1 comment
Closed

Metrics/LineLength AllowURI is too permissive #1335

smangelsdorf opened this issue Sep 14, 2014 · 1 comment

Comments

@smangelsdorf
Copy link
Contributor

Originally from an RSpec example, but distilled down to a single line file containing:

puts abcdefghijklmnopqrstuvwxyz, foobarfoobarfoobar(MyModule::SomeClassWithALongName)

Running Rubocop 0.26.0 I get:

Inspecting 1 file
.

1 file inspected, no offenses detected

When I create a .rubocop.yml in the same directory containing:

Metrics/LineLength:
  AllowURI: false

I see the following output:

Inspecting 1 file
C

Offenses:

test.rb:1:81: C: Line is too long. [85/80]
puts abcdefghijklmnopqrstuvwxyz, foobarfoobarfoobar(MyModule::SomeClassWithALongName)
                                                                                ^^^^^

1 file inspected, 1 offense detected

I have the same issue on the current master version, also.

@jonas054
Copy link
Collaborator

We've seen this before, and I mentioned it in #1297. The problem is that things in the code that are not URIs are matched by URI.regexp of the ruby standard library. Maybe we should make our own regexp that only matches the most common kinds of URIs.

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

2 participants