phpro / grumphp

A PHP code-quality tool
MIT License
4.11k stars 429 forks source link

[DRAFT] Pre push #1137

Open claudiu-cristea opened 1 month ago

claudiu-cristea commented 1 month ago
Q A
Branch master for features and deprecations
Bug fix? yes/no
New feature? yes/no
BC breaks? yes/no
Deprecations? yes/no
Documented? yes/no
Fixed tickets comma-separated list of tickets fixed by the PR, if any

New Task Checklist:

veewee commented 1 month ago

Thanks for the PR.

I'm a bit confused: There is already a draft, so wouldn't it be better to start from 1 PR and try to get that as good as possible? https://github.com/phpro/grumphp/pull/1136

claudiu-cristea commented 1 month ago

This is in a very early stage. Not ready for a review. I didn't want to mess with the previous PR

claudiu-cristea commented 1 month ago

I wasn't aware of the other PR ☹️

veewee commented 1 month ago

No problem. Feel free to give your feedback on the initial PR so that we can try to get that one as good as possible.

claudiu-cristea commented 1 month ago

Hm, I'll have to coordinate with @saidatom. The way we're getting the pushed files list is different

claudiu-cristea commented 1 month ago

Also, in this PR there's a feature that allows to configure which Git hooks to be initialized. For me, personally, checking on each commit is too agresive. I only want pre push checks. But that's me, others might want on pre commit. Making it customizable makes sense

veewee commented 1 month ago

True, I think that part could be covered by making it configurable per task basis instead of on a global basis as commented here https://github.com/phpro/grumphp/pull/1136/files#r1608281196. Not sure how easy it would be to make the 'default' configurable as well - but for BC sense it should at least be pre-commit

claudiu-cristea commented 1 month ago

@veewee, I have discussed with @saidatom. Until we decide the way to go, I'll continue to improve this. Regarding https://github.com/phpro/grumphp/pull/1136/files#r1608281196, I need to understand more what you are proposing there. You mean, for instance, that phpcs could run on a push while phpstan on commit?

veewee commented 1 month ago

Regarding https://github.com/phpro/grumphp/pull/1136/files#r1608281196, I need to understand more what you are proposing there. You mean, for instance, that phpcs could run on a push while phpstan on commit?

Indeed: the hook script is activated on both commit and push. Which task is being executed will depend on a per task configuration with default if not set.

claudiu-cristea commented 1 month ago

@veewee

Indeed: the hook script is activated on both commit and push. Which task is being executed will depend on a per task configuration with default if not set.

I think this is fixed now.

I'm trying now to add some tests for the new feature. It would help a lot to enable GitHub Actions for this PR

_DRAFT__Pre_push_·_phpro_grumphp_896ccd4