I have tried pylint --indent-string=" "
, but I keep getting the help message. What am I supposed to do to configure pylint.
According to the docs, " "
means 4 spaces.
You need to use single quotes: pylint --indent-string=' '
indent-after-paren=2
–
Messinger 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.
© 2022 - 2024 — McMap. All rights reserved.