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

Make pre-commit hooks available in pylint-1.9.5 #3485

Closed
tomdodo opened this issue Apr 15, 2020 · 5 comments · May be fixed by tomdodo/pylint#1
Closed

Make pre-commit hooks available in pylint-1.9.5 #3485

tomdodo opened this issue Apr 15, 2020 · 5 comments · May be fixed by tomdodo/pylint#1
Labels
Enhancement ✨ Improvement to a component python past end of life This affect a python version we do not support anymore

Comments

@tomdodo
Copy link

tomdodo commented Apr 15, 2020

The issue is about adding the pre-commit-hooks.yaml file to pylint-1.9.5 version.
I know this issue has been fixed in pylint-2.4.0 and above.
However, we have a repo in our system that is still on python2 and the highest pylint version that is python2 compatible is 1.9.5.
Before you say 'you should migrate to python 3', this is exactly why we need this: pylint has the pylint --py3k option that will highlight any python2/3 compatibility problems in new code that is being committed, but this must run on python 2 (otherwise it won't print out any errors, see #2956)

This is issue is about retroactively readding the pre-commit-hooks.yaml to version 1.9.5.

Steps to reproduce

  1. Use pre-commit hooks in a python project specifying python2 language and pylint-1.9.5 version
  2. Configure a pre-commit hook such as
- repo: https://github.com/PyCQA/pylint
    # latest py2 compatible version
    rev: pylint-1.9.5
    hooks:
      - id: pylint
        name: python2/3 compatibility
        language: python
        # need py2 for the py3 compatibility. If running on py3, check passes even with errors.
        language_version: python2
        args: [--py3k, -r=n, -f=parseable]
        types: [python]
  1. The git commit fails with
An error has occurred: InvalidManifestError:
=====> /Users/tommaso/.cache/pre-commit/repoayufqei0/.pre-commit-hooks.yaml does not exist
Check the log at /Users/tommaso/.cache/pre-commit/pre-commit.log

Current behavior

Cannot use pylint-1.9.5 as a hook from another repo's pre-commit-config.yaml.

Expected behavior

Should be able to use pylint-1.9.5 as a hook from another repo's pre-commit-config.yaml

pylint --version output

N/A

@tomdodo
Copy link
Author

tomdodo commented Apr 15, 2020

Proposed a simple PR to fix it
tomdodo#1

However I'm waiting on more guidance on how to congtribute to this project, as it is the first time!

@Pierre-Sassoulas
Copy link
Member

Hello @tomdodo , thank you for opening a ticket this was the right way to go about it (pull request directly can work too for non controversial changes and that's just my opinion :) ). You can open the pull request directly in this repository. This request seems sensible but I'm not completely sure about the way the old release are updated so I'll probably need a review of the pull request by someone else before merging it.

@Pierre-Sassoulas Pierre-Sassoulas added Enhancement ✨ Improvement to a component python past end of life This affect a python version we do not support anymore labels Apr 19, 2020
@Pierre-Sassoulas
Copy link
Member

@tomdodo, you need to do a pull request in the main pylint repository in pylint's master branch. The one you linked is in your own repository between one of your branch and your own master.

@tmotyl
Copy link

tmotyl commented Apr 21, 2021

as a workaround you can use "local" pre-commit hook configuration https://pre-commit.com/#repository-local-hooks This way you can run tools which don't have the pre-commit-hooks.yaml file

@Pierre-Sassoulas
Copy link
Member

Closing as there is a workaround and we're not maintaining python 2 anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement ✨ Improvement to a component python past end of life This affect a python version we do not support anymore
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants