berkerpeksag / astor

Python AST read/write
https://pypi.org/project/astor/
BSD 3-Clause "New" or "Revised" License
810 stars 102 forks source link

Add PEP 8 and coveragepy support to tox.ini #38

Closed berkerpeksag closed 5 years ago

isidentical commented 5 years ago

What syntax checker should be used? Current version have some problems with flake8 but they can be fixed quite easily;

astor/rtrip.py:84:9: E722 do not use bare 'except'
astor/string_repr.py:110:5: E722 do not use bare 'except'
astor/code_gen.py:26:1: F401 '.string_repr.string_triplequote_repr' imported but unused
astor/code_gen.py:152:80: E501 line too long (81 > 79 characters)
astor/code_gen.py:153:30: E114 indentation is not a multiple of four (comment)
astor/code_gen.py:153:30: E116 unexpected indentation (comment)
astor/code_gen.py:158:9: F841 local variable 'newline' is assigned to but never used
astor/code_gen.py:584:80: E501 line too long (81 > 79 characters)
berkerpeksag commented 5 years ago

Yes, flake8 is good enough.

E114, E116, E501 should be ignored.

isidentical commented 5 years ago

Yes, flake8 is good enough.

E114, E116, E501 should be ignored.

I added W504 too for keeping statements like;

        embedded = ((precedence > Precedence.Expr) +
                    (precedence >= Precedence.Assign))