我希望linter通过在作业末尾错误添加逗号来限制我使用元组。
我认为使用方括号显式创建元组是创建方括号的唯一正确方法。
我已经尝试过将'Pylint'与选项'--enable = all'结合使用,但并没有警告我危险。
# this looks bad and probably was added by mistake
a = 'abc',
# this immediately informs the reader that this is a tuple
# and for sure was added deliberately
b = ('abc',)
我正在寻找适用于所有python linter的规则,该规则会为第一个任务返回警告,但不会为第二个任务返回警告。
如果您有任何寻找短绒棉规则的技巧,将不胜感激。