Bug 214536 - cpp.py:3688: FutureWarning: Possible nested set at position 101
Summary: cpp.py:3688: FutureWarning: Possible nested set at position 101
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
Depends on:
Blocks:
 
Reported: 2020-07-19 08:06 PDT by Michael Catanzaro
Modified: 2020-07-19 12:07 PDT (History)
6 users (show)

See Also:


Attachments
Patch (1.83 KB, patch)
2020-07-19 08:08 PDT, Michael Catanzaro
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 08:06:27 PDT
$ check-webkit-style 
/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'[[({] | []}),;:]')
/home/mcatanzaro/Projects/WebKit/Tools/Scripts/webkitpy/style/checkers/cpp.py:3688: FutureWarning: Possible nested set at position 101
  check_identifier_name_in_declaration(filename, line_number, line, file_state, error)
/home/mcatanzaro/Projects/WebKit/Tools/Scripts/webkitpy/style/checkers/cpp.py:3688: FutureWarning: Possible nested set at position 73
  check_identifier_name_in_declaration(filename, line_number, line, file_state, error)
Total errors found: 0 in 5 files

First warning is bug #214531. Let's fix the others here. Seems the warning was added in https://bugs.python.org/issue30349 and all we need to do is escape [ when used inside a set. That is, we have to change "[[" to "[\[". That was a little hard to figure out because the warning message points to the wrong line... the issue is on line 3780, not line 3688.
Comment 1 Michael Catanzaro 2020-07-19 08:08:04 PDT
Created attachment 404670 [details]
Patch
Comment 2 Michael Catanzaro 2020-07-19 08:09:32 PDT
(BTW, the warning means this code will break in a future version of python if we do not add the escape. The escape will maintain current behavior going forward.)
Comment 3 EWS 2020-07-19 12:06:27 PDT
Committed r264581: <https://trac.webkit.org/changeset/264581>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 404670 [details].
Comment 4 Radar WebKit Bug Importer 2020-07-19 12:07:15 PDT
<rdar://problem/65794323>