mirror of https://github.com/zulip/zulip.git
mypy: Enable strict optional in zerver/lib/bugdown.
Explicitly check for none in optional value and set it to a dict.
This commit is contained in:
parent
b3d43df498
commit
04c50cffa7
2
mypy.ini
2
mypy.ini
|
@ -318,7 +318,7 @@ strict_optional = True
|
||||||
[mypy-zerver.lib.exceptions] #21: error: Return type of "__reduce_ex__" incompatible with supertype "object"
|
[mypy-zerver.lib.exceptions] #21: error: Return type of "__reduce_ex__" incompatible with supertype "object"
|
||||||
strict_optional = True
|
strict_optional = True
|
||||||
[mypy-zerver.lib.bugdown.api_arguments_table_generator] #18: error: Item "None" of "Optional[Dict[str, Any]]" has no attribute "items"
|
[mypy-zerver.lib.bugdown.api_arguments_table_generator] #18: error: Item "None" of "Optional[Dict[str, Any]]" has no attribute "items"
|
||||||
strict_optional = False
|
strict_optional = True
|
||||||
[mypy-zerver.lib.message] #868: error: Unsupported operand types for - ("Optional[int]" and "int")
|
[mypy-zerver.lib.message] #868: error: Unsupported operand types for - ("Optional[int]" and "int")
|
||||||
strict_optional = False
|
strict_optional = False
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,9 @@ REGEXP = re.compile(r'\{generate_api_arguments_table\|\s*(.+?)\s*\|\s*(.+?)\s*\}
|
||||||
|
|
||||||
|
|
||||||
class MarkdownArgumentsTableGenerator(Extension):
|
class MarkdownArgumentsTableGenerator(Extension):
|
||||||
def __init__(self, configs: Optional[Dict[str, Any]]={}) -> None:
|
def __init__(self, configs: Optional[Dict[str, Any]]=None) -> None:
|
||||||
|
if configs is None:
|
||||||
|
configs = {}
|
||||||
self.config = {
|
self.config = {
|
||||||
'base_path': ['.', 'Default location from which to evaluate relative paths for the JSON files.'],
|
'base_path': ['.', 'Default location from which to evaluate relative paths for the JSON files.'],
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue