mirror of https://github.com/zulip/zulip.git
mypy: Enable redundant-expr errors.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
parent
944c036df1
commit
c944adfcc6
|
@ -24,6 +24,11 @@ disallow_untyped_calls = false
|
|||
disallow_untyped_decorators = false
|
||||
warn_return_any = false
|
||||
|
||||
# Enable optional errors.
|
||||
enable_error_code = [
|
||||
"redundant-expr",
|
||||
]
|
||||
|
||||
# Display the codes needed for # type: ignore[code] annotations.
|
||||
show_error_codes = true
|
||||
|
||||
|
|
|
@ -218,7 +218,7 @@ def check_capitalization(strings: List[str]) -> Tuple[List[str], List[str], List
|
|||
capitalized = is_capitalized(safe_text)
|
||||
if not capitalized:
|
||||
errors.append(text)
|
||||
elif capitalized and has_ignored_phrase:
|
||||
elif has_ignored_phrase:
|
||||
ignored.append(text)
|
||||
|
||||
banned_word_errors.extend(check_banned_words(text))
|
||||
|
|
|
@ -464,7 +464,7 @@ def validate(fn: Optional[str] = None, text: Optional[str] = None) -> List[Token
|
|||
f"Tag must be self-closing: {tag} at {fn} line {token.line}, col {token.col}"
|
||||
)
|
||||
elif kind == "html_singleton":
|
||||
if not state.foreign and tag not in HTML_VOID_TAGS:
|
||||
if tag not in HTML_VOID_TAGS:
|
||||
raise TemplateParserException(
|
||||
f"Tag must not be self-closing: {tag} at {fn} line {token.line}, col {token.col}"
|
||||
)
|
||||
|
|
|
@ -87,7 +87,6 @@ class MentionBackend:
|
|||
# We expect callers who take advantage of our cache to supply both
|
||||
# id and full_name in the user mentions in their messages.
|
||||
for user in user_list:
|
||||
if user.id is not None and user.full_name is not None:
|
||||
self.user_cache[(user.id, user.full_name)] = user
|
||||
|
||||
result += user_list
|
||||
|
|
|
@ -181,7 +181,7 @@ class ZulipSCIMUser(SCIMUser):
|
|||
self._full_name_new_value = new_value
|
||||
|
||||
def change_is_active(self, new_value: bool) -> None:
|
||||
if new_value is not None and new_value != self.obj.is_active:
|
||||
if new_value != self.obj.is_active:
|
||||
self._is_active_new_value = new_value
|
||||
|
||||
def handle_replace(
|
||||
|
|
|
@ -114,7 +114,7 @@ def check_send_webhook_message(
|
|||
# double escape their URLs in a manner that escaped space characters
|
||||
# (%20) are never properly decoded. We work around that by making sure
|
||||
# that the URL parameters are decoded on our end.
|
||||
if stream is not None and unquote_url_parameters:
|
||||
if unquote_url_parameters:
|
||||
stream = unquote(stream)
|
||||
|
||||
if user_specified_topic is not None:
|
||||
|
|
Loading…
Reference in New Issue