跳转到主要内容

一个Flake8插件和预提交钩子,用于检查模块是否已定义 '__all__'。

项目描述

一个Flake8插件和预提交钩子,用于检查模块是否已定义‘__all__’。

文档

Documentation Build Status Docs Check Status

测试

Linux Test Status Windows Test Status macOS Test Status Coverage

PyPI

PyPI - Package Version PyPI - Supported Python Versions PyPI - Supported Implementations PyPI - Wheel

Anaconda

Conda - Package Version Conda - Platform

活动

GitHub last commit GitHub commits since tagged version Maintenance PyPI - Downloads

QA

CodeFactor Grade Flake8 Status mypy status

其他

License GitHub top language Requirements Status


安装

flake8-dunder-all 可以从PyPI或Anaconda安装。

使用 pip 安装

$ python -m pip install flake8-dunder-all

使用 conda 安装

  • 首先添加所需的频道

$ conda config --add channels https://conda.anaconda.org/conda-forge
$ conda config --add channels https://conda.anaconda.org/domdfcoding
  • 然后安装

$ conda install flake8-dunder-all

flake8代码

代码

描述

DALL000

模块缺少__all__。

用作预提交钩子

请参阅 pre-commit 的说明

示例 .pre-commit-config.yaml

- repo: https://gitlab.com/pycqa/flake8
  rev: 3.8.1
  hooks:
   - id: flake8
     additional_dependencies: [flake8-dunder-all==0.4.1]

ensure-dunder-all 脚本

还有一个脚本会自动为没有__all__的文件添加它。

有关详细信息,请参阅文档

由以下机构支持

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误日志 StatusPage StatusPage 状态页