adafruit / cookiecutter-adafruit-circuitpython

Cookiecutter template for Adafruit's CircuitPython libraries.
MIT License
22 stars 37 forks source link

Remove pylint process from github workflow #109

Closed hugodahl closed 3 years ago

hugodahl commented 3 years ago

This pull-request addresses issue #104, by moving the pylint process from being part of the GitHub workflow (from .github/workflows/build.yml) to being part of the pre-commit workflow, so that it can be run on individual contributors' computers.

askpatrickw commented 3 years ago

Hey @hugodahl I think you're really close on this. Try the PR again, but remove all the commented out lines.

kattni commented 3 years ago

@hugodahl I only see the removal of Pylint from the build.yml file, and not the addition of it to the pre-commit. Please let me know if I'm missing something. I don't see anything in other PRs.

hugodahl commented 3 years ago

This should be a draft pull request. At least that's what I'd clicked when I created it! Wouldn't be my first time clicking the wrong button... on any day!

kattni commented 3 years ago

No worries! I simply wanted to make sure I wasn't missing something. Thanks for putting it into draft status!

hugodahl commented 3 years ago

I've made the initial change to have the pylint calls be done in pre-commit. However, given that there's a little time this evening, I would like to try and make the library code execution use the pre-commit hook for pylint, rather than the shell execution. This would help keep things neater and more in line with how we would expect pylint to work, if not for the current 2.7.0 issue with the ./examples/*.py checks.

jepler commented 3 years ago

Did this work out? I've been researching pylint & pre-commit and found that the recommendation is to NOT actually use repo: https://github.com/pycqa/pylint in pre-commit -- see https://github.com/pre-commit/pre-commit-hooks/issues/157 and https://pre-commit.com/#repository-local-hooks

I switched my own (non-circuitpython) project to a stanza like

-   repo: local
    hooks:
    -   id: pylint
        name: pylint
        entry: pylint
        language: python
        types: [python]
        additional_dependencies: [beautifulsoup4, requests, pylint]

otherwise I got import-error diagnostics from pylint.