Docstrings should be indented at more than just the first line
See https://gist.github.com/dhermes/85c3a3a464d2cff312ea for a (super hacky) way to make this work.
Currently, pep8ify takes
def hello_func(name):
"""Prints hello with the name.
Args:
name: String, to print.
"""
print 'Hello %s, nice to meet you.' % (name,)
and turns it into
def hello_func(name):
"""Prints hello with the name.
Args:
name: String, to print.
"""
print 'Hello %s, nice to meet you.' % (name, )
Running indent_docstrings.py on it gives the desired:
def hello_func(name):
"""Prints hello with the name.
Args:
name: String, to print.
"""
print 'Hello %s, nice to meet you.' % (name, )
Agreed.
Unfortunately, I don't have much time to spend on this project. If someone has time to make a pull request, I will happily merge.
I'm happy to take a stab. Care to point out the entry point in the code where indenting occurs? Also, do you use ast to parse the tree or something else?
We use lib2to3, which is a bit of a wrapper around the ast.
I think this is probably occurring as part of fix_indentation, but I'm not positive.