跳转到主要内容

flake8-type-ignore 允许您禁止在类型化Python代码中的 type: ignore 注释。

项目描述

flake8-type-ignore

flake8-type-ignore 允许您禁止在类型化Python代码中的 type: ignore 注释。

用法

当此插件安装到您的Python环境中运行 flake8 时,它将根据以下表格引发错误。例如,安装此插件将在以下代码中引发 flake8 错误

# This line raises TI100
x: str = 1  # type: ignore

# This line raises both TI101 and TI139
x.y = 2  # type:ignore[attr-defined,misc]

def print_only_strings(arg: str):
    print(arg)

# This line raises TI104
print_only_strings(123)

错误代码

flake8-type-ignore 错误代码 mypy 错误代码
TI001 无效 type: ignore 注释的元错误代码。
TI002 未知 mypy 错误代码的元错误代码。
TI100 type: ignore 注释
TI101 attr-defined
TI102 name-defined
TI103 call-arg
TI104 arg-type
TI105 call-overload
TI106 valid-type
TI107 var-annotated
TI108 override
TI109 return
TI110 return-value
TI111 assignment
TI112 type-arg
TI113 type-var
TI114 union-attr
TI115 index
TI116 operator
TI117 list-item
TI118 dict-item
TI119 typeddict-item
TI120 has-type
TI121 import
TI122 no-redef
TI123 func-returns-value
TI124 abstract
TI125 valid-newtype
TI126 str-format
TI127 str-bytes-safe
TI128 exit-return
TI129 no-untyped-def
TI130 未指定类型调用
TI131 冗余类型转换
TI132 比较重叠
TI133 不允许使用未导入的any
TI134 不允许返回any
TI135 不可达
TI136 冗余表达式
TI137 名称匹配
TI138 语法
TI139 杂项

许可协议

flake8-type-ignore 在BSD 3-Clause许可证下可用。有关详细信息,请参阅LICENSE文件。

项目详情


下载文件

下载适合您平台的文件。如果您不确定选择哪个,请了解更多关于安装包的信息。

源代码分布

flake8-type-ignore-0.1.0.post2.tar.gz (5.3 kB 查看哈希值)

上传时间 源代码

构建分布

flake8_type_ignore-0.1.0.post2-py3-none-any.whl (5.8 kB 查看哈希值)

上传时间 Python 3

支持