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

FirstParameterIndentation gives a somewhat uninformative message #1708

Closed
agrimm opened this issue Mar 11, 2015 · 2 comments
Closed

FirstParameterIndentation gives a somewhat uninformative message #1708

agrimm opened this issue Mar 11, 2015 · 2 comments
Labels
enhancement good first issue Easy task, suitable for newcomers to the project

Comments

@agrimm
Copy link
Contributor

agrimm commented Mar 11, 2015

The following code

RSpec.describe Foo do
  it "can bar" do
    foo = Foo.new
    # Not correct
    expect(foo.bar).to eq(
                         "First line\n" \
                         )
    # Correct
    expect(foo.bar).to eq(
      "First line\n" \
                         )
  end
end

gives me

spec/foo_spec.rb:6:26: C: Indent the first parameter one step more than the previous line.
                         "First line\n" \
                         ^^^^^^^^^^^^^^

As far as I can tell, RuboCop is working as intended when it complains about the "Not correct" version, but the message is somewhat uninformative. Indent the parameter compared to what in the previous line? I assumed it was compared to the eq method name, not the expect method name.

Maybe you could indicate the column number expected versus the column number in the actual code, or highlight what in the previous line was being looked at.

@agrimm agrimm changed the title FirstParameterIndentation gives an somewhat uninformative message FirstParameterIndentation gives a somewhat uninformative message Mar 11, 2015
@bbatsov bbatsov added enhancement good first issue Easy task, suitable for newcomers to the project labels Apr 5, 2015
@oliverbarnes
Copy link

+1

@daniel-johnson
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement good first issue Easy task, suitable for newcomers to the project
Projects
None yet
Development

No branches or pull requests

4 participants