Uploaded image for project: 'Couchbase Python Client Library'
  1. Couchbase Python Client Library
  2. PYCBC-1176

Apply autopep8 formatting to Couchbase Python project

    XMLWordPrintable

Details

    • Task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.2.2
    • None
    • None
    • 1

    Description

      Consistent formatting of the Python SDK should be implemented. In the future, the ideal move will be to use black as the client's formatter. However, with needed support for Python 3.5 (and with black still being in beta), autopep8 will be used in the interim.

      This task is to mark the initial formatting of the entire Python project using autopep8.

      NOTE: It is not that black cannot be used with Python 3.5, it is that black will allow a comma after the last item in a list or the last parameter in a function. Python 3.5 does not allow a comma after the last parameter of a function. AFAIK, one cannot specify to black to not allow this behavior, it is inferred upon inspecting the file being formatted. Since too many files need formatting applied to be able to handle this scenario, autopep8 it is (for now ).

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          jared.casey Jared Casey added a comment -

          Need to exclude ./couchbase/tests because the _init_.py module has import couchbase_tests.test_sync as test_sync defined at the bottom of the file. autopep8 will move it to the top which will cause the tests to not run. Of course, the way tests are handled should be updated (at the moment the test suite is needlessly convoluted), but that will come eventually.

          autopep8 --in-place --aggressive  --recursive . --exclude ./couchbase/tests
          

          jared.casey Jared Casey added a comment - Need to exclude ./couchbase/tests because the _ init _.py module has import couchbase_tests.test_sync as test_sync defined at the bottom of the file. autopep8 will move it to the top which will cause the tests to not run. Of course, the way tests are handled should be updated (at the moment the test suite is needlessly convoluted), but that will come eventually. autopep8 --in-place --aggressive --recursive . --exclude ./couchbase/tests

          People

            jared.casey Jared Casey
            jared.casey Jared Casey
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty