Issue929

Title replace reindent.py with flake8 call
Priority wish Status resolved
Superseder Nosy List jendrik, malte, silvan
Assigned To jendrik Keywords
Optional summary

Created on 2019-10-02.23:38:57 by jendrik, last changed by jendrik.

Messages
msg9012 (view) Author: jendrik Date: 2019-10-16.14:03:12
Merged.
msg8984 (view) Author: jendrik Date: 2019-10-03.14:16:04
I also think we shouldn't bother with Python 2 for the developer side. However, we should make sure that all supported Python versions are tested. I opened issue930 for this.

I'll merge this and related issues when I'm in the office since they require changes to the buildbot containers.
msg8981 (view) Author: malte Date: 2019-10-03.13:55:45
OK, looks good to merge then.

Is it worth bothering with Python 2? It is reaching end of support, right? Supporting Python 2 on the user side is one thing, but on the developer side I think it's less important. (Others might think differently.)
msg8980 (view) Author: jendrik Date: 2019-10-03.13:20:02
Yes, the current code passes the tests after this change.

Flake8 just reports style violations and prints instructions on how to fix them to stdout.

You're right about the Python versions. I'm currently experimenting with  running our tests under both Python 2 and 3 and will open an issue for this soon.
msg8979 (view) Author: malte Date: 2019-10-03.13:14:38
By that you mean that our code currently passes cleanly after making this change?

Does flake just report style violations or also fix them? I see in the pull request that the old code included instructions to the user on how to fix the problems that were encountered, whereas the new one doesn't have something similar.

This will only work with Python3, right? Flake depends on using the right Python version, and the instructions in the code would install the Python3 version if I see it correctly. (I'm not saying that's a bad thing.)
msg8978 (view) Author: jendrik Date: 2019-10-03.12:43:17
Pull request: https://bitbucket.org/jendrikseipp/downward/pull-requests/137

For this issue I only changed the tool, not the tests, so there are no changes to the translator code.
msg8974 (view) Author: malte Date: 2019-10-03.08:50:56
Sounds good. Can you show us a diff of what this would do to the Python code?
msg8973 (view) Author: jendrik Date: 2019-10-02.23:38:57
After issue928 is merged, reindent.py is the only file in our repo that doesn't support Python 3. There is a Python 3 version of reindent.py in the Python repo, but it's not backward compatible. Since using reindent.py is rather old-fashioned anyway, I'd like to replace it with a call to the much more commonly used flake8 tool (https://gitlab.com/pycqa/flake8). For now, we can let flake8 check only for the same whitespace/tabs errors that reindent.py finds. Any opinions on this?
History
Date User Action Args
2019-10-16 14:03:12jendriksetstatus: reviewing -> resolved
messages: + msg9012
2019-10-03 14:16:04jendriksetmessages: + msg8984
2019-10-03 13:55:45maltesetmessages: + msg8981
2019-10-03 13:20:02jendriksetmessages: + msg8980
2019-10-03 13:14:38maltesetmessages: + msg8979
2019-10-03 12:43:17jendriksetstatus: chatting -> reviewing
messages: + msg8978
2019-10-03 10:48:21silvansetnosy: + silvan
2019-10-03 08:50:56maltesetstatus: unread -> chatting
messages: + msg8974
2019-10-02 23:38:57jendrikcreate