I have installed and configured and ran pylint like this:
pip install pylint==2.15.3
pylint --generate-rcfile > pylintrc
pylint ./*
However, it is complaining about several non-python files (pylintrc, pytest.ini, various markdown files, etc.)
An example of a few of those complaints:
************* Module README README.rst:1:6: E0001: Parsing failed: 'invalid syntax (, line 1)' (syntax-error) ************* Module pylintrc pylintrc:6:1: E0001: Parsing failed: 'cannot assign to operator (, line 6)' (syntax-error) ************* Module pytest pytest.ini:2:12: E0001: Parsing failed: 'invalid syntax (, line 2)' (syntax-error)
First, this is very surprising, I'd expect pylint to automatically only care about *.py files.
I've tried quite a bit of searching since this seems like it should be a very common problem, but no luck so far.
I've tried setting the [MAIN]
ignore
since that sounds promising, and looks like it works for others, but no luck. This is what I have for it:
[MAIN]
ignore=
CVS,
README.rst
README.md
*.rst,
*.md,
pylintrc,
pytest,
*.txt,
*.toml
I tried without any wildcards since I read they aren't supported, but no improvement there.
I also tried configuring ignored-modules
similarly to what I have for ignore
, but no luck there.
I've also tried enumerating things on the command line via:
pylint --ignore=README.rst --ignore=*.md ./*
but no luck there either.
I did have some success finally with the ignore patterns when configured like below, but that can't possibly be the right way to do things?
ignore-patterns=(^\.#)|(.*\.md)|(.*\.rst)|(pytest\.ini)
Is there any way to configure pylint to only care about *.py files? Or if that isn't possible what is the right way to configure pylint to exclude and ignore files I don't want it to look at?