Bug 214531 - pep8.py:110: FutureWarning: Possible nested set at position 1
Summary: pep8.py:110: FutureWarning: Possible nested set at position 1
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: PC Linux
: P2 Normal
Assignee: Michael Catanzaro
URL:
Keywords: InRadar
: 209017 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-07-19 05:25 PDT by Michael Catanzaro
Modified: 2020-07-24 17:23 PDT (History)
6 users (show)

See Also:


Attachments
Patch (4.55 KB, patch)
2020-07-19 05:31 PDT, Michael Catanzaro
no flags Details | Formatted Diff | Diff
Patch (5.21 KB, patch)
2020-07-19 06:12 PDT, Michael Catanzaro
no flags Details | Formatted Diff | Diff
Patch for landing (1.22 KB, patch)
2020-07-24 16:51 PDT, Jonathan Bedard
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Catanzaro 2020-07-19 05:25:13 PDT
Let's try to fix this python warning that occurs when running webkit-patch:

$ webkit-patch upload
/home/mcatanzaro/Projects/WebKit/Tools/Scripts/webkitpy/thirdparty/autoinstalled/pep8.py:110: FutureWarning: Possible nested set at position 1
  EXTRANEOUS_WHITESPACE_REGEX = re.compile(r'[[({] | []}),;:]')

Since we don't control the code, we should update to a newer version of pep8. It has been renamed to pycodestyle.

I've tested this patch with python3. I think it should work with python2. Let's see if EWS likes it.
Comment 1 Michael Catanzaro 2020-07-19 05:30:52 PDT
BTW, maybe I'm doing something wrong, but this style checker seems unable to find obvious style errors in our python code even without any of my changes....
Comment 2 Michael Catanzaro 2020-07-19 05:31:23 PDT
Created attachment 404664 [details]
Patch
Comment 3 Michael Catanzaro 2020-07-19 06:10:18 PDT
Seems that works. Attaching an alternate patch to see if we can get away with removing pep8 and using pycodestyle also for python2.
Comment 4 Michael Catanzaro 2020-07-19 06:12:27 PDT
Created attachment 404665 [details]
Patch
Comment 5 Michael Catanzaro 2020-07-19 06:54:43 PDT
*** Bug 209017 has been marked as a duplicate of this bug. ***
Comment 6 Michael Catanzaro 2020-07-19 07:03:06 PDT
(In reply to Michael Catanzaro from comment #1)
> BTW, maybe I'm doing something wrong, but this style checker seems unable to
> find obvious style errors in our python code even without any of my
> changes....

Apparently I was looking for style rules that we suppress. It actually still works fine if I violate the right rules:

$ check-webkit-style 
ERROR: Source/WebKit/Scripts/generate-message-receiver.py:41:  missing whitespace around operator  [pep8/E225] [5]
ERROR: Source/WebKit/Scripts/generate-message-receiver.py:42:  missing whitespace around operator  [pep8/E225] [5]
ERROR: Source/WebKit/Scripts/generate-message-receiver.py:45:  missing whitespace after ','  [pep8/E231] [5]
Total errors found: 3 in 3 files

Seems good.
Comment 7 EWS 2020-07-19 11:45:12 PDT
Committed r264579: <https://trac.webkit.org/changeset/264579>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 404665 [details].
Comment 8 Radar WebKit Bug Importer 2020-07-19 11:46:14 PDT
<rdar://problem/65793948>
Comment 9 Jonathan Bedard 2020-07-24 16:51:00 PDT
Reopening to attach new patch.
Comment 10 Jonathan Bedard 2020-07-24 16:51:02 PDT
Created attachment 405204 [details]
Patch for landing
Comment 11 Jonathan Bedard 2020-07-24 16:51:49 PDT
(In reply to Jonathan Bedard from comment #10)
> Created attachment 405204 [details]
> Patch for landing

Pep8 was removed from the auto importer, we should remove it from the test as well.
Comment 12 EWS 2020-07-24 17:12:43 PDT
Committed r264872: <https://trac.webkit.org/changeset/264872>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 405204 [details].
Comment 13 Michael Catanzaro 2020-07-24 17:22:35 PDT
Comment on attachment 405204 [details]
Patch for landing

Good catch!