Skip to content

Commit b2e9445

Browse files
authored
Merge pull request #57 from adafruit/patch
Pylint and RTD update patch, and other fixes
2 parents 2070b73 + ae8ca3b commit b2e9445

File tree

4 files changed

+21
-13
lines changed

4 files changed

+21
-13
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ jobs:
4242
# (e.g. - apt-get: gettext, etc; pip: circuitpython-build-tools, requirements.txt; etc.)
4343
run: |
4444
source actions-ci/install.sh
45-
- name: Pip install pylint, Sphinx, pre-commit
45+
- name: Pip install Sphinx, pre-commit
4646
run: |
47-
pip install --force-reinstall pylint Sphinx sphinx-rtd-theme pre-commit
47+
pip install --force-reinstall Sphinx sphinx-rtd-theme pre-commit
4848
- name: Library version
4949
run: git describe --dirty --always --tags
5050
- name: Pre-commit hooks

.pre-commit-config.yaml

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,25 @@ repos:
1818
- id: end-of-file-fixer
1919
- id: trailing-whitespace
2020
- repo: https://github.com/pycqa/pylint
21-
rev: pylint-2.7.1
21+
rev: v2.11.1
2222
hooks:
2323
- id: pylint
2424
name: pylint (library code)
2525
types: [python]
26-
exclude: "^(docs/|examples/|setup.py$)"
27-
- repo: local
28-
hooks:
29-
- id: pylint_examples
30-
name: pylint (examples code)
26+
args:
27+
- --disable=consider-using-f-string,duplicate-code
28+
exclude: "^(docs/|examples/|tests/|setup.py$)"
29+
- id: pylint
30+
name: pylint (example code)
3131
description: Run pylint rules on "examples/*.py" files
32-
entry: /usr/bin/env bash -c
33-
args: ['([[ ! -d "examples" ]] || for example in $(find . -path "./examples/*.py"); do pylint --disable=missing-docstring,invalid-name,consider-using-f-string $example; done)']
34-
language: system
32+
types: [python]
33+
files: "^examples/"
34+
args:
35+
- --disable=missing-docstring,invalid-name,consider-using-f-string,duplicate-code
36+
- id: pylint
37+
name: pylint (test code)
38+
description: Run pylint rules on "tests/*.py" files
39+
types: [python]
40+
files: "^tests/"
41+
args:
42+
- --disable=missing-docstring,consider-using-f-string,duplicate-code

.pylintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ ignore-docstrings=yes
253253
ignore-imports=yes
254254

255255
# Minimum lines number of a similarity.
256-
min-similarity-lines=50
256+
min-similarity-lines=4
257257

258258

259259
[BASIC]

examples/epd_bitmap.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class BMPError(Exception):
7474

7575
def display_bitmap(epd, filename): # pylint: disable=too-many-locals, too-many-branches
7676
try:
77-
f = open(filename, "rb")
77+
f = open(filename, "rb") # pylint: disable=consider-using-with
7878
except OSError:
7979
print("Couldn't open file")
8080
return

0 commit comments

Comments
 (0)