Skip to content
This repository has been archived by the owner on Jul 1, 2023. It is now read-only.

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

Open
paladox opened this issue Sep 9, 2016 · 11 comments
Open

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

paladox opened this issue Sep 9, 2016 · 11 comments

Comments

@paladox
Copy link

paladox commented Sep 9, 2016

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

@grogy
Copy link
Contributor

grogy commented Sep 9, 2016

Hello,

how you can detect changed files?

Thanks

@paladox
Copy link
Author

paladox commented Sep 9, 2016

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
Copy link
Contributor

grogy commented Sep 9, 2016

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
Copy link
Author

paladox commented Sep 9, 2016

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
Copy link
Contributor

grogy commented Sep 9, 2016

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

@paladox
Copy link
Author

paladox commented Sep 9, 2016

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

@grogy
Copy link
Contributor

grogy commented Sep 9, 2016

@paladox
Copy link
Author

paladox commented Sep 9, 2016

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

@willemstuursma
Copy link

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

@realFlowControl
Copy link

You could use grumphp to achieve this

@exussum12
Copy link
Contributor

exussum12 commented Oct 27, 2017

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants