pylint ignore by directory

后端 未结 7 1460
南旧
南旧 2020-12-20 11:04

Following is from pylint docs:

--ignore=
    Add  to the black list. It should be a base name, not a path. You may set t         


        
相关标签:
7条回答
  • 2020-12-20 11:42

    Although this is an old question it showed up at the top of the list when we were searching stack overflow so i am posting our solution here in the hopes that it might be useful to someone else.

    To ignore subdirectories under a directory tree named 3rdparty, we added the following ignore-patterns entry to the [MASTER] entry in .pylintrc.

    # Add files or directories matching the regex patterns to the blacklist. The
    # regex matches against base names, not paths.
    # Ignore all .py files under the 3rdparty subdirectory.
    ignore-patterns=**/3rdparty/**/*.py
    

    This fixed the problem for pylint-1.7.1.

    We were originally confused by the "base names" clause in the comments. Apparently it does accept paths with wildcards. At least it did for us. Your mileage may vary.

    0 讨论(0)
提交回复
热议问题