pylint ignore by directory

后端 未结 7 1463
南旧
南旧 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:16

    As of right now, --ignore is not working on directories. (There's an open issue on https://github.com/PyCQA/pylint/issues/2686)

    Turns out that only the file name, and not the whole path is tested against the black list. (As pointed in the same pull request: https://github.com/PyCQA/pylint/issues/2686#issuecomment-453450455)

    The option --ignore-patterns has the same problem, but there was an attempt to fix it when I checked. (https://github.com/PyCQA/pylint/pull/3266)

    In your case, the best solution right now would be to use a regular expression to match the patterns you want in your files, which was also my case. As I am not really well-versed in regex, so I used https://regex101.com, which I recommend.

提交回复
热议问题