Uploaded image for project: 'Qpid Proton'
  1. Qpid Proton
  2. PROTON-2320

Apply autofixes to resolve some flake8 code formatting issues

    XMLWordPrintableJSON

Details

    • Task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • proton-c-0.33.0
    • proton-c-0.34.0
    • python-binding
    • None

    Description

      Python code in Proton does not follow PEP8. There are automated tools which can reformat the code to be more compliant (fix indentation, add spaces around operators, ...).

      pip install autopep8
      for f in `find -name "*.py"`; do autopep8 --in-place $f; done
      

      Autopep8 has several level of "aggressiveness". The least aggressive setting only changes whitespace. At a more aggressive setting, autopep8 will also rewrite some code constructs.

      My plan is to commit this in several stages. Avoid mixing manual changes and automatically generated changes in a single commit. Push the whitespace changes first and only then let autopep8 to be more creative; otherwise the rewrites get drowned in the huge initial diff.

      I don't want to add flake8 to CI jobs just yet; I want to wait a few days with that.

      Attachments

        Issue Links

          Activity

            People

              jdanek Jiri Daněk
              jdanek Jiri Daněk
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: