"Force" run option
Opened this issue · 5 comments
Is there an option to force the hooks to be run on all of the code base even if there was no code change?
For example if I've just installed the commit hooks for a big existing project. I'm interested to run the checks asap to see what problems with the code exists, not have to wait until some particular files happen to be changed.
Currently I trick it into checking all of the files by:
chmod
the complete project tree to make it look changed- Add all of the files to commit
- Trigger the hooks by committing
- Fixing all of the found problems
- Reverting the
chmod
command - Actually committing
Having a force-run option would be really nice particularly for CI.
Hi.
Interesting for new feature.
Maybe I could do a comand to execute each tool.
For example:
bin/php-git-hooks "TOOL_NAME"
With options:
- --all (to execute all tools)
- --phpcs
- --php-cs-fixer
- --phplint
- --jsonlint
- --phpmd
- --phpunit
Always reading your php-git.hooks.yml configuration file.
For example, yes. Generally what I'm trying to achieve is to be able to configure the commit hooks only once and then trigger it in the same config on:
- local development box (commit/push)
- Jenkins server (test/build)
It's really nice to have in native support.
Now my solution is running in Jenkins/Codeship/Other CI server after each commit
git reset --soft HEAD~
php vendor/bruli/php-git-hooks/hooks/pre-commit
It covers all changes in last commit not all code base, but it's usually enough for CI workflow.
Sorry by the delay.
I'm thinking about it, and think is better create a new project to do it.
I mean, this project is only for a git hook.
If you wants run php tools (phpunit, phpcs, and more), with a single command to use in a continuous integration server or in your code by hand you can do it with other tool (project).
What do you think?.
Hi.
Interesting for new feature.
Maybe I could do a comand to execute each tool.
For example:
bin/php-git-hooks "TOOL_NAME"
With options:
--all (to execute all tools)
--phpcs
--php-cs-fixer
--phplint
--jsonlint
--phpmd
--phpunit
Always reading your php-git.hooks.yml configuration file.
I found this very interesting, what about a PR?