Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Document how to test plugins

未关闭
#705 3 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
52/100
Issue 类型
文档
描述清晰度
基本清楚
活跃度
冷清
技术栈
python
领域
documentation

调研方向

从现有的 plugin-development/formatters 文档以及 issue 中描述的 flake8 2.x 到 3.x 迁移背景开始。记录一个完整示例,涵盖有效的函数或类入口点、针对一项检查测试字符串,以及不使用子进程运行标准检查。示例回答全部三个问题并适合用于文档 PR,即视为完成。

由索引模型根据 Issue 内容生成。

描述

component:docs component:legacy-api

In GitLab by @stephenfin on May 23, 2019, 03:07

I'm trying to migrate hacking from flake8 2.x to 3.x and finding it extremely difficult to do so because the internals of the flake8 have changed so drastically between these versions (plus hacking does some stuff that's too smart for its own good, IMO). The flake8 documentation provides some introductory text on plugins, including a guide on writing a "formatting type" plugin (though it doesn't explain what a formatting plugin actually is...) but there's nothing about testing this or even what type of class or function the entrypoints should point to. The biggest issue I have is that I want to run flake8 in it entirety (i.e. with both the standard checks and my plugin enabled) on a test string, but there doesn't appear to be anyway to do this.

Would it be possible to get a small worked example that demonstrates:

  • What the entrypoint should look like (i.e. if it can be a Python function, a class, or both)
  • How you can test a string against only a single check
  • How you can test a string against flake8's standard checks (without having to resort to a subprocess call)

I'll happily submit a documentation PR based on this example, if it would be helpful.

主要语言
Python
星标
3.8k
派生
356
平均合并
3 小时 25 分钟
30 天内合并 PR
5

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

PyCQA/flake8 的其他 Issue

查看 PyCQA/flake8 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。