PHP-Parallel-Lint icon indicating copy to clipboard operation
PHP-Parallel-Lint copied to clipboard

Support option that only checks the php files that you changed

Open paladox opened this issue 9 years ago • 11 comments

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

paladox avatar Sep 09 '16 12:09 paladox

Hello,

how you can detect changed files?

Thanks

grogy avatar Sep 09 '16 12:09 grogy

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.

paladox avatar Sep 09 '16 12:09 paladox

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?

grogy avatar Sep 09 '16 13:09 grogy

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.

paladox avatar Sep 09 '16 13:09 paladox

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

grogy avatar Sep 09 '16 13:09 grogy

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

paladox avatar Sep 09 '16 13:09 paladox

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?

grogy avatar Sep 09 '16 13:09 grogy

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

paladox avatar Sep 09 '16 13:09 paladox

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

willemstuursma avatar Oct 04 '16 09:10 willemstuursma

You could use grumphp to achieve this

realFlowControl avatar Aug 04 '17 08:08 realFlowControl

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

exussum12 avatar Oct 27 '17 06:10 exussum12