How Do I Create a Pylintrc File

I am running linux. Can I do something like pylint --generate-rcfile > .pylintrc and then make changes to the resulting .pylintrc file to override the default settings? And if so should it be in my ~/ directory or should I put it in .pylint.d?

3 Answers

You may put it in:

  • /etc/pylintrc for default global configuration
  • ~/.pylintrc for default user configuration
  • <your project>/pylintrc for default project configuration (used when you'll run pylint <your project>)
  • wherever you want, then use pylint --rcfile=<wherever I want>

Also notice when generating the rc file, you may add option on the command line before the --generate-rcfile, they will be considered in the generated file.

10

According to documentation here, we can use the following command to generate a pylint rc file with all its options present:

pylint --generate-rcfile > ${HOME}/.pylintrc

The above command will create the file .pylintrc under your home directory. Then you can tweak the rc file to fit your needs.

3

Windows user here. In my case, I just wanted to make an empty .pylintrc file but Windows doesn't allow it from Folder Explorer. So I had to run from command line:

echo dummyText > .pylintrc
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

David Miller

David Miller

Executive Financial & Market Analyst

David Miller brings 15 years of experience in global economics, personal finance strategy, and market dynamics. He specializes in turning complex economic trends into actionable insights for everyday readers.

Share this article
Twitter Facebook Pinterest