mypy: Enable ignore-without-code error.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
parent
95b33b83b5
commit
43654b9cf2
3 changed files with 5 additions and 4 deletions
|
@ -39,6 +39,7 @@ enable_error_code = [
|
||||||
"redundant-expr",
|
"redundant-expr",
|
||||||
"truthy-bool",
|
"truthy-bool",
|
||||||
"truthy-iterable",
|
"truthy-iterable",
|
||||||
|
"ignore-without-code",
|
||||||
"unused-awaitable",
|
"unused-awaitable",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
@ -154,7 +154,7 @@ def add_default_arguments(
|
||||||
self.print_help(sys.stderr)
|
self.print_help(sys.stderr)
|
||||||
self.exit(2, f"{self.prog}: error: {message}\n")
|
self.exit(2, f"{self.prog}: error: {message}\n")
|
||||||
|
|
||||||
parser.error = types.MethodType(custom_error_handling, parser) # type: ignore # patching function
|
parser.error = types.MethodType(custom_error_handling, parser) # type: ignore[method-assign] # patching function
|
||||||
|
|
||||||
if allow_provisioning:
|
if allow_provisioning:
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
|
@ -1802,7 +1802,7 @@ if LEGACY_CLIENT_INTERFACE_FROM_SERVER_DOCS_VERSION == "3":
|
||||||
# This block is support for testing Zulip 3.x, which documents old
|
# This block is support for testing Zulip 3.x, which documents old
|
||||||
# interfaces for the following functions:
|
# interfaces for the following functions:
|
||||||
class LegacyInterfaceClient(Client):
|
class LegacyInterfaceClient(Client):
|
||||||
def update_user_group_members(self, group_data: Dict[str, Any]) -> Dict[str, Any]: # type: ignore # Intentional override; see comments above.
|
def update_user_group_members(self, group_data: Dict[str, Any]) -> Dict[str, Any]: # type: ignore[override] # Intentional override; see comments above.
|
||||||
modern_group_data = group_data.copy()
|
modern_group_data = group_data.copy()
|
||||||
group_id = group_data["group_id"]
|
group_id = group_data["group_id"]
|
||||||
del modern_group_data["group_id"]
|
del modern_group_data["group_id"]
|
||||||
|
@ -1821,4 +1821,4 @@ if LEGACY_CLIENT_INTERFACE_FROM_SERVER_DOCS_VERSION == "3":
|
||||||
method="GET",
|
method="GET",
|
||||||
)
|
)
|
||||||
|
|
||||||
Client = LegacyInterfaceClient # type: ignore # Intentional override; see comments above.
|
Client = LegacyInterfaceClient # type: ignore[misc] # Intentional override; see comments above.
|
||||||
|
|
|
@ -30,7 +30,7 @@ def mock_http_conversation(http_data: Dict[str, Any]) -> Any:
|
||||||
mock_result.headers.update(http_headers)
|
mock_result.headers.update(http_headers)
|
||||||
mock_result.encoding = get_encoding_from_headers(mock_result.headers)
|
mock_result.encoding = get_encoding_from_headers(mock_result.headers)
|
||||||
if is_raw_response:
|
if is_raw_response:
|
||||||
mock_result._content = http_response.encode() # type: ignore # This modifies a "hidden" attribute.
|
mock_result._content = http_response.encode() # type: ignore[attr-defined] # This modifies a "hidden" attribute.
|
||||||
else:
|
else:
|
||||||
mock_result._content = json.dumps(http_response).encode()
|
mock_result._content = json.dumps(http_response).encode()
|
||||||
return mock_result
|
return mock_result
|
||||||
|
|
Loading…
Add table
Reference in a new issue