← Back to index

directives_type_ignore_file1.py

True Positive
False Positive
False Negative
Optional (detected)
Warning or Info
TP: 0
FP: 0
FN: 0
Optional: 0 / 0
1#!/usr/bin/env python
2
3# type: ignore
4
5"""
6Tests a file-level type ignore comment.
7"""
8
9# Specification: https://typing.readthedocs.io/en/latest/spec/directives.html#type-ignore-comments
11# > A # type: ignore comment on a line by itself at the top of a file, before any
[unused-type-ignore-comment] Unused blanket `type: ignore` directive
12# > docstrings, imports, or other executable code, silences all errors in the file.
13# > Blank lines and other comments, such as shebang lines and coding cookies, may
14# > precede the # type: ignore comment.
[unused-type-ignore-comment] Unused blanket `type: ignore` directive
16x: int = "" # No error should be reported