Skip to content

Type Annotations: ext.logging #718

Closed

Description

@derks

Add initial type annotations.

Related:

Current Errors:

|> cement-py312 <| src # make comply-typing | grep ext/ext_logging
cement/ext/ext_logging.py:12: error: Call to untyped function "minimal_logger" in typed context  [no-untyped-call]
cement/ext/ext_logging.py:18: error: Name "NullHandler" already defined on line 15  [no-redef]
cement/ext/ext_logging.py:20: error: Function is missing a type annotation  [no-untyped-def]
cement/ext/ext_logging.py:24: error: Function is missing a type annotation  [no-untyped-def]
cement/ext/ext_logging.py:28: error: Function is missing a return type annotation  [no-untyped-def]
cement/ext/ext_logging.py:28: note: Use "-> None" if function does not return a value
cement/ext/ext_logging.py:75: error: Need type annotation for "clear_loggers" (hint: "clear_loggers: List[<type>] = ...")  [var-annotated]
cement/ext/ext_logging.py:109: error: Function is missing a type annotation  [no-untyped-def]
cement/ext/ext_logging.py:110: error: Call to untyped function "__init__" in typed context  [no-untyped-call]
cement/ext/ext_logging.py:113: error: Function is missing a type annotation  [no-untyped-def]
cement/ext/ext_logging.py:114: error: Call to untyped function "_setup" in typed context  [no-untyped-call]
cement/ext/ext_logging.py:115: error: "Meta" has no attribute "namespace"  [attr-defined]
cement/ext/ext_logging.py:116: error: "Meta" has no attribute "namespace"  [attr-defined]
cement/ext/ext_logging.py:116: error: Item "None" of "Optional[Any]" has no attribute "_meta"  [union-attr]
cement/ext/ext_logging.py:119: error: "Meta" has no attribute "namespace"  [attr-defined]
cement/ext/ext_logging.py:122: error: Call to untyped function "is_true" in typed context  [no-untyped-call]
cement/ext/ext_logging.py:122: error: Item "None" of "Optional[Any]" has no attribute "_meta"  [union-attr]
cement/ext/ext_logging.py:123: error: Item "None" of "Optional[Any]" has no attribute "config"  [union-attr]
cement/ext/ext_logging.py:123: error: "Meta" has no attribute "config_section"  [attr-defined]
cement/ext/ext_logging.py:125: error: Item "None" of "Optional[Any]" has no attribute "config"  [union-attr]
cement/ext/ext_logging.py:125: error: "Meta" has no attribute "config_section"  [attr-defined]
cement/ext/ext_logging.py:126: error: Call to untyped function "set_level" in typed context  [no-untyped-call]
cement/ext/ext_logging.py:127: error: "Meta" has no attribute "propagate"  [attr-defined]
cement/ext/ext_logging.py:130: error: "Meta" has no attribute "namespace"  [attr-defined]
cement/ext/ext_logging.py:132: error: Function is missing a type annotation  [no-untyped-def]
cement/ext/ext_logging.py:144: error: Call to untyped function "clear_loggers" in typed context  [no-untyped-call]
cement/ext/ext_logging.py:144: error: "Meta" has no attribute "namespace"  [attr-defined]
cement/ext/ext_logging.py:145: error: "Meta" has no attribute "clear_loggers"  [attr-defined]
cement/ext/ext_logging.py:146: error: Call to untyped function "clear_loggers" in typed context  [no-untyped-call]
cement/ext/ext_logging.py:161: error: Call to untyped function "_setup_console_log" in typed context  [no-untyped-call]
cement/ext/ext_logging.py:164: error: Call to untyped function "_setup_file_log" in typed context  [no-untyped-call]
cement/ext/ext_logging.py:166: error: Function is missing a return type annotation  [no-untyped-def]
cement/ext/ext_logging.py:170: error: Function is missing a type annotation  [no-untyped-def]
cement/ext/ext_logging.py:178: error: Function is missing a return type annotation  [no-untyped-def]
cement/ext/ext_logging.py:179: error: Call to untyped function "get_level" in typed context  [no-untyped-call]
cement/ext/ext_logging.py:180: error: "Meta" has no attribute "debug_format"  [attr-defined]
cement/ext/ext_logging.py:182: error: "Meta" has no attribute "console_format"  [attr-defined]
cement/ext/ext_logging.py:186: error: Function is missing a return type annotation  [no-untyped-def]
cement/ext/ext_logging.py:187: error: Call to untyped function "get_level" in typed context  [no-untyped-call]
cement/ext/ext_logging.py:188: error: "Meta" has no attribute "debug_format"  [attr-defined]
cement/ext/ext_logging.py:190: error: "Meta" has no attribute "file_format"  [attr-defined]
cement/ext/ext_logging.py:194: error: Function is missing a type annotation  [no-untyped-def]
cement/ext/ext_logging.py:195: error: "Meta" has no attribute "formatter_class"  [attr-defined]
cement/ext/ext_logging.py:197: error: Function is missing a type annotation  [no-untyped-def]
cement/ext/ext_logging.py:198: error: "Meta" has no attribute "formatter_class"  [attr-defined]
cement/ext/ext_logging.py:200: error: Function is missing a return type annotation  [no-untyped-def]
cement/ext/ext_logging.py:200: note: Use "-> None" if function does not return a value
cement/ext/ext_logging.py:202: error: "Meta" has no attribute "namespace"  [attr-defined]
cement/ext/ext_logging.py:203: error: Item "None" of "Optional[Any]" has no attribute "config"  [union-attr]
cement/ext/ext_logging.py:203: error: "Meta" has no attribute "config_section"  [attr-defined]
cement/ext/ext_logging.py:205: error: Call to untyped function "is_true" in typed context  [no-untyped-call]
cement/ext/ext_logging.py:207: error: Call to untyped function "_get_console_format" in typed context  [no-untyped-call]
cement/ext/ext_logging.py:208: error: Call to untyped function "_get_console_formatter" in typed context  [no-untyped-call]
cement/ext/ext_logging.py:210: error: Call to untyped function "get_level" in typed context  [no-untyped-call]
cement/ext/ext_logging.py:212: error: Incompatible types in assignment (expression has type "NullHandler", variable has type "StreamHandler[TextIO]")  [assignment]
cement/ext/ext_logging.py:221: error: Function is missing a return type annotation  [no-untyped-def]
cement/ext/ext_logging.py:221: note: Use "-> None" if function does not return a value
cement/ext/ext_logging.py:224: error: "Meta" has no attribute "namespace"  [attr-defined]
cement/ext/ext_logging.py:225: error: Item "None" of "Optional[Any]" has no attribute "config"  [union-attr]
cement/ext/ext_logging.py:225: error: "Meta" has no attribute "config_section"  [attr-defined]
cement/ext/ext_logging.py:226: error: Item "None" of "Optional[Any]" has no attribute "config"  [union-attr]
cement/ext/ext_logging.py:226: error: "Meta" has no attribute "config_section"  [attr-defined]
cement/ext/ext_logging.py:227: error: Item "None" of "Optional[Any]" has no attribute "config"  [union-attr]
cement/ext/ext_logging.py:227: error: "Meta" has no attribute "config_section"  [attr-defined]
cement/ext/ext_logging.py:229: error: Item "None" of "Optional[Any]" has no attribute "config"  [union-attr]
cement/ext/ext_logging.py:229: error: "Meta" has no attribute "config_section"  [attr-defined]
cement/ext/ext_logging.py:246: error: Incompatible types in assignment (expression has type "FileHandler", variable has type "RotatingFileHandler")  [assignment]
cement/ext/ext_logging.py:248: error: Call to untyped function "_get_file_format" in typed context  [no-untyped-call]
cement/ext/ext_logging.py:249: error: Call to untyped function "_get_file_formatter" in typed context  [no-untyped-call]
cement/ext/ext_logging.py:251: error: Call to untyped function "get_level" in typed context  [no-untyped-call]
cement/ext/ext_logging.py:253: error: Incompatible types in assignment (expression has type "NullHandler", variable has type "RotatingFileHandler")  [assignment]
cement/ext/ext_logging.py:262: error: Function is missing a type annotation  [no-untyped-def]
cement/ext/ext_logging.py:264: error: "Meta" has no attribute "namespace"  [attr-defined]
cement/ext/ext_logging.py:275: error: Function is missing a type annotation  [no-untyped-def]
cement/ext/ext_logging.py:292: error: Call to untyped function "_get_logging_kwargs" in typed context  [no-untyped-call]
cement/ext/ext_logging.py:295: error: Function is missing a type annotation  [no-untyped-def]
cement/ext/ext_logging.py:312: error: Call to untyped function "_get_logging_kwargs" in typed context  [no-untyped-call]
cement/ext/ext_logging.py:315: error: Function is missing a type annotation  [no-untyped-def]
cement/ext/ext_logging.py:332: error: Call to untyped function "_get_logging_kwargs" in typed context  [no-untyped-call]
cement/ext/ext_logging.py:335: error: Function is missing a type annotation  [no-untyped-def]
cement/ext/ext_logging.py:352: error: Call to untyped function "_get_logging_kwargs" in typed context  [no-untyped-call]
cement/ext/ext_logging.py:355: error: Function is missing a type annotation  [no-untyped-def]
cement/ext/ext_logging.py:376: error: Call to untyped function "_get_logging_kwargs" in typed context  [no-untyped-call]
cement/ext/ext_logging.py:379: error: Function is missing a type annotation  [no-untyped-def]
cement/ext/ext_logging.py:396: error: Call to untyped function "_get_logging_kwargs" in typed context  [no-untyped-call]
cement/ext/ext_logging.py:400: error: Function is missing a type annotation  [no-untyped-def]
cement/ext/ext_logging.py:408: error: Function is missing a type annotation  [no-untyped-def]
cement/ext/ext_logging.py:416: error: Function is missing a type annotation  [no-untyped-def]
make: *** [Makefile:33: comply-typing] Error 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions