babbush / HistoricalFermiLib

This is repo where we developed FermiLib, which then became OpenFermion
Apache License 2.0
1 stars 0 forks source link

Use 4 spaces for indentation #65

Closed maffoo closed 7 years ago

maffoo commented 7 years ago

We should consider changing to use 4 spaces for indentation. That's what projectq uses and it's pretty universal in python code generally.

babbush commented 7 years ago

Oh boy. I'm not opposed to it but I don't personally want to do it either. Volunteers? Please make sure that ./precommit_tests executes without issue.

damiansteiger commented 7 years ago

If nobody wants/has time to do it earlier, I can do next week probably after Wednesday.

Spaceenter commented 7 years ago

Possible tool to do this: https://pypi.python.org/pypi/Reindent/0.1.1

Otherwise, VIM commands: http://stackoverflow.com/questions/5217058/reformat-a-python-file-to-have-4-space-indentations

Spaceenter commented 7 years ago

Tried https://pypi.python.org/pypi/Reindent/0.1.1 and it works well with just one line of code (./reindent /path/to/fermilib/).

The problem is that after making 2 spaces to 4 spaces, lots of lines exceed 80 char limit so the lint complains. Should find a way to auto-format lines with char > 80.

babbush commented 7 years ago

@Spaceenter did this. Zero complaints from pep8. Thanks Wei!