Skip to main content

Flake8 插件强制执行一致的类型注释样式

项目描述

flake8 类型注释

wemake.services 构建状态 覆盖范围 蟒蛇版本 PyPI 版本

该工具用于验证类型注释语法,因为它最初Guido van Rossum提出。

安装

pip install flake8-type-annotations

代码示例

# Consistency with this plugin:
def function(param=0, other: int = 0) -> int:
    return param + other


# Possible errors without this plugin:
def function(param=0, other: int=0)->int:
    return param + other

错误代码

错误代码 描述
T800 参数注释和默认值之间缺少空格
T801 返回类型注释中缺少空格

执照

麻省理工学院。

项目详情


下载文件

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

源分布

flake8-type-annotations-0.1.0.tar.gz (4.0 kB 查看哈希)

已上传 source

内置分布

flake8_type_annotations-0.1.0-py3-none-any.whl (6.9 kB 查看哈希

已上传 py3