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

VCS blame reports output error content from the blame commands for files not under VC #638

Closed
manquer opened this issue Jul 9, 2015 · 3 comments

Comments

@manquer
Copy link

manquer commented Jul 9, 2015

gitblame stype reports throwing
fatal: no such path 'path/to/file/' in HEAD
errors for files which exist locally but not there in repo

While .gitignored files can also be ignored in phpcs runs,
ideally these files should not be scanned in gitblame report style in the first place

@aik099
Copy link
Contributor

aik099 commented Jul 9, 2015

gitblame stype reports throwing
fatal: no such path 'path/to/file/' in HEAD
errors for files which exist locally but not there in repo

  1. Does this happen with any git repo or with some specific repo?
  2. What command are you using to execute PHP_CodeSniffer?

ideally these files should not be scanned in gitblame report style in the first place

Maybe, but then you'll have 2 different scopes of files scanned based on selected report, which might be confusing.

@manquer
Copy link
Author

manquer commented Jul 10, 2015

  1. It usually happens for all my repos where my local configuration files (in php) are not part of the repo.
  2. I run something like this. phpcs --extensions=php --standard=MyStandard --ignore=./vendor --report-gitblame ./

I agree that it is confusing to have 2 different scopes basis the selected report. However these type of files are not in the repo, and they are already not part of the gitblame report, therefore it makes sense to not parse them in the gitblame report case only.

In any case the error is coming from git-blame not phpcs and is bit confusing to understand what is happening and why, a better way to show the error with clearer explanation will help users would be good

@gsherwood
Copy link
Member

The files need to be scanned, but they are recorded as an Unknown user because the author of each line is still unknown. I'll look at just getting the VCS commands to mute their errors.

@gsherwood gsherwood changed the title gitblame reports throwing fatal error if path does not exist in current repo VCS blame reports output error content from the blame commands for files not under VC Jul 22, 2015
gsherwood added a commit that referenced this issue Jul 22, 2015
jrfnl pushed a commit to jrfnl/PHP_CodeSniffer that referenced this issue Nov 4, 2024
* Add extra tests to improve code coverage
* Add comment to last test in case file 3 to clarify that it must be the last in the file.
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

3 participants