RESOLVED FIXED 179387
Update code style guidelines for Python
https://bugs.webkit.org/show_bug.cgi?id=179387
Summary Update code style guidelines for Python
Aakash Jain
Reported 2017-11-07 12:20:17 PST
For Python code inside WebKit, we use PEP8 style. Recently, we had a discussion about it on webkit-dev and we decided to stick to PEP8. We should update the code style guidelines to reflect the same.
Attachments
Proposed patch (1.06 KB, patch)
2017-11-07 12:24 PST, Aakash Jain
ap: review+
Archive of layout-test-results from ews106 for mac-elcapitan-wk2 (2.64 MB, application/zip)
2017-11-07 14:15 PST, Build Bot
no flags
Aakash Jain
Comment 1 2017-11-07 12:24:20 PST
Created attachment 326238 [details] Proposed patch
Alexey Proskuryakov
Comment 2 2017-11-07 14:12:41 PST
Comment on attachment 326238 [details] Proposed patch Is it worth mentioning that we don't respect the line length limit?
Build Bot
Comment 3 2017-11-07 14:15:43 PST
Comment on attachment 326238 [details] Proposed patch Attachment 326238 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.webkit.org/results/5138434 New failing tests: imported/w3c/web-platform-tests/service-workers/service-worker/register-wait-forever-in-install-worker.https.html
Build Bot
Comment 4 2017-11-07 14:15:45 PST
Created attachment 326259 [details] Archive of layout-test-results from ews106 for mac-elcapitan-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews106 Port: mac-elcapitan-wk2 Platform: Mac OS X 10.11.6
Aakash Jain
Comment 5 2017-11-07 14:22:19 PST
> Is it worth mentioning that we don't respect the line length limit? I don't think we should mention it as a guideline. We don't want to encourage people to dis-respect line length. It's ok if they don't follow it, style checking script wouldn't complaint.
Alexey Proskuryakov
Comment 6 2018-01-24 14:41:30 PST
Comment on attachment 326238 [details] Proposed patch rs=me based on webkit-dev discussion
Aakash Jain
Comment 7 2018-01-24 14:48:55 PST
Radar WebKit Bug Importer
Comment 8 2018-01-24 14:49:19 PST
Daniel Bates
Comment 9 2018-04-03 20:23:56 PDT
(In reply to Aakash Jain from comment #5) > > Is it worth mentioning that we don't respect the line length limit? > > I don't think we should mention it as a guideline. We don't want to > encourage people to dis-respect line length. I do not recall that we (the WebKit OpenSource Project) ever agreed to PEP-8's maximum line length rule. I certainly do not agree to it. It is archaic and hurts readability. These sentiments are echoed in the thread that includes <https://lists.webkit.org/pipermail/webkit-dev/2010-April/012486.html>.
Daniel Bates
Comment 10 2018-04-03 20:24:41 PDT
(In reply to Daniel Bates from comment #9) > (In reply to Aakash Jain from comment #5) > > > Is it worth mentioning that we don't respect the line length limit? > > > > I don't think we should mention it as a guideline. We don't want to > > encourage people to dis-respect line length. > > I do not recall that we (the WebKit OpenSource Project) ever agreed to > PEP-8's maximum line length rule. I certainly do not agree to it. It is > archaic and hurts readability. These sentiments are echoed in the thread > that includes > <https://lists.webkit.org/pipermail/webkit-dev/2010-April/012486.html>. I forgot to mention that following PEP8's maximum line length rule came up in bug 184039, comment 14.
Aakash Jain
Comment 11 2018-04-03 20:41:34 PDT
> I do not recall that we (the WebKit OpenSource Project) ever agreed to > PEP-8's maximum line length rule. I certainly do not agree to it. It is > archaic and hurts readability. These sentiments are echoed in the thread > that includes > <https://lists.webkit.org/pipermail/webkit-dev/2010-April/012486.html>. You are right, we do not follow PEP8 maximum line length rule. Our style checking script explicitly ignore this check. https://trac.webkit.org/browser/webkit/trunk/Tools/Scripts/webkitpy/style/checker.py#L118 I felt it was ok to not document it in our Style guideline as following this rule doesn't hurt. However, if this missing documentation is creating any real problems, I would be ok if you want to document this.
Ryosuke Niwa
Comment 12 2018-04-04 16:00:19 PDT
Yeah, we certainly shouldn't adopt maximum line length.
Note You need to log in before you can comment on or make changes to this bug.