Skip to content

Commit

Permalink
use ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
FoamyGuy committed Dec 9, 2024
1 parent 12eb6ff commit 5746650
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
4 changes: 1 addition & 3 deletions adafruit_fancyled/adafruit_fancyled.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ class CRGB:
"""

def __init__(self, red: CHSV, green: float = 0.0, blue: float = 0.0) -> None:
# pylint: disable=too-many-branches
if isinstance(red, CHSV):
# If first/only argument is a CHSV type, perform HSV to RGB
# conversion.
Expand Down Expand Up @@ -188,7 +187,6 @@ class CHSV:
HSV->RGB->HSV translations won't have the same input and output.
"""

# pylint: disable=invalid-name
def __init__(self, h: float, s: float = 1.0, v: float = 1.0) -> None:
if isinstance(h, float):
self.hue: float = h # Don't clamp! Hue can wrap around forever.
Expand All @@ -197,7 +195,7 @@ def __init__(self, h: float, s: float = 1.0, v: float = 1.0) -> None:
self.saturation: float = clamp_norm(s)
self.value: float = clamp_norm(v)

def __repr__( # pylint: disable=invalid-repr-returned
def __repr__(
self,
) -> tuple[float, float, float]:
return (self.hue, self.saturation, self.value)
Expand Down
6 changes: 0 additions & 6 deletions adafruit_fancyled/fastled_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@

# These are helper functions that provide more FastLED-like calls for
# fancyled functions.
# Function names are kept the same as FastLED, which normally upsets pylint.
# Disable name-checking so this passes muster.
# pylint: disable=invalid-name

GFACTOR = 2.5 # Default gamma-correction factor for function below

Expand Down Expand Up @@ -144,6 +141,3 @@ def hsv2rgb_spectrum(hue, sat, val):
"""

return fancy.CRGB(fancy.CHSV(hue / 255, sat / 255, val / 255))


# pylint: enable=invalid-name

0 comments on commit 5746650

Please sign in to comment.