It’s possible to use the # type: ignore
comment to ignore linting on a specific line:
print(syntax error) # type: ignore
However, the same is not possible with magic commands:
%load_ext autoreload # type: ignore
'''
yields error "ModuleNotFoundError: No module named 'autoreload # type: ignore'"
'''
Removing it, however, yields the linting error “Expected expression
“. And of course, using # type: ignore
in the top of the file is not desirable, as it would disable all linting for the whole file.
Is it possible to disable PyRight linting for magic commands?