pre-commit, black, isort. how to use with pylint?

Hi, Firstly, thank you for the awesome work. Currently I’m using pre-commit with black, isort and another small hooks. What the preferable way to integrate pylint (in terms of workflow) in my use-case? Thank you [cid:image001.jpg@01D7471F.DAD3F080]<https://beyondminds.ai/> Eli Simhayev Machine Learning Engineer [cid:image003.png@01D7471F.DAD3F080]<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.linkedin.com%2Fcompany%2Fbeyondminds%2F&data=04%7C01%7CEli.Simhayev%40beyondminds.ai%7C372f05dc461b4d3b881608d8e6c00260%7C6349c26f0b0845fe885cde70ffcf0a2c%7C0%7C0%7C637513059675015077%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8Fz8EbGXrNG85ox8a%2Fdc8R1LGmvNRo3OYGysxICTfZ0%3D&reserved=0>[cid:image004.png@01D7471F.DAD3F080]<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Ftwitter.com%2FBeyondMindsAI&data=04%7C01%7CEli.Simhayev%40beyondminds.ai%7C372f05dc461b4d3b881608d8e6c00260%7C6349c26f0b0845fe885cde70ffcf0a2c%7C0%7C0%7C637513059675015077%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=ZvenwUemIM55v%2BnX6LkgaepI3kQcH6%2BOTMvm7fP9HZI%3D&reserved=0> The contents of this email message and any attachments are intended solely for the addressee(s) and may contain confidential and/or privileged information of BeyondMinds and may be legally protected from disclosure. If you are not the intended recipient of this message or their agent, or if this message has been addressed to you in error, please immediately alert the sender by reply email and then delete this message and any attachments. If you are not the intended recipient, you are hereby notified that any use, dissemination, copying, or storage of this message or its attachments is strictly prohibited.

On Wed, May 12, 2021 at 5:49 AM Eli Simhayev <Eli.Simhayev@beyondminds.ai> wrote:
It's unclear what your workflow is currently such that it doesn't seem like a recommendation could be made. For example, I could assume you use vim and either coc.vim or vim-ale and would suggest you add pylint as a linter for Python files to the configuration for either of those plugins. That would give you in-the-moment warnings while adding it to pre-commit to ensure you didn't miss something. But I don't know what your actual workflow is beyond the fact you use pre-commit and pylint can be easily added to that (to the best of my knowledge).

Hi Ian, Thank you for your quick answer. Let’s say my repo’s name is foo, and I have a .pre-commit config file: [cid:image001.png@01D74741.2E339DE0] Now I want to run pylint afterwards automatically. I found this: Overview | Improve Your Code with Pylint and Black | Adafruit Learning System<https://learn.adafruit.com/improve-your-code-with-pylint?view=all> But they suggest running pylint manually. Is there a way to use pylint in pre-commit style? Thank you מאת: Ian Stapleton Cordasco <graffatcolmingov@gmail.com> נשלח: Wednesday, 12 May 2021 13:54 אל: Eli Simhayev <Eli.Simhayev@beyondminds.ai> עותק: code-quality@python.org נושא: Re: [code-quality] pre-commit, black, isort. how to use with pylint? On Wed, May 12, 2021 at 5:49 AM Eli Simhayev <Eli.Simhayev@beyondminds.ai<mailto:Eli.Simhayev@beyondminds.ai>> wrote: Hi, Firstly, thank you for the awesome work. Currently I’m using pre-commit with black, isort and another small hooks. What the preferable way to integrate pylint (in terms of workflow) in my use-case? It's unclear what your workflow is currently such that it doesn't seem like a recommendation could be made. For example, I could assume you use vim and either coc.vim or vim-ale and would suggest you add pylint as a linter for Python files to the configuration for either of those plugins. That would give you in-the-moment warnings while adding it to pre-commit to ensure you didn't miss something. But I don't know what your actual workflow is beyond the fact you use pre-commit and pylint can be easily added to that (to the best of my knowledge). The contents of this email message and any attachments are intended solely for the addressee(s) and may contain confidential and/or privileged information of BeyondMinds and may be legally protected from disclosure. If you are not the intended recipient of this message or their agent, or if this message has been addressed to you in error, please immediately alert the sender by reply email and then delete this message and any attachments. If you are not the intended recipient, you are hereby notified that any use, dissemination, copying, or storage of this message or its attachments is strictly prohibited.

Looking at https://pre-commit.com/hooks.html I see there is a hook for pylint. So yes, you can use it with pre-commit. I feel like this answer can't possibly be so simple though as searching pre-commit and pylint brought up that page instantly Sent from my phone with my typo-happy thumbs. Please excuse my brevity On Wed, May 12, 2021, 07:12 Eli Simhayev <Eli.Simhayev@beyondminds.ai> wrote:

Hello Eli, The way to run pylint with pre-commit is as a system hook in a venv where the dependencies are accessible: ```yaml - repo: local hooks: - id: pylint name: pylint entry: pylint language: system args: ["-sn", "-rn"] types: [python] ``` Best regards, Le mer. 12 mai 2021 à 14:32, Eli Simhayev <Eli.Simhayev@beyondminds.ai> a écrit :

I apologize for my ignorance, I missed that. Thank you מאת: Pierre Sassoulas <pierre.sassoulas@gmail.com> נשלח: Wednesday, 12 May 2021 15:36 אל: Eli Simhayev <Eli.Simhayev@beyondminds.ai> עותק: Ian Stapleton Cordasco <graffatcolmingov@gmail.com>; code-quality@python.org נושא: Re: [code-quality] Re: pre-commit, black, isort. how to use with pylint? Hello Eli, The way to run pylint with pre-commit is as a system hook in a venv where the dependencies are accessible: ```yaml - repo: local hooks: - id: pylint name: pylint entry: pylint language: system args: ["-sn", "-rn"] types: [python] ``` Best regards, Le mer. 12 mai 2021 à 14:32, Eli Simhayev <Eli.Simhayev@beyondminds.ai<mailto:Eli.Simhayev@beyondminds.ai>> a écrit : Hi Ian, Thank you for your quick answer. Let’s say my repo’s name is foo, and I have a .pre-commit config file: [cid:image001.png@01D74745.8D34EB10] Now I want to run pylint afterwards automatically. I found this: Overview | Improve Your Code with Pylint and Black | Adafruit Learning System<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flearn.adafruit.com%2Fimprove-your-code-with-pylint%3Fview%3Dall&data=04%7C01%7CEli.Simhayev%40beyondminds.ai%7Ce51d302609f64c7e64c908d915428bc9%7C6349c26f0b0845fe885cde70ffcf0a2c%7C0%7C0%7C637564197836234751%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=4F1GAQPaJH3YA2MXK%2FUXLZ90cQoDJIsO8acIyFDzPD0%3D&reserved=0> But they suggest running pylint manually. Is there a way to use pylint in pre-commit style? Thank you מאת: Ian Stapleton Cordasco <graffatcolmingov@gmail.com<mailto:graffatcolmingov@gmail.com>> נשלח: Wednesday, 12 May 2021 13:54 אל: Eli Simhayev <Eli.Simhayev@beyondminds.ai<mailto:Eli.Simhayev@beyondminds.ai>> עותק: code-quality@python.org<mailto:code-quality@python.org> נושא: Re: [code-quality] pre-commit, black, isort. how to use with pylint? On Wed, May 12, 2021 at 5:49 AM Eli Simhayev <Eli.Simhayev@beyondminds.ai<mailto:Eli.Simhayev@beyondminds.ai>> wrote: Hi, Firstly, thank you for the awesome work. Currently I’m using pre-commit with black, isort and another small hooks. What the preferable way to integrate pylint (in terms of workflow) in my use-case? It's unclear what your workflow is currently such that it doesn't seem like a recommendation could be made. For example, I could assume you use vim and either coc.vim or vim-ale and would suggest you add pylint as a linter for Python files to the configuration for either of those plugins. That would give you in-the-moment warnings while adding it to pre-commit to ensure you didn't miss something. But I don't know what your actual workflow is beyond the fact you use pre-commit and pylint can be easily added to that (to the best of my knowledge). The contents of this email message and any attachments are intended solely for the addressee(s) and may contain confidential and/or privileged information of BeyondMinds and may be legally protected from disclosure. If you are not the intended recipient of this message or their agent, or if this message has been addressed to you in error, please immediately alert the sender by reply email and then delete this message and any attachments. If you are not the intended recipient, you are hereby notified that any use, dissemination, copying, or storage of this message or its attachments is strictly prohibited. _______________________________________________ code-quality mailing list -- code-quality@python.org<mailto:code-quality@python.org> To unsubscribe send an email to code-quality-leave@python.org<mailto:code-quality-leave@python.org> https://mail.python.org/mailman3/lists/code-quality.python.org/<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmail.python.org%2Fmailman3%2Flists%2Fcode-quality.python.org%2F&data=04%7C01%7CEli.Simhayev%40beyondminds.ai%7Ce51d302609f64c7e64c908d915428bc9%7C6349c26f0b0845fe885cde70ffcf0a2c%7C0%7C0%7C637564197836244748%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=2viJKMGMxiZmR%2BMCA04p5O3hrqGOc%2BtX59HWAoPaiFg%3D&reserved=0> Member address: pierre.sassoulas@gmail.com<mailto:pierre.sassoulas@gmail.com> The contents of this email message and any attachments are intended solely for the addressee(s) and may contain confidential and/or privileged information of BeyondMinds and may be legally protected from disclosure. If you are not the intended recipient of this message or their agent, or if this message has been addressed to you in error, please immediately alert the sender by reply email and then delete this message and any attachments. If you are not the intended recipient, you are hereby notified that any use, dissemination, copying, or storage of this message or its attachments is strictly prohibited.

On Wed, May 12, 2021 at 5:49 AM Eli Simhayev <Eli.Simhayev@beyondminds.ai> wrote:
It's unclear what your workflow is currently such that it doesn't seem like a recommendation could be made. For example, I could assume you use vim and either coc.vim or vim-ale and would suggest you add pylint as a linter for Python files to the configuration for either of those plugins. That would give you in-the-moment warnings while adding it to pre-commit to ensure you didn't miss something. But I don't know what your actual workflow is beyond the fact you use pre-commit and pylint can be easily added to that (to the best of my knowledge).

Hi Ian, Thank you for your quick answer. Let’s say my repo’s name is foo, and I have a .pre-commit config file: [cid:image001.png@01D74741.2E339DE0] Now I want to run pylint afterwards automatically. I found this: Overview | Improve Your Code with Pylint and Black | Adafruit Learning System<https://learn.adafruit.com/improve-your-code-with-pylint?view=all> But they suggest running pylint manually. Is there a way to use pylint in pre-commit style? Thank you מאת: Ian Stapleton Cordasco <graffatcolmingov@gmail.com> נשלח: Wednesday, 12 May 2021 13:54 אל: Eli Simhayev <Eli.Simhayev@beyondminds.ai> עותק: code-quality@python.org נושא: Re: [code-quality] pre-commit, black, isort. how to use with pylint? On Wed, May 12, 2021 at 5:49 AM Eli Simhayev <Eli.Simhayev@beyondminds.ai<mailto:Eli.Simhayev@beyondminds.ai>> wrote: Hi, Firstly, thank you for the awesome work. Currently I’m using pre-commit with black, isort and another small hooks. What the preferable way to integrate pylint (in terms of workflow) in my use-case? It's unclear what your workflow is currently such that it doesn't seem like a recommendation could be made. For example, I could assume you use vim and either coc.vim or vim-ale and would suggest you add pylint as a linter for Python files to the configuration for either of those plugins. That would give you in-the-moment warnings while adding it to pre-commit to ensure you didn't miss something. But I don't know what your actual workflow is beyond the fact you use pre-commit and pylint can be easily added to that (to the best of my knowledge). The contents of this email message and any attachments are intended solely for the addressee(s) and may contain confidential and/or privileged information of BeyondMinds and may be legally protected from disclosure. If you are not the intended recipient of this message or their agent, or if this message has been addressed to you in error, please immediately alert the sender by reply email and then delete this message and any attachments. If you are not the intended recipient, you are hereby notified that any use, dissemination, copying, or storage of this message or its attachments is strictly prohibited.

Looking at https://pre-commit.com/hooks.html I see there is a hook for pylint. So yes, you can use it with pre-commit. I feel like this answer can't possibly be so simple though as searching pre-commit and pylint brought up that page instantly Sent from my phone with my typo-happy thumbs. Please excuse my brevity On Wed, May 12, 2021, 07:12 Eli Simhayev <Eli.Simhayev@beyondminds.ai> wrote:

Hello Eli, The way to run pylint with pre-commit is as a system hook in a venv where the dependencies are accessible: ```yaml - repo: local hooks: - id: pylint name: pylint entry: pylint language: system args: ["-sn", "-rn"] types: [python] ``` Best regards, Le mer. 12 mai 2021 à 14:32, Eli Simhayev <Eli.Simhayev@beyondminds.ai> a écrit :

I apologize for my ignorance, I missed that. Thank you מאת: Pierre Sassoulas <pierre.sassoulas@gmail.com> נשלח: Wednesday, 12 May 2021 15:36 אל: Eli Simhayev <Eli.Simhayev@beyondminds.ai> עותק: Ian Stapleton Cordasco <graffatcolmingov@gmail.com>; code-quality@python.org נושא: Re: [code-quality] Re: pre-commit, black, isort. how to use with pylint? Hello Eli, The way to run pylint with pre-commit is as a system hook in a venv where the dependencies are accessible: ```yaml - repo: local hooks: - id: pylint name: pylint entry: pylint language: system args: ["-sn", "-rn"] types: [python] ``` Best regards, Le mer. 12 mai 2021 à 14:32, Eli Simhayev <Eli.Simhayev@beyondminds.ai<mailto:Eli.Simhayev@beyondminds.ai>> a écrit : Hi Ian, Thank you for your quick answer. Let’s say my repo’s name is foo, and I have a .pre-commit config file: [cid:image001.png@01D74745.8D34EB10] Now I want to run pylint afterwards automatically. I found this: Overview | Improve Your Code with Pylint and Black | Adafruit Learning System<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flearn.adafruit.com%2Fimprove-your-code-with-pylint%3Fview%3Dall&data=04%7C01%7CEli.Simhayev%40beyondminds.ai%7Ce51d302609f64c7e64c908d915428bc9%7C6349c26f0b0845fe885cde70ffcf0a2c%7C0%7C0%7C637564197836234751%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=4F1GAQPaJH3YA2MXK%2FUXLZ90cQoDJIsO8acIyFDzPD0%3D&reserved=0> But they suggest running pylint manually. Is there a way to use pylint in pre-commit style? Thank you מאת: Ian Stapleton Cordasco <graffatcolmingov@gmail.com<mailto:graffatcolmingov@gmail.com>> נשלח: Wednesday, 12 May 2021 13:54 אל: Eli Simhayev <Eli.Simhayev@beyondminds.ai<mailto:Eli.Simhayev@beyondminds.ai>> עותק: code-quality@python.org<mailto:code-quality@python.org> נושא: Re: [code-quality] pre-commit, black, isort. how to use with pylint? On Wed, May 12, 2021 at 5:49 AM Eli Simhayev <Eli.Simhayev@beyondminds.ai<mailto:Eli.Simhayev@beyondminds.ai>> wrote: Hi, Firstly, thank you for the awesome work. Currently I’m using pre-commit with black, isort and another small hooks. What the preferable way to integrate pylint (in terms of workflow) in my use-case? It's unclear what your workflow is currently such that it doesn't seem like a recommendation could be made. For example, I could assume you use vim and either coc.vim or vim-ale and would suggest you add pylint as a linter for Python files to the configuration for either of those plugins. That would give you in-the-moment warnings while adding it to pre-commit to ensure you didn't miss something. But I don't know what your actual workflow is beyond the fact you use pre-commit and pylint can be easily added to that (to the best of my knowledge). The contents of this email message and any attachments are intended solely for the addressee(s) and may contain confidential and/or privileged information of BeyondMinds and may be legally protected from disclosure. If you are not the intended recipient of this message or their agent, or if this message has been addressed to you in error, please immediately alert the sender by reply email and then delete this message and any attachments. If you are not the intended recipient, you are hereby notified that any use, dissemination, copying, or storage of this message or its attachments is strictly prohibited. _______________________________________________ code-quality mailing list -- code-quality@python.org<mailto:code-quality@python.org> To unsubscribe send an email to code-quality-leave@python.org<mailto:code-quality-leave@python.org> https://mail.python.org/mailman3/lists/code-quality.python.org/<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmail.python.org%2Fmailman3%2Flists%2Fcode-quality.python.org%2F&data=04%7C01%7CEli.Simhayev%40beyondminds.ai%7Ce51d302609f64c7e64c908d915428bc9%7C6349c26f0b0845fe885cde70ffcf0a2c%7C0%7C0%7C637564197836244748%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=2viJKMGMxiZmR%2BMCA04p5O3hrqGOc%2BtX59HWAoPaiFg%3D&reserved=0> Member address: pierre.sassoulas@gmail.com<mailto:pierre.sassoulas@gmail.com> The contents of this email message and any attachments are intended solely for the addressee(s) and may contain confidential and/or privileged information of BeyondMinds and may be legally protected from disclosure. If you are not the intended recipient of this message or their agent, or if this message has been addressed to you in error, please immediately alert the sender by reply email and then delete this message and any attachments. If you are not the intended recipient, you are hereby notified that any use, dissemination, copying, or storage of this message or its attachments is strictly prohibited.
participants (3)
-
Eli Simhayev
-
Ian Stapleton Cordasco
-
Pierre Sassoulas