fortran-lang / fprettify

auto-formatter for modern fortran source code
https://pypi.python.org/pypi/fprettify
Other
370 stars 76 forks source link

Add a diff-only option #80

Closed jhaiduce closed 4 years ago

jhaiduce commented 4 years ago

This PR adds a command-line option to print diffs of the file(s) to standard output instead of changing the files in-place.

pseewald commented 4 years ago

Thanks a lot! There are problems with Python 2.7 (fprettify should still be compatible with python 2):

  File "/home/travis/build/pseewald/fprettify/fprettify/__init__.py", line 984
    def diff(a: str, b: str, a_name: str, b_name: str) -> str:
              ^
SyntaxError: invalid syntax

could you check?

jhaiduce commented 4 years ago

Thanks a lot! There are problems with Python 2.7 (fprettify should still be compatible with python 2):

  File "/home/travis/build/pseewald/fprettify/fprettify/__init__.py", line 984
    def diff(a: str, b: str, a_name: str, b_name: str) -> str:
              ^
SyntaxError: invalid syntax

could you check?

Just pushed a commit that changes the type-hinting to a python 2.7 compatible syntax.