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

Check only changed files #103

Open
VincentChataignier opened this issue Oct 30, 2017 · 5 comments
Open

Check only changed files #103

VincentChataignier opened this issue Oct 30, 2017 · 5 comments

Comments

@VincentChataignier
Copy link

Hello,

I think we could add the option --only-git-changed. This option will force an analysis only on the changed files.

This is just an idea. I don't know if this feature is possible for PHP-Parallel-Lint.
Library https://github.com/M6Web/Coke does this feature.

Thanks,
Best regards,

Vincent Chataignier

@VincentChataignier
Copy link
Author

For the moment I use $(git --no-pager diff --name-only --diff-filter=MARC| grep -E 'src/|tests/') to list changed files. I use this git command instead of paths and that's working.

vendor/bin/phpstan analyse -c phpstan.neon -l 1 $$(git --no-pager diff --name-only --diff-filter=MARC| grep -E 'src/|tests/')

@grogy
Copy link
Contributor

grogy commented Oct 31, 2017

Hello,

thanks for you issue. My question is about application this idea. What benefit it has? Or what is your reason for this change? Parallel-lint is very fast :-)

Thanks

@VincentChataignier
Copy link
Author

VincentChataignier commented Oct 31, 2017

Run PHP-Parallel-Lint only in changed file improve the rapidity in huge project. For example, we have approximately 3700 files to lint, that's working in approximately 150 seconds.

Use cases for --only-git-changed are for developers who want to check code before commit and push in the CI (Travis, Jenkins ...). That's improve the waiting time during development.

For the moment, we use $(git --no-pager diff --name-only --diff-filter=MARC) but I think this functionality should be added in library to benefit everyone 😃

@grogy
Copy link
Contributor

grogy commented Nov 1, 2017

Okay, I understand to your reasons and it make sense for me.

Can you add PR with test? What do you mean? :-)

VincentChataignier added a commit to VincentChataignier/PHP-Parallel-Lint that referenced this issue Nov 6, 2017
@VincentChataignier
Copy link
Author

I added a new commit about this issue. Can you check it please 😃 before my PR? I saw the similar issue #75 and my code is inspired by this one.

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

2 participants