JakubOnderka / PHP-Parallel-Lint

This tool check syntax of PHP files faster than serial check with fancier output.
Other
647 stars 62 forks source link

Support option that only checks the php files that you changed #75

Open paladox opened 8 years ago

paladox commented 8 years ago

Hi please could you support only checking the php files you changed in an option please?

grogy commented 8 years ago

Hello,

how you can detect changed files?

Thanks

paladox commented 8 years ago

We could use git, see how Wikimedia do it https://github.com/wikimedia/integration-config/blob/master/jjb/macro.yaml#L541 and https://github.com/wikimedia/integration-jenkins/blob/master/bin/git-changed-in-head#L42 please.

We need to do that for mediawiki due to the amout of files.

grogy commented 8 years ago

Yes, it is good idea. But.. what if project don't use git? It is next dependency (for that option).

So - is not a solution use --exclude for ignore libraries? Next good option is -j - it can run a linter in more threads. What do you mean about it?

paladox commented 8 years ago

Well we could support a new option and call it like -h probably, and write in the README that this option requires git. So we doint need to add dependency on anything but just put a not a read me file explaning that you need to to run -h.

Also exclude, excludes the files from linting which is not what we want.

grogy commented 8 years ago

So ok.. can you send PR? I can help you with code-review and I can help with design changes ;-)

paladox commented 8 years ago

Oh, but I'm not sure how to do this.

grogy commented 8 years ago

Start point for you will be:

1/ configuration for options - https://github.com/JakubOnderka/PHP-Parallel-Lint/blob/master/src/Settings.php#L125 2/ process runner - https://github.com/JakubOnderka/PHP-Parallel-Lint/blob/master/src/Manager.php#L46

It is better now?

paladox commented 8 years ago

Yep, thanks. I will see if I can do it now :)

willemstuursma commented 8 years ago

I don't think this tool should do this, but it's the job of the task runner. See #58.

realFlowControl commented 7 years ago

You could use grumphp to achieve this

exussum12 commented 7 years ago

This option is already supported ?

git diff origin/master --name-only -- '*.php' | parallel-lint --stdin

Will use git as your VCS to tell parallel-lint which files to look for

Example

git diff origin/master  --name-only -- '*.php' | parallel-lint --stdin 
PHP 7.0.24 | 10 parallel jobs
...                                                          3/3 (100 %)

Checked 3 files in 0 seconds