pylint不会忽略模块

时间:2017-05-13 13:16:30

标签: python pylint

我无法弄清楚运行pylint的语法。我需要它跳过所有django migrations文件夹,但是当我像这样运行它时

pylint catalog --ignored-modules=migrations

我仍然会检查我的迁移:

************* Module catalog.migrations.0001_initial
C: 19, 0: Line too long (114/100) (line-too-long)
C:  1, 0: Invalid module name "0001_initial" (invalid-name)
C:  1, 0: Missing module docstring (missing-docstring)
C:  8, 0: Missing class docstring (missing-docstring)
************* Module catalog.migrations.0002_botstateviewtemplate
C: 18, 0: Line too long (114/100) (line-too-long)
C:  1, 0: Invalid module name "0002_botstateviewtemplate" (invalid-name)
C:  1, 0: Missing module docstring (missing-docstring)
C:  8, 0: Missing class docstring (missing-docstring)
************* Module catalog.migrations.0003_delete_botstateviewtemplate
C:  1, 0: Invalid module name "0003_delete_botstateviewtemplate" (invalid-name)
C:  1, 0: Missing module docstring (missing-docstring)
C:  8, 0: Missing class docstring (missing-docstring)

我缺少什么正确的语法?

尝试catalog.migrations

更新:问题仍然存在

enter image description here

2 个答案:

答案 0 :(得分:0)

我认为正确的方法是:pylint catalog --ignore=0001_initial.py

答案 1 :(得分:0)

 --ignore=<file[,file…]>
    Add files or directories to the blacklist. They should be base names, not paths.

所以正确的方法应该是:

pylint catalog --ignore=migrations