Skip to content

Commit 77c184c

Browse files
committed
QA: Update and apply code QA rules.
1 parent 940cb0c commit 77c184c

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

ci/python.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Include:
12
# F = Pyflakes
23
# Q = Quotes
34
# E/W = pycodestyle (Whitespace, Line lengths etc)
@@ -12,8 +13,14 @@
1213
# SLF - flake8-self
1314
# ARG - flake8-unused-arguments
1415

16+
# Ignore:
17+
# E501 - "line too long". How narrow is your screen!?
18+
# E402 - "module level import not at top of file". Needs must!
19+
# COM812 - "Add trailing comma". These are a little obnoxious and weird.
20+
# ICN001 - "numpy should be imported as np". No. No it should not.
21+
1522
QA_INCLUDE="F,Q,W,E,B,COM,BLE,C4,ISC,ICN,PIE,RSE,RET,SLF,ARG"
16-
QA_IGNORE="E501,E402,COM812"
23+
QA_IGNORE="E501,E402,COM812,ICN001"
1724

1825
function qa_prepare_all {
1926
pip install ruff

tools/convert-image-rgb565.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
def image_to_data(image):
1919
"""Generator function to convert a PIL image to 16-bit 565 RGB bytes."""
2020
# Convert the image to RGB (ignoring alpha if present)
21-
image = image.convert('RGB')
21+
image = image.convert("RGB")
2222

2323
# Convert the image to a NumPy array
24-
pb = numpy.array(image).astype('uint16')
24+
pb = numpy.array(image).astype("uint16")
2525

2626
# Extract the RGB channels
2727
r = (pb[:, :, 0] >> 3) & 0x1F # 5 bits for red
@@ -43,4 +43,4 @@ def image_to_data(image):
4343
with open(OUTPUT_PATH, "wb") as f:
4444
f.write(data)
4545

46-
print(f"Written to: {OUTPUT_PATH}")
46+
print(f"Written to: {OUTPUT_PATH}")

0 commit comments

Comments
 (0)