Skip to content
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

list-files appears to struggle with leading slashes in CODEOWNERS file #3

Closed
timoschinkel opened this issue Jan 7, 2020 · 1 comment

Comments

@timoschinkel
Copy link
Owner

timoschinkel commented Jan 7, 2020

Reproduction scenario

Create a codeowners file with the following contents:

/foo @team-one
* @team-two

Now make the following call:

codeowners list-files @team-one foo

This will return no results. But the owner command does return the proper result:

codeowners owner foo/bar.ext

I suspect the issue is caused by using Finder to list all files and to use the getRealPath() method. In the OwnerCommand this is not used, but the passed filename is passed straight into the Parser.

Solution might be to "clean" the paths before passing them to the matcher. But it might also be something worth investigating to see if this can be fixed more generally in the codeowners package by introducing a working directory or something similar.

@timoschinkel timoschinkel reopened this Jan 7, 2020
timoschinkel added a commit that referenced this issue Jan 8, 2020
- Add unit tests for commands
- Replace usage of `SplFileInfo::getRealPath()` with casting to string due to usage of vfsStream
- Return passed path if `realpath()` returns `false` due to usage of vfsStream
- Introduce fix for issue #3
@timoschinkel
Copy link
Owner Author

A fix has been merged and will be supplied with the next release.

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

No branches or pull requests

1 participant