You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "potiuk (via GitHub)" <gi...@apache.org> on 2023/10/29 13:57:01 UTC

[I] Implement pre-commit plugins for VSCode/PyCharm/Intellij maybe [airflow]

potiuk opened a new issue, #35253:
URL: https://github.com/apache/airflow/issues/35253

   ### 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
   
   - [X] I acknowledge that I am a maintainer/committer of the Apache Airflow project.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Implement pre-commit plugins for VSCode/PyCharm/Intellij maybe [airflow]

Posted by "ad-m-ss (via GitHub)" <gi...@apache.org>.
ad-m-ss commented on issue #35253:
URL: https://github.com/apache/airflow/issues/35253#issuecomment-1818003754

   Based on project other than Apache Airflow, VSCode extensions work great with pre-commit for our internal project. I switched from Python Language Server (deprecated support for any linters) and Black plugin to pre-commit plugin to VSCode, and works smoothly. 
   
   Except documentation, Airflow may need to review if hooks types are successfully detected (see https://marketplace.visualstudio.com/items?itemName=elagil.pre-commit-helper#detection-of-hook-type ), and we may need extra remarks about it in `pre-commit.config.yml` to maintain future compatibility.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Implement pre-commit plugins for VSCode/PyCharm/Intellij maybe [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on issue #35253:
URL: https://github.com/apache/airflow/issues/35253#issuecomment-1805254488

   > Hey @potiuk, I would love to do it. But I guess there is already an extension for [vscode](https://marketplace.visualstudio.com/items?itemName=elagil.pre-commit-helper) which does exactly what you require.
   
   If so:
   
   * find it
   * test it
   * describe in the CONTRIBUTING guide how to use it
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Implement pre-commit plugins for VSCode/PyCharm/Intellij maybe [airflow]

Posted by "bolkedebruin (via GitHub)" <gi...@apache.org>.
bolkedebruin commented on issue #35253:
URL: https://github.com/apache/airflow/issues/35253#issuecomment-1784137813

   Black uses a protocol for this which allows integration with any ide that supports this. So they integrate with intellij / vscode etc without too much effort. 
   
   https://black.readthedocs.io/en/stable/integrations/editors.html
   
   Might be something to look at. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Implement pre-commit plugins for VSCode/PyCharm/Intellij maybe [airflow]

Posted by "vagi8 (via GitHub)" <gi...@apache.org>.
vagi8 commented on issue #35253:
URL: https://github.com/apache/airflow/issues/35253#issuecomment-1804871249

   Hey @potiuk, I would love to do it. But I guess there is already an extension for [vscode](https://marketplace.visualstudio.com/items?itemName=elagil.pre-commit-helper) which does exactly what you require. 
   
   Could you elaborate if you need something different than what already exists or anything totally different ?  


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Implement pre-commit plugins for VSCode/PyCharm/Intellij maybe [airflow]

Posted by "khushi-98 (via GitHub)" <gi...@apache.org>.
khushi-98 commented on issue #35253:
URL: https://github.com/apache/airflow/issues/35253#issuecomment-1867892829

   <!--
   /* Font Definitions */
   @font-face
   	{font-family:"Cambria Math";
   	panose-1:2 4 5 3 5 4 6 3 2 4;}
   @font-face
   	{font-family:Calibri;
   	panose-1:2 15 5 2 2 2 4 3 2 4;}
   /* Style Definitions */
   p.MsoNormal, li.MsoNormal, div.MsoNormal
   	{margin:0cm;
   	font-size:11.0pt;
   	font-family:"Calibri",sans-serif;}
   a:link, span.MsoHyperlink
   	{mso-style-priority:99;
   	color:blue;
   	text-decoration:underline;}
   .MsoChpDefault
   	{mso-style-type:export-only;}
   @page WordSection1
   	{size:612.0pt 792.0pt;
   	margin:72.0pt 72.0pt 72.0pt 72.0pt;}
   div.WordSection1
   	{page:WordSection1;}
   -->Good evening sir,I am a beginner. This is my first issue, so I need some of your guidance. Can you tell how to start work on this issue? Sent from Mail for Windows From: Jarek PotiukSent: 21 December 2023 14:31To: apache/airflowCc: Khushi Bansal; AssignSubject: Re: [apache/airflow] Implement pre-commit plugins for VSCode/PyCharm/Intellij maybe (Issue #35253) Assigned #35253 to @khushi-98.—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were assigned.Message ID: ***@***.***> 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Implement pre-commit plugins for VSCode/PyCharm/Intellij maybe [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on issue #35253:
URL: https://github.com/apache/airflow/issues/35253#issuecomment-1818095376

   > Based on project other than Apache Airflow, VSCode extensions work great with pre-commit for our internal project. I switched from Python Language Server (deprecated support for any linters) and Black plugin to pre-commit plugin to VSCode, and works smoothly.
   > 
   > Except documentation, Airflow may need to review if hooks types are successfully detected (see https://marketplace.visualstudio.com/items?itemName=elagil.pre-commit-helper#detection-of-hook-type ), and we may need extra remarks about it in `pre-commit.config.yml` to maintain future compatibility.
   
   Looks good. This is very much what I have imagined as such extension could do - looks like indeed someone who uses vscode might want to make PR to adjust some of the description etc. to get the hooks properly detected. Would be nice to see something like that for IntelliJ.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Implement pre-commit plugins for VSCode/PyCharm/Intellij maybe [airflow]

Posted by "vagi8 (via GitHub)" <gi...@apache.org>.
vagi8 commented on issue #35253:
URL: https://github.com/apache/airflow/issues/35253#issuecomment-1805256120

   Sure, I will go ahead and create a PR. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Implement pre-commit plugins for VSCode/PyCharm/Intellij maybe [airflow]

Posted by "khushi-98 (via GitHub)" <gi...@apache.org>.
khushi-98 commented on issue #35253:
URL: https://github.com/apache/airflow/issues/35253#issuecomment-1865886320

   I would like to work on this error.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Implement pre-commit plugins for VSCode/PyCharm/Intellij maybe [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on issue #35253:
URL: https://github.com/apache/airflow/issues/35253#issuecomment-1784221686

   > Black uses a protocol for this which allows integration with any ide that supports this. So they integrate with intellij / vscode etc without too much effort.
   > 
   > https://black.readthedocs.io/en/stable/integrations/editors.html
   > 
   > Might be something to look at.
   
   Yes. But if you ever interacted with pre-commit creator (I did, and some other maintainer did), he will likely not cooperate on that. You can try, but the experience of trying to contribute to pre-commit something as simple as auto-complete was, let's say strange. So I am afraid what's left is to do wrapper around pre-commit.
   
   See https://github.com/pre-commit/pre-commit/issues/1119 if you are interested.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org