Opened 4 years ago

Closed 4 years ago

#3952 closed change (fixed)

Fix whitespaces in Python code for compliance with PEP-8

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

Description (last modified by kvas)

Background

See #3949.

Based on our experiments we decided to ignore E309 and E501 and E125 when doing the automatic reformatting. The reasoning is:

  • E309 -- adding an empty line before the first method in a class (except for the cases when the class has a docstring, that's E301). The empty line seems redundant, especially in the cases when the class has only one method. The absence of the empty line is not reported by pep8, so there's no reason to insert it.
  • E501 -- breaking up long lines. At the moment autopep8 can't fix all long lines. Also, some of the fixes that it does actually make the code less readable and necessitate editing it by hand afterwards. To eliminate the prohibitive amount of manual work we choose to not fix the long lines for now.
  • E125 -- indentation of broken up lines. Fixing this leads to re-indentation of some code, which was originally PEP8-compliant, in a way that reduces readability.

What to change

Run autopep8 --ignore E309,E501,E125 on all Python code. Use pydiff to double check that the bytecode isn't changing.

Change History (29)

comment:1 Changed 4 years ago by sebastian

  • Description modified (diff)

comment:2 Changed 4 years ago by abpbot

A commit referencing this issue has landed:
https://hg.adblockplus.org/jshydra/rev/311f73842602

comment:3 Changed 4 years ago by kvas

  • Description modified (diff)

comment:4 Changed 4 years ago by abpbot

A commit referencing this issue has landed:
https://hg.adblockplus.org/buildtools/rev/3816c08c0f98

comment:7 Changed 4 years ago by abpbot

A commit referencing this issue has landed:
https://hg.adblockplus.org/cms/rev/407299178497

comment:8 Changed 4 years ago by abpbot

A commit referencing this issue has landed:
https://hg.adblockplus.org/abpbot/rev/5216edd0e5dc

comment:9 Changed 4 years ago by abpbot

Some commit referencing this issue has landed:
https://hg.adblockplus.org/adblockplus/rev/4e9995b5d4e4

Last edited 4 years ago by sebastian (previous) (diff)

comment:10 Changed 4 years ago by abpbot

A commit referencing this issue has landed:
https://hg.adblockplus.org/adblockplus/rev/a96e8e6c4028

comment:13 Changed 4 years ago by abpbot

A commit referencing this issue has landed:
https://hg.adblockplus.org/codingtools/rev/7a39b2713077

comment:15 Changed 4 years ago by abpbot

A commit referencing this issue has landed:
https://hg.adblockplus.org/web.eyeo.com/rev/aea60d949a19

comment:16 Changed 4 years ago by abpbot

A commit referencing this issue has landed:
https://hg.adblockplus.org/web.adblockplus.org/rev/89a0fbadef0f

comment:19 Changed 4 years ago by abpbot

A commit referencing this issue has landed:
https://hg.adblockplus.org/abpcrawler/rev/0dca4afa16f0

comment:20 Changed 4 years ago by abpbot

A commit referencing this issue has landed:
https://hg.adblockplus.org/adblockplussafariios/rev/34f441dbfe1a

comment:21 Changed 4 years ago by abpbot

A commit referencing this issue has landed:
https://hg.adblockplus.org/libadblockplus/rev/1391ac4281c8

comment:22 Changed 4 years ago by abpbot

A commit referencing this issue has landed:
https://hg.adblockplus.org/adblockplusie/rev/09e80844bb0a

comment:23 Changed 4 years ago by abpbot

A commit referencing this issue has landed:
https://hg.adblockplus.org/adblockbrowser-build/rev/b9666e20ad20

comment:24 Changed 4 years ago by abpbot

A commit referencing this issue has landed:
https://hg.adblockplus.org/adblockbrowser/rev/084f575243cf

comment:25 Changed 4 years ago by abpbot

A commit referencing this issue has landed:
https://hg.adblockplus.org/elemhidehelper/rev/beb74833e35d

comment:26 Changed 4 years ago by abpbot

A commit referencing this issue has landed:
https://hg.adblockplus.org/abpwatcher/rev/116dd4a5b259

comment:27 Changed 4 years ago by abpbot

A commit referencing this issue has landed:
https://hg.adblockplus.org/abpcustomization/rev/90f3b1b16cf0

comment:28 Changed 4 years ago by abpbot

A commit referencing this issue has landed:
https://hg.adblockplus.org/urlfixer/rev/90213fe3615c

comment:29 Changed 4 years ago by sebastian

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