Merge pull request #3 from FoamyGuy/pylint_to_pre_commit
pylint to precommit
This commit is contained in:
commit
c0faca0ea2
3 changed files with 24 additions and 5 deletions
4
.github/workflows/build.yml
vendored
4
.github/workflows/build.yml
vendored
|
|
@ -50,10 +50,6 @@ jobs:
|
|||
- name: Pre-commit hooks
|
||||
run: |
|
||||
pre-commit run --all-files
|
||||
- name: PyLint
|
||||
run: |
|
||||
pylint $( find . -path './adafruit*.py' )
|
||||
([[ ! -d "examples" ]] || pylint --disable=missing-docstring,invalid-name,bad-whitespace $( find . -path "./examples/*.py" ))
|
||||
- name: Run tests
|
||||
run: |
|
||||
cd tests/ && python -m unittest discover
|
||||
|
|
|
|||
|
|
@ -17,3 +17,26 @@ repos:
|
|||
- id: check-yaml
|
||||
- id: end-of-file-fixer
|
||||
- id: trailing-whitespace
|
||||
- repo: https://github.com/pycqa/pylint
|
||||
rev: pylint-2.7.1
|
||||
hooks:
|
||||
- id: pylint
|
||||
name: pylint (library code)
|
||||
types: [python]
|
||||
exclude: "^(docs/|tests/|examples/|setup.py$)"
|
||||
- repo: local
|
||||
hooks:
|
||||
- id: pylint_examples
|
||||
name: pylint (examples code)
|
||||
description: Run pylint rules on "examples/*.py" files
|
||||
entry: /usr/bin/env bash -c
|
||||
args: ['([[ ! -d "examples" ]] || for example in $(find . -path "./examples/*.py"); do pylint --disable=missing-docstring,invalid-name $example; done)']
|
||||
language: system
|
||||
- repo: local
|
||||
hooks:
|
||||
- id: pylint_tests
|
||||
name: pylint (tests code)
|
||||
description: Run pylint rules on "tests/*.py" files
|
||||
entry: /usr/bin/env bash -c
|
||||
args: ['([[ ! -d "tests" ]] || for test in $(find . -path "./tests/*.py"); do pylint --disable=missing-docstring $test; done)']
|
||||
language: system
|
||||
|
|
|
|||
|
|
@ -250,7 +250,7 @@ ignore-comments=yes
|
|||
ignore-docstrings=yes
|
||||
|
||||
# Ignore imports when computing similarities.
|
||||
ignore-imports=no
|
||||
ignore-imports=yes
|
||||
|
||||
# Minimum lines number of a similarity.
|
||||
min-similarity-lines=4
|
||||
|
|
|
|||
Loading…
Reference in a new issue