Skip to content

Rails/Output behavior changes depending on relative or absolute config path #23

@ndbroadbent

Description

@ndbroadbent

I've created a repo that can reproduce this issue: https://github.com/ndbroadbent/rubocop-bug

From the README:


Run ./script.sh.

With file

git clone https://github.com/ndbroadbent/rubocop-bug.git /tmp/rubocop-bug
cd /tmp/rubocop-bug

rubocop
Inspecting 1 file
.

1 file inspected, no offenses detected
rubocop -c .rubocop.yml
Inspecting 1 file
.

1 file inspected, no offenses detected
rubocop -c /tmp/rubocop-bug/.rubocop.yml
Inspecting 1 file
W

Offenses:

app/models/test_model.rb:6:5: W: Lint/UnneededCopDisableDirective: Unnecessary disabling of Rails/Output.
    # rubocop:disable Rails/Output
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

1 file inspected, 1 offense detected

With stdin

cat app/models/test_model.rb | rubocop -c /tmp/rubocop-bug/.rubocop.yml \
    -s /tmp/rubocop-bug/app/models/test_model.rb
Inspecting 1 file
.

1 file inspected, no offenses detected
cp app/models/test_model.rb /tmp/test_model.rb
cat app/models/test_model.rb | rubocop -c /tmp/rubocop-bug/.rubocop.yml \
    -s /tmp/test_model.rb
Inspecting 1 file
W

Offenses:

/tmp/test_model.rb:6:5: W: Lint/UnneededCopDisableDirective: Unnecessary disabling of Rails/Output.
    # rubocop:disable Rails/Output
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

1 file inspected, 1 offense detected

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions