Implement pre-commit plugins for VSCode/PyCharm/Intellij maybe
#35,253 opened on Oct 29, 2023
Repository metrics
- Stars
- (44,809 stars)
- PR merge metrics
- (Avg merge 7d 18h) (834 merged PRs in 30d)
Description
Body
We are one of the biggest users of pre-commit framework and we have A LOT of pre-commit checks that not only tell you what you should fix but also often fix things for you. This is happening "early" (i.e. at commit time if you run pre-commit install. However, seems that it should be possible to run them even earlier in software development cycle - i.e. in the IDE as you modify files.
It shoudl be possible to build a plugin for IntelliJ(PyCharm) and VSCode that would register to the same files that .pre-commit-config.yml describe and run pre-commits in the background for those change - either fixing files as you save them or surfacing the errors it finds as IDE errors - with link to the sources and corrective actions even (possibly as long term option).
I think we have everything we need from the pre-commit side of things - also our pre-commits are optimized to be as fsat as possible especially a lot of emphasis is put on caching in some cases. So it should be entirely suitable to run those pre-commits as part of such plugins.
If someone has an experience with writing IntelliJ / VSCode plugins, that might be an interesting, good first task that we could even contribute to the general community - it should be generic. Airflow does not use anything "special" in pre-commit, everything we do there is "generically" supported by standard pre-commit (we just wrap the calls to pre-commit in breeze to allow for autcompletion and some shorthand arguments).
Also see discussion in https://github.com/apache/airflow/pull/35236#issuecomment-1784118677
Committer
- I acknowledge that I am a maintainer/committer of the Apache Airflow project.