Skip to content

Commit 6f8987b

Browse files
authored
Merge pull request #89 from adafruit/patch
Pylint and RTD update patch, and other fixes
2 parents e86381a + 9fde73f commit 6f8987b

File tree

5 files changed

+24
-14
lines changed

5 files changed

+24
-14
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
@@ -252,7 +252,7 @@ ignore-docstrings=yes
252252
ignore-imports=yes
253253

254254
# Minimum lines number of a similarity.
255-
min-similarity-lines=12
255+
min-similarity-lines=4
256256

257257

258258
[BASIC]

adafruit_led_animation/animation/sparkle.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ def __init__(
6666
def _set_color(self, color):
6767
half_color = tuple(color[rgb] // 4 for rgb in range(len(color)))
6868
dim_color = tuple(color[rgb] // 10 for rgb in range(len(color)))
69-
for pixel in range(len(self.pixel_object)):
69+
for pixel in range( # pylint: disable=consider-using-enumerate
70+
len(self.pixel_object)
71+
):
7072
if self.pixel_object[pixel] == self._half_color:
7173
self.pixel_object[pixel] = half_color
7274
elif self.pixel_object[pixel] == self._dim_color:

examples/led_animation_group.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
from adafruit_led_animation.group import AnimationGroup
2222
from adafruit_led_animation.sequence import AnimationSequence
2323

24-
import adafruit_led_animation.color as color
24+
from adafruit_led_animation import color
2525

2626
strip_pixels = neopixel.NeoPixel(board.A1, 30, brightness=0.5, auto_write=False)
2727
cp.pixels.brightness = 0.5

0 commit comments

Comments
 (0)