phpro / grumphp

A PHP code-quality tool
MIT License
4.14k stars 430 forks source link

Which parts of the code does GrumPHP scan? #260

Closed Bilge closed 7 years ago

Bilge commented 7 years ago
Q A
Question? yes

When GrumPHP scans the code prior to commit, what exactly does it scan?

jyggen commented 7 years ago

When running ./vendor/bin/grumphp run all files in the repository are checked and during the pre-commit hook iIt depends on the task. Most tasks (afaik) only check changed files but some tasks (phpcpd for example) will scan the whole project since it wouldn't be that useful otherwise.

veewee commented 7 years ago

Indeed:

Most taks work directly with these files, but there are some commands like git_blacklist that are able to check only the commited lines. It's up to the task to determine what exactly is being used.

In a future version it will also be possible to hook in on the pre-puss hook. This will check a list of transfered files (hopefully :) ).

the feedback on this issue will be added to the documentation. In the meantime, I created #265 to keep track on this change. I'll close this issue for now.