You can read more about Pylint online. Let’s just dive into their documentation, in particular on how to run Pylint where they describe the usage of configuration files. Pylint looks for the following locations:
pylintrc
in the current working directory.pylintrc
in the current working directory. I would recommend using this option for every project as it fits in with many other dot configuration files that other libraries use.- If the current working directory is in a Python module, Pylint searches up the hierarchy of Python modules until it finds a
pylintrc
file. This allows you to specify coding standards on a module-by-module basis. Of course, a directory is judged to be a Python module if it contains an__init__.py
file. - The file named by environment variable
PYLINTRC
. This option might be useful when running continuous integrations and you want to switch between configuration files without changing the actual files or pylint command arguments. - if you have a home directory which isn’t
/root
: 5.1..pylintrc
in your home directory 5.2..config/pylintrc
in your home directory /etc/pylintrc
for global configuration of machines. I would avoid this for any hidden configuration mystery bugs.
I would avoid all options after 2 because it won’t be project specific and difficult to share automatically. If it is a project specific configuration file, then it can be checked into a repository and anyone who is working on the codebase will have the same configuration. A very useful command is:
pylint --generate-rcfile
which will print the current pylint configuration to the standard output. You can easily pipe this output to a file in order to freeze the current configuration. I would recommend starting fresh with this command and then modifying as you go along.