Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pylint 退场计划 #59226

Closed
ooooo-create opened this issue Nov 21, 2023 · 1 comment · Fixed by #59330
Closed

Pylint 退场计划 #59226

ooooo-create opened this issue Nov 21, 2023 · 1 comment · Fixed by #59330
Assignees
Labels
contributor External developers HappyOpenSource 快乐开源活动issue与PR PFCC Paddle Framework Contributor Club,https://github.com/PaddlePaddle/community/tree/master/pfcc status/close 已关闭

Comments

@ooooo-create
Copy link
Contributor

ooooo-create commented Nov 21, 2023

Pylint 退场计划

背景

Pylint 是一个 Python 端的 Linter,我们在很早之前就引入了 Pylint,但是只是利用其可以编写插件的能力,添加了一个自定义插件用于监控 docstring 的写法而已,但可能由于 CI 流水线的变动,在某个时间点后该 hook 始终处于不生效的状态,导致 docstring 始终没有被监控到,而且只会在 commit 时候会造成干扰。该问题的详细分析见 #47821

由于 Pylint 长时间不生效,我们的 docstring 的写法也几经迭代,已经和当时的 Pylint 里的规则相差甚远,此时开启已经没有意义了,而且 docstring 的检查完全不需要依托于 Pylint,基于内置的 ast 可以同样快速完成一个检查工具,所以 Pylint 的存在已经没有意义了。

从 Pylint 的 Python 代码检查角度来看,我们已经引入了 ruff,其实现了大多数 Pylint rules,且有更快的速度和统一的使用方式,从这个角度来看保留 Pylint 也是没有意义的。

另外我们所使用的 Pylint 过旧,会导致 Python 3.11 下无法运行,阻塞 commit,也会影响部分 Docker 镜像的升级。

综上,Pylint 已经没有存在的必要了,我们需要将其移除。

任务细节

pre-commit hook 移除

Pylint 一直作为一个 pre-commit hook 存在的,因此首先我们需要在 .pre-commit-config.yaml 中将其移除,其相关的 tools/codestyle 下的脚本、插件、测试文件均需移除

镜像清理

为了能够减少 CI 流水线时间,我们会将部分依赖写在 Dockerfile 中,Pylint 就是其中之一,Pylint 退场后自然应该将相关依赖项清理掉,部分镜像中直接标记了 #For docstring checker 字样,相关依赖均无用,可以直接清理

文档更新

更新贡献指南中的「代码风格检查指南」章节 https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/dev_guides/git_guides/codestyle_check_guide_cn.html

任务进展

@SigureMo

@luotao1
Copy link
Contributor

luotao1 commented Nov 29, 2023

https://github.com/PaddlePaddle/docs/blob/develop/docs/dev_guides/docs_contributing_guides_cn.md?plain=1#L140

@ooooo-create @SigureMo 这篇文档里的pylint部分也可以删了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers HappyOpenSource 快乐开源活动issue与PR PFCC Paddle Framework Contributor Club,https://github.com/PaddlePaddle/community/tree/master/pfcc status/close 已关闭
Projects
3 participants