adafruit / Adafruit_CircuitPython_Logging

Logging module for CircuitPython
MIT License
15 stars 20 forks source link

Patch: Document metaprogrammed module attributes #19

Closed garrettheath4 closed 2 years ago

garrettheath4 commented 3 years ago

Expanded documentation to include dynamically-generated module-level attributes that cannot be detected (by an IDE) or documented (by NumpyDoc) without running the code. Specifically:

are all module-level attributes that are generated using this block of metaprogramming (line 65):

LEVELS = [
    (00, "NOTSET"),
    (10, "DEBUG"),
    (20, "INFO"),
    (30, "WARNING"),
    (40, "ERROR"),
    (50, "CRITICAL"),
]

for level_value, level_name in LEVELS:
    globals()[level_name] = level_value
brentru commented 3 years ago

@garrettheath4 This is failing on black, could you fix this and re-commit. Changes look good.

FoamyGuy commented 2 years ago

I merged main to this branch and resolved the conflicts. Fixed one other pylint issue resulting from renaming some of the arguments in this PR.

Changes look good to me as well.