Skip to content

Absolute report path is treated like a relative path if it also exists within the current directory #1161

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

Closed
schmittjoh opened this issue Sep 15, 2016 · 3 comments

Comments

@schmittjoh
Copy link

schmittjoh commented Sep 15, 2016

If you pass an absolute report path like this --report-checkstyle=/tmp/phpcs-results, this is still prefixed with the current directory.

In the 2.x versions, the current path is not prepended when it is absolute already.

@schmittjoh
Copy link
Author

schmittjoh commented Sep 15, 2016

The 2.x versions seem also to be affected. Further debugging suggests that this error happens if you have a file named tmp in the current directory (and the passed report path also ends in tmp, see above).

I would suggest to check whether the path starts with a / and treat it as absolute in that case. Problematic code paths are here:

@gsherwood
Copy link
Member

I would suggest to check whether the path starts with a / and treat it as absolute in that case.

Sounds like a good plan to me.

@gsherwood gsherwood changed the title Absolute report path is treated like a relative path Absolute report path is treated like a relative path if it also exists within the current directory Sep 19, 2016
gsherwood added a commit that referenced this issue Sep 19, 2016
…h if it also exists within the current directory
gsherwood added a commit that referenced this issue Sep 19, 2016
@gsherwood
Copy link
Member

Fixed now. Thanks for the report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants