-
Notifications
You must be signed in to change notification settings - Fork 57
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
Prevent sub-folder files from being analyzed twice #124
Prevent sub-folder files from being analyzed twice #124
Conversation
Does this fix inaka/elvis#508? |
Related: 1d80b28#r36143723 |
Let me try to check that tonight. If it doesn't I might want to tackle that also. |
Regarding
|
I'm looking into why the issue occurs with
I feel there's a simpler approach to the problem (e.g. filesystem folder tree traversal...). |
I think I found my answer here: https://erlang.org/doc/man/filelib.html#wildcard-1. |
If we don't remove ** in the comparison bit stuff like src/**/*.erl might happen, which will not include src/m1.erl, for example, as expected (if `dirs` is "src/**"
@@ -128,6 +130,9 @@ replace_stars(Glob) -> re:replace(Glob, "[[][*][]]", ".*", [global]). | |||
|
|||
replace_questions(Glob) -> re:replace(Glob, "[[][?][]]", ".", [global]). | |||
|
|||
reduce_stars(DirAndFilter) -> | |||
re:replace(DirAndFilter, "/\\*+/", "/", [global, {return, list}]). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This improves the analysis scope. Specifically, it deals with all the issues in inaka/elvis#508.
Thank you, @paulo-ferraz-oliveira !!! |
Oh, this is nice 👍 |
This is what is happening to me...
I have an
elvis.config
file such asWhen analyzing file
file.erl
inside foldersrc/sub
it gets analyzed twice, sinceelvis_core
's internals match it with bothsrc/
andsrc/sub/
.The "solution" found was to un-duplicate these occurrences.