Github workflow pylint: How do I disable all docstring errors warnings?

I’ve setup the pylint workflow on GitHub.

The is the path:

myRepo/.github/workflows/pylint.yml

I added a pylintrc file in the workflows directory with the following options:

[MESSAGES CONTROL]

disable=missing-module-docstring,
        missing-function-docstring,
        missing-class-docstring

But now the build fails, so I’ve done this in the wrong way.

Is it possible to add the options I have in my pylintrc file to pylint.yml?

How do I do this correctly?

  • You may need to specify the path to the .pylintrc file in the github action. Either with the PYLINTRC environment variable or the –rcfile=.pylintrc command line argument.

    – 

  • where do I find the github action? everything is defined in a yaml file, I’m not sure where I’d set the PYLINTRC env variable

    – 

  • I just noticed that you put pylintrc in the workflows directory. Try putting it in your top level project folder.

    – 

  • 1

    If that doesn’t work, you can add the –rcfile=pylintrc argument to the pylint.yml file like this: pylint –rcfile=pylintrc $(git ls-files ‘*.py’)

    – 

  • 1

    Done. Glad it’s working for you now. It’s not clear to me either the reason for the downvote. FWIW, sometimes I have questions and answers that get downvoted for no obvious reason

    – 




Make sure that the pylintrc (or sometimes called .pylintrc) file is at the top level of your project.

Theoretically pylint should be able to pick up that location by default, but if it still isn’t working, pass in the argument –rcfile=pylintrc to pylint.
For example:

pylint --rcfile=pylintrc $(git ls-files '*.py')

Please also ensure that the pylintrc file is formatted correctly. This page shows an intial valid configuration:
https://www.getcodeflow.com/pylint-configuration.html

Leave a Comment