tea icon indicating copy to clipboard operation
tea copied to clipboard

Use `php-parallel-lint/php-parallel-lint` for php linting

Open simonschaufi opened this issue 1 year ago • 5 comments

Suggestion: use php-parallel-lint/php-parallel-lint for php linting

simonschaufi avatar Jan 26 '24 21:01 simonschaufi

Thanks for the suggestion, @simonschaufi!

I've just run the non-parallel PHP lint of my seminars extension with ~120k lines of PHP: PHP-linting all files takes ~2.0 seconds on my (fat) 2021 desktop machine and ~2.5 seconds on my ~2020 Thinkpad when it's running on battery. (Both numbers are fore the second run so the files are already cached.)

Those numbers are "good enough" for me, and I'm not sure having the better performance from parallelizing the linting would warrant the added complexity and the additional tool.

Do you have different numbers, @simonschaufi, or am I missing something here?

oliverklee avatar Jan 27 '24 10:01 oliverklee

The amount of php files is so small in the tea extension that you can't really see a big difference. On a huge extension that I have with 479 files, it makes a massive difference:

tea way:

real    0m8,273s
user    0m22,092s
sys     0m10,683s

parallel:

real    0m1,066s
user    0m3,122s
sys     0m2,634s

simonschaufi avatar Jan 29 '24 11:01 simonschaufi

@simonschaufi Out pure curiosity, how big is your extension (in terms of lines of code)?

oliverklee avatar Jan 29 '24 11:01 oliverklee

Huge! It's a whole shop application.

https://mattstauffer.com/blog/how-to-count-the-number-of-lines-of-code-in-a-php-project/

phploc 7.0.2 by Sebastian Bergmann.

Directories                                         75
Files                                              480

Size
  Lines of Code (LOC)                            91137
  Comment Lines of Code (CLOC)                   20918 (22.95%)
  Non-Comment Lines of Code (NCLOC)              70219 (77.05%)
  Logical Lines of Code (LLOC)                   17058 (18.72%)

simonschaufi avatar Jan 29 '24 11:01 simonschaufi

We've just talked about this on our team call: Yes, we'd love to have this!

oliverklee avatar Feb 05 '24 17:02 oliverklee