Merge pull request #57 from adafruit/patch
Pylint and RTD update patch, and other fixes
This commit is contained in:
commit
b2e9445e7a
4 changed files with 21 additions and 13 deletions
4
.github/workflows/build.yml
vendored
4
.github/workflows/build.yml
vendored
|
|
@ -42,9 +42,9 @@ jobs:
|
||||||
# (e.g. - apt-get: gettext, etc; pip: circuitpython-build-tools, requirements.txt; etc.)
|
# (e.g. - apt-get: gettext, etc; pip: circuitpython-build-tools, requirements.txt; etc.)
|
||||||
run: |
|
run: |
|
||||||
source actions-ci/install.sh
|
source actions-ci/install.sh
|
||||||
- name: Pip install pylint, Sphinx, pre-commit
|
- name: Pip install Sphinx, pre-commit
|
||||||
run: |
|
run: |
|
||||||
pip install --force-reinstall pylint Sphinx sphinx-rtd-theme pre-commit
|
pip install --force-reinstall Sphinx sphinx-rtd-theme pre-commit
|
||||||
- name: Library version
|
- name: Library version
|
||||||
run: git describe --dirty --always --tags
|
run: git describe --dirty --always --tags
|
||||||
- name: Pre-commit hooks
|
- name: Pre-commit hooks
|
||||||
|
|
|
||||||
|
|
@ -18,17 +18,25 @@ repos:
|
||||||
- id: end-of-file-fixer
|
- id: end-of-file-fixer
|
||||||
- id: trailing-whitespace
|
- id: trailing-whitespace
|
||||||
- repo: https://github.com/pycqa/pylint
|
- repo: https://github.com/pycqa/pylint
|
||||||
rev: pylint-2.7.1
|
rev: v2.11.1
|
||||||
hooks:
|
hooks:
|
||||||
- id: pylint
|
- id: pylint
|
||||||
name: pylint (library code)
|
name: pylint (library code)
|
||||||
types: [python]
|
types: [python]
|
||||||
exclude: "^(docs/|examples/|setup.py$)"
|
args:
|
||||||
- repo: local
|
- --disable=consider-using-f-string,duplicate-code
|
||||||
hooks:
|
exclude: "^(docs/|examples/|tests/|setup.py$)"
|
||||||
- id: pylint_examples
|
- id: pylint
|
||||||
name: pylint (examples code)
|
name: pylint (example code)
|
||||||
description: Run pylint rules on "examples/*.py" files
|
description: Run pylint rules on "examples/*.py" files
|
||||||
entry: /usr/bin/env bash -c
|
types: [python]
|
||||||
args: ['([[ ! -d "examples" ]] || for example in $(find . -path "./examples/*.py"); do pylint --disable=missing-docstring,invalid-name,consider-using-f-string $example; done)']
|
files: "^examples/"
|
||||||
language: system
|
args:
|
||||||
|
- --disable=missing-docstring,invalid-name,consider-using-f-string,duplicate-code
|
||||||
|
- id: pylint
|
||||||
|
name: pylint (test code)
|
||||||
|
description: Run pylint rules on "tests/*.py" files
|
||||||
|
types: [python]
|
||||||
|
files: "^tests/"
|
||||||
|
args:
|
||||||
|
- --disable=missing-docstring,consider-using-f-string,duplicate-code
|
||||||
|
|
|
||||||
|
|
@ -253,7 +253,7 @@ ignore-docstrings=yes
|
||||||
ignore-imports=yes
|
ignore-imports=yes
|
||||||
|
|
||||||
# Minimum lines number of a similarity.
|
# Minimum lines number of a similarity.
|
||||||
min-similarity-lines=50
|
min-similarity-lines=4
|
||||||
|
|
||||||
|
|
||||||
[BASIC]
|
[BASIC]
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,7 @@ class BMPError(Exception):
|
||||||
|
|
||||||
def display_bitmap(epd, filename): # pylint: disable=too-many-locals, too-many-branches
|
def display_bitmap(epd, filename): # pylint: disable=too-many-locals, too-many-branches
|
||||||
try:
|
try:
|
||||||
f = open(filename, "rb")
|
f = open(filename, "rb") # pylint: disable=consider-using-with
|
||||||
except OSError:
|
except OSError:
|
||||||
print("Couldn't open file")
|
print("Couldn't open file")
|
||||||
return
|
return
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue