Opened 4 years ago

Closed 4 years ago

#3949 closed change (fixed)

Change style guide for Python to be more compatible with PEP8

Reported by: kvas Assignee:
Priority: P3 Milestone:
Module: Unknown Keywords:
Cc: Blocked By: #3950, #3952
Blocking: Platform: Unknown / Cross platform
Ready: yes Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

Description (last modified by kvas)

Background

Our style guide recommends 2 space indents for all code, including Python code. This is in contradiction to PEP8 recommendation. We would like to change the style guide to allow 4 space indents for Python (after which PEP8 would take over this aspect of formatting).

It would be undesirable to have a mixture of 2 space and 4 space indented code in our repositories, so this issue should also cover the reformatting of existing code. It doesn't have to happen immediately, but there should be a viable plan for how we get to a state where all our code is compliant with our style guide.

What to change

  • Update the style guide to allow 4 space indents for Python code.
  • Make all the Python code in our repositories consistently use 4 space indents (this doesn't include ensure_dependencies.py script, which is updated automatically and any repositories/files that don't originate at Eyeo and are not mostly developed by us).
  • While we're at it, also correct other style guide violations in existing code that can be autocorrected. After the change all errors reported by pep8 would also be violations of our guide.
  • When readability suffers from strict adherence to PEP8, preserve readability. Specifically for now lines that exceed 79 characters don't need to be changed (our experiments showed that corrections by autopep8 are not always possible in those cases and might decrease readability when they are).

Overview


Change History (4)

comment:1 Changed 4 years ago by kvas

  • Description modified (diff)

comment:2 Changed 4 years ago by kvas

  • Blocked By 3950 added

comment:3 Changed 4 years ago by sebastian

  • Blocked By 3952 added

comment:4 Changed 4 years ago by sebastian

  • Priority changed from Unknown to P3
  • Ready set
  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.