8

I have tried pylint --indent-string=" ", but I keep getting the help message. What am I supposed to do to configure pylint.

Flair
  • 2,609
  • 1
  • 29
  • 41

2 Answers2

11

According to the docs, " " means 4 spaces.

You need to use single quotes: pylint --indent-string=' '

KevinG
  • 882
  • 3
  • 16
  • 33
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.