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

feat: Add Pylint and make it work in a virtualenv #142

Merged
merged 2 commits into from
Apr 27, 2023

Conversation

sgarcialaguna
Copy link
Contributor

Pylint is a very popular linter, unfortunately it doesn't work out of the box if you are using a virtualenv (as you should be doing). This issue in mason.nvim describes why it doesn't work and how to apply a workaround: williamboman/mason.nvim#668

@luxus
Copy link
Member

luxus commented Apr 16, 2023

can someone with python skills say something about this?
i don't use it at the moment

@Uzaaft
Copy link
Member

Uzaaft commented Apr 17, 2023

I'm not sure the path bit is needed? When spawning nvim in a poetry shell, everything works fine with pylint and my virtual env.

@sgarcialaguna-mms
Copy link

sgarcialaguna-mms commented Apr 17, 2023

Does it recognize imports that are only available in your venv? Does it pick up your .pylintrc? Does it also work if you run poetry run nvim . from a regular shell?

@Uzaaft
Copy link
Member

Uzaaft commented Apr 17, 2023

Does it recognize imports that are only available in your venv? Does it pick up your .pylintrc? Does it also work if you run poetry run nvim . from a regular shell?

Yes to all of them.
I just run poetry shell and then nvim

@sgarcialaguna-mms
Copy link

Hmm, definitely not working for me. I'm not the first one to have encountered that problem either.

@Uzaaft
Copy link
Member

Uzaaft commented Apr 17, 2023

I'll see if there are any testers in the Astronvim channel that has a similar workflow to you.
@luxus An idea could be to split this into a python pack, and a python-venv pack? I'm just throwing ideas out there

Copy link
Member

@mehalter mehalter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please format with stylua

Copy link
Member

@mehalter mehalter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@mehalter mehalter merged commit 6d92e41 into AstroNvim:main Apr 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants