I have tried pylint --indent-string=" "
, but I keep getting the help message. What am I supposed to do to configure pylint.
Asked
Active
Viewed 6,755 times
8

Flair
- 2,609
- 1
- 29
- 41
2 Answers
11
According to the docs, " "
means 4 spaces.
You need to use single quotes: pylint --indent-string=' '

KevinG
- 882
- 3
- 16
- 33
-
Doesn't seem to work Bad indentation. Found 2 spaces, expected 4 – Vincent Alex Oct 14 '22 at 21:25
-
You should also update this: `indent-after-paren=2` – thdoan Apr 02 '23 at 23:14
1
I realize you're probably not having this issue anymore but figure i'd suggest another solution that could be useful for others.
Within pylintrc, generated with pylint --generate-rcfile
have a look at the line configuring indent-string
:
# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
# tab).
indent-string=" "
Here whatever number of spaces or tabs you put within the parenthesis will be considered the allowed indent style.
You can then run pylint using this file e.g.
pylint --rcfile .pylintrc <.py file to check>
I should note that the documentation for pylint use markdown which folds multiple whitespaces into one i.e. (the " " into " ") and hence can be a bit confusing when looking at the docs as it would suggest " " defines a 4 space indent.

Benjamin Carpenter
- 31
- 4