0

I'm using pylint to run code analysis on my project. However it needs to ignore one of the directories.

The only solutions I have found (eg this one) are several years old, and I have not had luck getting their methods do not work.

What I have tried:

  • Using the --ignore flag from command line. eg: pylint --ignore=directory_name
  • Putting an ignore command in the pylintrc file: ignore=directory_name
  • With and without *'s and /'s on the directory names

I will add that I am running pylint on a directory of packages and thus my pylint command looks like:

pylint3 --rcfile=pylintrc ./Data/Scripts/*

I am expecting that the ignore parameter is given higher priority than the "*" when I list the folders for it to search.

kaya3
  • 47,440
  • 4
  • 68
  • 97
sdfgeoff
  • 854
  • 9
  • 16

1 Answers1

0

I fell a little bad replying to my question so soon after posting it, but I found a solution. I don't particularly like it though.

The issue was that the card use a wildcard to specify directories, and the pylint ignore does not look at the names that are specified explicitly in the command.

So the solution was to create a __init__.py file in the /Data/Scripts folder (so that pylint treats it like a package), and then tell pylint to analyze the /Data/Scripts folder.

The folder structure now looks like:

Scripts
 + package_1
     file.py
 + package_to_ignore
     file.py
     file.py
 + package_3
     file.py
 __init__.py

__init__.py did not have to contain anything

sdfgeoff
  • 854
  • 9
  • 16