From 57466509e9e06823ffb9009b3a6ad89aed97b7f5 Mon Sep 17 00:00:00 2001 From: foamyguy Date: Mon, 9 Dec 2024 15:41:58 -0600 Subject: [PATCH] use ruff --- adafruit_fancyled/adafruit_fancyled.py | 4 +--- adafruit_fancyled/fastled_helpers.py | 6 ------ 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/adafruit_fancyled/adafruit_fancyled.py b/adafruit_fancyled/adafruit_fancyled.py index e2c6700..2c88ca4 100644 --- a/adafruit_fancyled/adafruit_fancyled.py +++ b/adafruit_fancyled/adafruit_fancyled.py @@ -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. @@ -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. @@ -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) diff --git a/adafruit_fancyled/fastled_helpers.py b/adafruit_fancyled/fastled_helpers.py index 77ee48d..7152f6b 100644 --- a/adafruit_fancyled/fastled_helpers.py +++ b/adafruit_fancyled/fastled_helpers.py @@ -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 @@ -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