Skip to content

Commit 662eb99

Browse files
authored
Merge pull request #4 from FoamyGuy/main
pylint to precommit
2 parents 368ffb2 + e0e58e8 commit 662eb99

8 files changed

+63
-16
lines changed

.github/workflows/build.yml

-4
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,6 @@ jobs:
5050
- name: Pre-commit hooks
5151
run: |
5252
pre-commit run --all-files
53-
- name: PyLint
54-
run: |
55-
pylint $( find . -path './adafruit*.py' )
56-
([[ ! -d "examples" ]] || pylint --disable=missing-docstring,invalid-name,bad-whitespace $( find . -path "./examples/*.py" ))
5753
- name: Build assets
5854
run: circuitpython-build-bundles --filename_prefix ${{ steps.repo-name.outputs.repo-name }} --library_location .
5955
- name: Build docs

.pre-commit-config.yaml

+17-2
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44

55
repos:
66
- repo: https://github.com/python/black
7-
rev: 19.10b0
7+
rev: 20.8b1
88
hooks:
99
- id: black
1010
- repo: https://github.com/fsfe/reuse-tool
11-
rev: 20.8b1
11+
rev: v0.12.1
1212
hooks:
1313
- id: reuse
1414
- repo: https://github.com/pre-commit/pre-commit-hooks
@@ -17,4 +17,19 @@ repos:
1717
- id: check-yaml
1818
- id: end-of-file-fixer
1919
- id: trailing-whitespace
20+
- repo: https://github.com/pycqa/pylint
21+
rev: pylint-2.7.1
22+
hooks:
23+
- id: pylint
24+
name: pylint (library code)
25+
types: [python]
26+
exclude: "^(docs/|examples/|setup.py$)"
27+
- repo: local
28+
hooks:
29+
- id: pylint_examples
30+
name: pylint (examples code)
31+
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 $example; done)']
34+
language: system
2035
exclude: \.png$

.pylintrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ ignore-comments=yes
250250
ignore-docstrings=yes
251251

252252
# Ignore imports when computing similarities.
253-
ignore-imports=no
253+
ignore-imports=yes
254254

255255
# Minimum lines number of a similarity.
256256
min-similarity-lines=4

examples/pixel_framebuf_16x16_animation.py

+10-2
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,18 @@
99
pixel_height = 16
1010

1111
pixels = neopixel.NeoPixel(
12-
pixel_pin, pixel_width * pixel_height, brightness=0.1, auto_write=False,
12+
pixel_pin,
13+
pixel_width * pixel_height,
14+
brightness=0.1,
15+
auto_write=False,
1316
)
1417

15-
pixel_framebuf = PixelFramebuffer(pixels, pixel_width, pixel_height, reverse_x=True,)
18+
pixel_framebuf = PixelFramebuffer(
19+
pixels,
20+
pixel_width,
21+
pixel_height,
22+
reverse_x=True,
23+
)
1624

1725
text = "Welcome to CircuitPython"
1826

examples/pixel_framebuf_32x8_test.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@
99
pixel_height = 8
1010

1111
pixels = neopixel.NeoPixel(
12-
pixel_pin, pixel_width * pixel_height, brightness=0.1, auto_write=False,
12+
pixel_pin,
13+
pixel_width * pixel_height,
14+
brightness=0.1,
15+
auto_write=False,
1316
)
1417

1518
pixel_framebuf = PixelFramebuffer(

examples/pixel_framebuf_dotstar_simpletest.py

+11-2
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,19 @@
1212
pixel_height = 6
1313

1414
pixels = adafruit_dotstar.DotStar(
15-
board.D13, board.D11, pixel_width * pixel_height, brightness=0.3, auto_write=False,
15+
board.D13,
16+
board.D11,
17+
pixel_width * pixel_height,
18+
brightness=0.3,
19+
auto_write=False,
1620
)
1721

18-
pixel_framebuf = PixelFramebuffer(pixels, pixel_width, pixel_height, alternating=False,)
22+
pixel_framebuf = PixelFramebuffer(
23+
pixels,
24+
pixel_width,
25+
pixel_height,
26+
alternating=False,
27+
)
1928

2029
pixel_framebuf.fill(0x000088)
2130
pixel_framebuf.pixel(5, 1, 0xFFFF00)

examples/pixel_framebuf_pillow_image.py

+10-2
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,18 @@
1919
pixel_height = 16
2020

2121
pixels = neopixel.NeoPixel(
22-
pixel_pin, pixel_width * pixel_height, brightness=0.1, auto_write=False,
22+
pixel_pin,
23+
pixel_width * pixel_height,
24+
brightness=0.1,
25+
auto_write=False,
2326
)
2427

25-
pixel_framebuf = PixelFramebuffer(pixels, pixel_width, pixel_height, reverse_x=True,)
28+
pixel_framebuf = PixelFramebuffer(
29+
pixels,
30+
pixel_width,
31+
pixel_height,
32+
reverse_x=True,
33+
)
2634

2735
# Make a black background in RGBA Mode
2836
image = Image.new("RGBA", (pixel_width, pixel_height))

examples/pixel_framebuf_simpletest.py

+10-2
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,18 @@
1212
pixel_height = 4
1313

1414
pixels = neopixel.NeoPixel(
15-
pixel_pin, pixel_width * pixel_height, brightness=0.1, auto_write=False,
15+
pixel_pin,
16+
pixel_width * pixel_height,
17+
brightness=0.1,
18+
auto_write=False,
1619
)
1720

18-
pixel_framebuf = PixelFramebuffer(pixels, pixel_width, pixel_height, alternating=False,)
21+
pixel_framebuf = PixelFramebuffer(
22+
pixels,
23+
pixel_width,
24+
pixel_height,
25+
alternating=False,
26+
)
1927

2028
pixel_framebuf.fill(0x000088)
2129
pixel_framebuf.pixel(5, 1, 0xFFFF00)

0 commit comments

Comments
 (0)