Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance performances by grouping linters only when they can fix sources #1785

Closed
nvuillam opened this issue Aug 22, 2022 · 3 comments · Fixed by #1789
Closed

Enhance performances by grouping linters only when they can fix sources #1785

nvuillam opened this issue Aug 22, 2022 · 3 comments · Fixed by #1789
Assignees
Labels
enhancement New feature or request

Comments

@nvuillam
Copy link
Member

nvuillam commented Aug 22, 2022

  • Performances improvements: when running linters in parallel, run in the same process only the linters from same descriptor and that can update the same sources (to avoid concurrency). Other linters can be run independently.
@nvuillam nvuillam added the enhancement New feature or request label Aug 22, 2022
@nvuillam nvuillam self-assigned this Aug 22, 2022
nvuillam added a commit that referenced this issue Aug 24, 2022
* Performances improvement about parallel running of linters

Fixes #1785

* Add linter_speed on linter descriptors

* Sort linters execution by speed (slow to fast)

  - Define `linter_speed` of linter descriptors (default 3). Can be from 1 (super slow) to 5 (super fast). This is used to optimize the processing order of linters.

* typo

* lint fix

* [MegaLinter] Apply linters fixes

* add broken link

Co-authored-by: nvuillam <[email protected]>
@Kurt-von-Laven
Copy link
Collaborator

Kurt-von-Laven commented Aug 24, 2022

Does this mean it's now possible for one linter to modify files while another linter that doesn't make modifications is linting the same files?

@nvuillam
Copy link
Member Author

Yes it is :)
I don't see cases where it could create problems, as modifying linters are run before non-modifying ones
But non-modifying ones do not wait that modifying ones are completed... I could implement that but it would reduce performances... do you think it's ok that we wait for wrong feedbacks ?

@Kurt-von-Laven
Copy link
Collaborator

It seems preferable to lint the files after they have reached their final state since one run that is a bit slower is still a lot faster than two runs, and most linters sensibly output line numbers to go with their error messages that can easily be thrown off by the sorts of formatting fixes Prettier and Black do, for example. When we first set up MegaLinter, we had to tweak some linter settings to keep them from fighting with one another, and sorting those conflicts out without a predictable execution order would have been significantly more painful. Our team specifically is unlikely to be impacted by these sorts of issues since we are now aware of the possibility, but I could see it causing some grief for newcomers especially. In the meantime we will just enjoy the faster performance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants