Peter
Peter

Reputation: 13485

pylint: Exclude directory

Suppose I have the following directory structure:

adir/
  __init__.py
  afile.py
bdir/
  __init__.py
  bfile.py
  adir/
    __init__.py
    afile.py

I want to run pylint on everything, except the directory bdir/adir.

Is there any way to do this? Things that do not work:

It seems that pylint's ignore-filters only work with the name of the file or directory, not the full path.

Is there any way to achieve this?

Upvotes: 12

Views: 9890

Answers (1)

Maxim Suslov
Maxim Suslov

Reputation: 5475

It should be --ignore-paths=bdir/adir. Works both on Windows and Linux.

Regarding --ignore_patterns=.*bdir/adir.*:

  • it contains typo: --ignore_patterns -> --ignore-patterns
  • according to documentation:

ignore-patterns

Files or directories matching the regex patterns are skipped. The regex matches against base names, not paths. The default value ignores emacs file locks

Default: ^.#

You specify not a base name (it includes parent folder).

Upvotes: 9

Related Questions