Skip to content

Question: setting up pylint check #1937

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

Closed
ehontoria opened this issue Jun 9, 2021 · 2 comments
Closed

Question: setting up pylint check #1937

ehontoria opened this issue Jun 9, 2021 · 2 comments

Comments

@ehontoria
Copy link

ehontoria commented Jun 9, 2021

Description

Hi folks! I'm trying to set up using pylint with pylint-django in my repository but running into an issue where if I run pylint on the command line everything is fine, but when I try to run it as part of pre-commit I end up with a lot of the following:

some_file.py:8:0: E0401: Unable to import 'some-package' (import-error)

Configuration

I'm using the following pre-commit configuration:

-   repo: https://github.com/PyCQA/pylint
    rev: pylint-2.7.4
    hooks:
        - id: pylint
          args: ["--rcfile", ".pylintrc"]
          additional_dependencies:
              - pylint-django==2.3.0
              - astroid==2.5.2
              - django==1.11.29

Unfortunately multiple upstream issues means I'm pigeon-holed into these versions for the moment.

pre-commit version: 1.21.0
python version: 3.7.7

@ehontoria
Copy link
Author

Found your post on stack overflow, apologies for the dupe!

For reference: https://stackoverflow.com/questions/61238318/pylint-and-pre-commit-hook-unable-to-import

@asottile
Copy link
Member

oh shoot sorry this slipped! I've been really busy lately -- you might also find more resources here (where I tend to link pylint related things): pre-commit/pre-commit-hooks#157

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants