adafruit/Adafruit_CircuitPython_Display_Text

Incorrect keyword parameters are ignored, and do not cause errors.

kmatch98 opened this issue · 1 comments

When creating labels, incorrect input parameters are ignored and do not cause any errors. This will cause confusion if users type the wrong keyword name and nothing happens (like happened with me when I used background instead of background_color).

I added a "random_argument" to the simpletest and it does not cause any errors. Not a huge deal but it can prevent users from realizing their errors.

import board
import terminalio
from adafruit_display_text import bitmap_label


text = "Hello world"
text_area = bitmap_label.Label(terminalio.FONT, text=text, random_argument=42)
text_area.x = 10
text_area.y = 10
board.DISPLAY.show(text_area)
while True:
    pass

Maybe we can use a kawrgs parser [args for args in kwargs], but, the we will need a dict or list with all the arguments defined in the library to check upon to validate and raise and error