-
Notifications
You must be signed in to change notification settings - Fork 281
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
Directory configurations changed incompatibly in v5.4.0 #1482
Comments
Just so we are triple clear on this, with 5.3.2 the output is exactly the same, right? |
Interesting, I was not aware of this Rake task feature. Looking rapidly at the code, I think the directives do not work because they are not applied relative to the root directory, which is mostly the case when running reek from the command line because it's usually called with When using the Rake task, you're specifying a pattern which selects only *.rb files in subfolders. If I am not mistaken, the directives are interpreted relative to the given file, which will probably match nothing in your case. I guess the issue can also be reproduced when calling Reek from the command line by passing the pattern as an option, like To help identify the issue, and this also could give you a workaround, could you try those two things (separately):
|
I think @pbernery's analysis is not entirely correct; The directives are applied to the file path as known to reek, which in the normal case does not include a leading Can you try configuring the task with: Reek::Rake::Task.new do |t|
t.config_file = '.reek.yml'
t.source_files = FileList['**/*.rb'].exclude('vendor/**/*.rb')
end I think in the 5.3 version of the code we unintentially matched the excluded directory names anywhere in the path, so |
This is also a good thing to try to verify the analysis. |
Thanks! With the configuration @mvz proposed it works as expected. Running the CLI with |
@rasaffie I think that still means this is broken. |
I don't think we will fix this in the 5.x series. |
When updating from
v5.3.2
tov5.4.0
runningreek
from CLI and Rake::Task has different outcomes:My rake configuration is:
The problem is that the rake task finds the configuration file (changing its name causes a "file not found" error), but doesn't consider the directories rules, like:
The text was updated successfully, but these errors were encountered: