Skip to content

Find correct paths to process #21

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

Merged
merged 7 commits into from
Oct 12, 2017
Merged

Find correct paths to process #21

merged 7 commits into from
Oct 12, 2017

Conversation

filipesperandio
Copy link
Contributor

@filipesperandio filipesperandio commented Oct 10, 2017

The file count is a bit extensive, but one can skip the fixtures files during the review to speed it up.

Related to #12 and #15

@filipesperandio filipesperandio force-pushed the fe/finder branch 2 times, most recently from 8d6f747 to b2dcf86 Compare October 10, 2017 15:06
return defaultMatcher;
}
} catch (Exception e) {
throw new RuntimeException("Error creating create with pattern: " + pattern, e);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be Error creating matcher?

public List<ClientInputFile> collect(Path baseDir) throws IOException {
return findPaths(baseDir).stream()
.map(p -> toClientInputFile(baseDir, p))
.filter(f -> f != null)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think of expanding these single letter variables out? Not sure what's p stands for. Is f for file?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dblandin p expanded to path.
f != null replaced with Objects::nonull ;)

Ready for another shot?

@wfleming
Copy link

This ship may have sailed, but why does this engine need to concern itself with glob matching, and what's "source" vs "tests"? The CLI should expand globs and determine appropriate concrete include_paths, so I guess I'm not clear why the engine needs to do additional filtering on top of that.

@filipesperandio
Copy link
Contributor Author

@wfleming Ship still on shore.
Sonar accepts optional src and tests, applying different rules to tests.
I am considering src everything I get on included_paths, on top of it, we mark files as test following the pattern if given.

Looking at the code again, I probably made this distinction a bit clear on another branch - not sure why I haven't brought it over. I will do so, it basically gets rid of the src blob, using only the include_path, doing exactly what I described above.

@filipesperandio
Copy link
Contributor Author

@wfleming Just pushed the changes, c353b93.
The actual use of the tests patterns will come in another PR right after this one.

@filipesperandio
Copy link
Contributor Author

@dblandin @wfleming Can I have a final 👀 here?

@filipesperandio
Copy link
Contributor Author

@wfleming No srcGlob, no exclusionGlob

@filipesperandio filipesperandio merged commit c18e9a4 into channel/beta Oct 12, 2017
@filipesperandio filipesperandio deleted the fe/finder branch October 12, 2017 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants