Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix mypy violations (delete type: ignore ) (with mypy-0.900) #9327

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions sphinx/util/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -573,21 +573,21 @@ def setup(app: "Sphinx", status: IO, warning: IO) -> None:
for handler in logger.handlers[:]:
logger.removeHandler(handler)

info_handler = NewLineStreamHandler(SafeEncodingWriter(status)) # type: ignore
info_handler = NewLineStreamHandler(SafeEncodingWriter(status))
info_handler.addFilter(InfoFilter())
info_handler.addFilter(InfoLogRecordTranslator(app))
info_handler.setLevel(VERBOSITY_MAP[app.verbosity])
info_handler.setFormatter(ColorizeFormatter())

warning_handler = WarningStreamHandler(SafeEncodingWriter(warning)) # type: ignore
warning_handler = WarningStreamHandler(SafeEncodingWriter(warning))
warning_handler.addFilter(WarningSuppressor(app))
warning_handler.addFilter(WarningLogRecordTranslator(app))
warning_handler.addFilter(WarningIsErrorFilter(app))
warning_handler.addFilter(OnceFilter())
warning_handler.setLevel(logging.WARNING)
warning_handler.setFormatter(ColorizeFormatter())

messagelog_handler = logging.StreamHandler(LastMessagesWriter(app, status)) # type: ignore
messagelog_handler = logging.StreamHandler(LastMessagesWriter(app, status))
messagelog_handler.addFilter(InfoFilter())
messagelog_handler.setLevel(VERBOSITY_MAP[app.verbosity])
messagelog_handler.setFormatter(ColorizeFormatter())
Expand Down
12 changes: 6 additions & 6 deletions sphinx/util/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,13 +223,13 @@ def _restify_py36(cls: Optional[Type]) -> str:
else:
reftext = ':class:`%s`' % qualname

if cls.__args__ is None or len(cls.__args__) <= 2: # type: ignore # NOQA
params = cls.__args__ # type: ignore
elif cls.__origin__ == Generator: # type: ignore
params = cls.__args__ # type: ignore
if cls.__args__ is None or len(cls.__args__) <= 2:
params = cls.__args__
elif cls.__origin__ == Generator:
params = cls.__args__
else: # typing.Callable
args = ', '.join(restify(arg) for arg in cls.__args__[:-1]) # type: ignore
result = restify(cls.__args__[-1]) # type: ignore
args = ', '.join(restify(arg) for arg in cls.__args__[:-1])
result = restify(cls.__args__[-1])
return reftext + '\\ [[%s], %s]' % (args, result)

if params:
Expand Down