Running mypy on cli/testflinger_cli/auth.py reveals 4 type errors:
cli/testflinger_cli/auth.py:79: error: Missing return statement [return]
cli/testflinger_cli/auth.py:91: error: Missing return statement [return]
cli/testflinger_cli/auth.py:126: error: Argument "fallback" to "get" of "ConfigParser" has incompatible type "None"; expected "str" [arg-type]
cli/testflinger_cli/auth.py:180: error: Argument 1 has incompatible type "str | None"; expected "str | bytes" [arg-type]
Proposed fixes:
- Lines 79 and 91: add
return None after _handle_auth_error() calls — both methods declare str as return type but have a path that returns nothing
- Line 126: change
fallback=None to fallback="" — ConfigParser.get() expects str, not None
- Line 180: change
self.jwt_token to self.jwt_token or "" in jwt.decode() call — jwt_token can be str | None but jwt.decode expects str | bytes
Happy to submit a PR with these fixes.
Running mypy on
cli/testflinger_cli/auth.pyreveals 4 type errors:cli/testflinger_cli/auth.py:79: error: Missing return statement [return]
cli/testflinger_cli/auth.py:91: error: Missing return statement [return]
cli/testflinger_cli/auth.py:126: error: Argument "fallback" to "get" of "ConfigParser" has incompatible type "None"; expected "str" [arg-type]
cli/testflinger_cli/auth.py:180: error: Argument 1 has incompatible type "str | None"; expected "str | bytes" [arg-type]
Proposed fixes:
return Noneafter_handle_auth_error()calls — both methods declarestras return type but have a path that returns nothingfallback=Nonetofallback=""— ConfigParser.get() expectsstr, notNoneself.jwt_tokentoself.jwt_token or ""injwt.decode()call — jwt_token can bestr | Nonebut jwt.decode expectsstr | bytesHappy to submit a PR with these fixes.