python是否有一个lint规则可以自动检测字符串连接并建议字符串格式?

2024-04-27 00:34:35 发布

您现在位置:Python中文网/ 问答频道 /正文

由于使用字符串连接是一种不好的气味,我想自动检测出CI管道的lint步骤,并向开发人员报告。在

例如,检测"The user " + user.name + " is blocked",并建议使用.format方法-"The user {} is blocked".format(user.name)。在

我已经在pylintflake8中寻找过规则,但没有人试图发现这种不良行为。在


Tags: the字符串nameciformat管道开发人员is