Skip to content

 Reformat, and enforce format, fix #125

Guilhem Saurel requested to merge gsaurel/crocoddyl:topic/format into devel

Hi,

This PR:

  • heavily reformats all python files, with the help of tools like isort, flake8 & yapf.
  • enforces this new format to be followed by a CI check.
  • fixes the CI to run tests, in order to be sure that this reformatting did not break anything.

I had to make a few choices about the format, and they are documented in the setup.cfg file.

The most obvious one is the line length. Linters usually set this to 79. I find it way to short, but I am open to discussions about this.

Then, I had to ignore several issues for flake8:

  • you are using a C++ naming convention. I hate that, but I will not try to make you change this, so these are disabled:
    • N802: function name should be lowercase
    • N803: argument name should be lowercase
    • N806: variable in function should be lowercase
  • you are assigning lambda expressions everywhere, I don't understand why. As it would require more work to fix this, I disabled:
    • E731: do not assign a lambda expression, use a def
  • I was a bit lazy about those, but I should be able to fix them soon (so this PR is in WIP state):
    • E722: do not use bare except, specify exception instead
    • E741: do not use variables named ‘l’, ‘O’, or ‘I’
    • W504: line break after binary operator
Edited by Guilhem Saurel

Merge request reports