-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Improve --fullpath and --match-d root path #731
Comments
I also just stumbled over this and was totally confused how to anchor the regex - I wanted to exclude
But
And funnily enough, To figure out how to anchor my regex, I had to put some debug code into
and I was dismayed to learn that it matches the absolute path, including the path to my home directory. |
I agree this needs work (both the code and the documentation). Basing |
and correct legacy test results that were wrong
@PMExtra The intent of @martinvonwittich There was a problem with how |
Currently, using the
--fullpath
with--match-d
options causes cloc to evaluate the regex based on the physical full path, but this might not align with what users expect.For instance, if I aim to match
./foo/src/
exclusively, but excluding./src/
or./next/foo/src/
, I must set--match-d="^$(pwd)/foo/src/"
.Moreover, when working with git diff, it becomes quite a hassle. The diff generates temporary directories with names that are hard to retrieve.
I propose aligning cloc's working path as a virtual root to address these issues, much like git does.
Then we can use
match-d=^/foo/src/
to match paths relative to the project.The text was updated successfully, but these errors were encountered: