-
Notifications
You must be signed in to change notification settings - Fork 282
Open
Description
Setup
Rails app, where helpers smell of UtilityFunction
.reek.yml
directories:
"app/helpers":
UtilityFunction:
enabled: falseapp/helpers/foo_helper.rb
module FooHelper
def smelly_method(bar)
bar.presence
end
endHappy Path
reek --show-configuration-path app/helpers/foo_helper.rbUsing '.reek.yml' as configuration file.
Inspecting 1 file(s):
.
Possible Bug
When linting through atom-linter, the current working directory (cwd) is set to the one the file being linted exists, in this case: app/helpers. Reek will still find the correct .reek.yml from it's ancestors, first in app and ultimately on the project's root. But, it won't match the directory "app/helpers", because it's looking for "app/helpers" relative to the cwd instead of relative to the configuration file.
cd app/helpers
reek --show-configuration-path foo_helper.rbUsing '../../.reek.yml' as configuration file.
Inspecting 1 file(s):
S
foo_helper.rb -- 1 warning:
[5]:UtilityFunction: FooHelper#smelly_method doesn't depend on instance state (maybe move it to another class?) [https://github.com/troessner/reek/blob/v5.4.0/docs/Utility-Function.md]
I'm on reek 5.4.0
scottjacobsen and johncip
Metadata
Metadata
Assignees
Labels
No labels