hhatto / autopep8

A tool that automatically formats Python code to conform to the PEP 8 style guide.
https://pypi.org/project/autopep8/
MIT License
4.56k stars 290 forks source link

Indentation not fixed with range #241

Open chtenb opened 8 years ago

chtenb commented 8 years ago

From https://github.com/hhatto/autopep8/issues/133 and https://github.com/hhatto/autopep8/pull/134 it seems that this should be working.

Example:

$ cat sandbox/foo.py
def Hello():
  return 1

$ cat sandbox/foo.py | autopep8 - --line-range 1 3
def Hello():
  return 1

Is this intended behaviour, or should it be indented correctly?

$ autopep8 --version
autopep8 1.2.2

$ python3 --version
Python 3.5.0
myint commented 8 years ago

I think I disabled this on purpose. The indentation corrections were sometimes buggy with --line-range. I think this may be a duplicate of https://github.com/hhatto/autopep8/issues/175#issuecomment-87096771.