Bug 182505 - Web Inspector: protocol generator should automatically deduce the correct include style to use
Summary: Web Inspector: protocol generator should automatically deduce the correct inc...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Brian Burg
URL:
Keywords: InRadar
Depends on:
Blocks: 182347
  Show dependency treegraph
 
Reported: 2018-02-05 13:01 PST by Brian Burg
Modified: 2018-02-06 15:11 PST (History)
12 users (show)

See Also:


Attachments
Proposed Fix (56.80 KB, patch)
2018-02-05 14:01 PST, Brian Burg
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brian Burg 2018-02-05 13:01:37 PST
The builtins generator does this, copying that approach.
Comment 1 Brian Burg 2018-02-05 14:01:43 PST
Created attachment 333121 [details]
Proposed Fix
Comment 2 Build Bot 2018-02-05 14:03:14 PST
This patch modifies the inspector protocol generator. Please ensure that you have rebaselined any generator test results (i.e., by running `Tools/Scripts/run-inspector-generator-tests --reset-results`)
Comment 3 Build Bot 2018-02-05 14:03:28 PST
Attachment 333121 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_frontend_dispatcher_header.py:70:  whitespace before ']'  [pep8/E202] [5]
ERROR: Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_frontend_dispatcher_header.py:68:  [CppFrontendDispatcherHeaderGenerator._generate_secondary_header_includes] Instance of 'CppFrontendDispatcherHeaderGenerator' has no 'model' member  [pylint/E1101] [5]
ERROR: Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_frontend_dispatcher_header.py:68:  [CppFrontendDispatcherHeaderGenerator._generate_secondary_header_includes] Instance of 'CppFrontendDispatcherHeaderGenerator' has no 'protocol_name' member  [pylint/E1101] [5]
ERROR: Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_frontend_dispatcher_header.py:73:  [CppFrontendDispatcherHeaderGenerator._generate_secondary_header_includes] Instance of 'CppFrontendDispatcherHeaderGenerator' has no 'generate_includes_from_entries' member  [pylint/E1101] [5]
ERROR: Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_alternate_backend_dispatcher_header.py:48:  whitespace before '}'  [pep8/E202] [5]
ERROR: Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_alternate_backend_dispatcher_header.py:62:  [CppAlternateBackendDispatcherHeaderGenerator._generate_secondary_header_includes] Instance of 'CppAlternateBackendDispatcherHeaderGenerator' has no 'model' member  [pylint/E1101] [5]
ERROR: Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_alternate_backend_dispatcher_header.py:64:  [CppAlternateBackendDispatcherHeaderGenerator._generate_secondary_header_includes] Instance of 'CppAlternateBackendDispatcherHeaderGenerator' has no 'protocol_name' member  [pylint/E1101] [5]
ERROR: Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_alternate_backend_dispatcher_header.py:69:  [CppAlternateBackendDispatcherHeaderGenerator._generate_secondary_header_includes] Instance of 'CppAlternateBackendDispatcherHeaderGenerator' has no 'generate_includes_from_entries' member  [pylint/E1101] [5]
ERROR: Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_backend_dispatcher_header.py:76:  whitespace before ']'  [pep8/E202] [5]
ERROR: Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_backend_dispatcher_header.py:74:  [CppBackendDispatcherHeaderGenerator._generate_secondary_header_includes] Instance of 'CppBackendDispatcherHeaderGenerator' has no 'model' member  [pylint/E1101] [5]
ERROR: Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_backend_dispatcher_header.py:74:  [CppBackendDispatcherHeaderGenerator._generate_secondary_header_includes] Instance of 'CppBackendDispatcherHeaderGenerator' has no 'protocol_name' member  [pylint/E1101] [5]
ERROR: Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_backend_dispatcher_header.py:79:  [CppBackendDispatcherHeaderGenerator._generate_secondary_header_includes] Instance of 'CppBackendDispatcherHeaderGenerator' has no 'generate_includes_from_entries' member  [pylint/E1101] [5]
ERROR: Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_protocol_types_header.py:80:  whitespace before ']'  [pep8/E202] [5]
ERROR: Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_protocol_types_header.py:83:  [CppProtocolTypesHeaderGenerator._generate_secondary_header_includes] Instance of 'CppProtocolTypesHeaderGenerator' has no 'generate_includes_from_entries' member  [pylint/E1101] [5]
ERROR: Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_protocol_types_implementation.py:83:  [CppProtocolTypesImplementationGenerator._generate_secondary_header_includes] Instance of 'CppProtocolTypesImplementationGenerator' has no 'generate_includes_from_entries' member  [pylint/E1101] [5]
ERROR: Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_frontend_dispatcher_implementation.py:68:  whitespace before ']'  [pep8/E202] [5]
ERROR: Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_frontend_dispatcher_implementation.py:71:  [CppFrontendDispatcherImplementationGenerator._generate_secondary_header_includes] Instance of 'CppFrontendDispatcherImplementationGenerator' has no 'generate_includes_from_entries' member  [pylint/E1101] [5]
ERROR: Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_backend_dispatcher_implementation.py:79:  whitespace before ']'  [pep8/E202] [5]
ERROR: Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_backend_dispatcher_implementation.py:82:  [CppBackendDispatcherImplementationGenerator._generate_secondary_header_includes] Instance of 'CppBackendDispatcherImplementationGenerator' has no 'generate_includes_from_entries' member  [pylint/E1101] [5]
Total errors found: 19 in 30 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 4 Timothy Hatcher 2018-02-05 17:16:26 PST
Comment on attachment 333121 [details]
Proposed Fix

View in context: https://bugs.webkit.org/attachment.cgi?id=333121&action=review

> Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_backend_dispatcher_implementation.py:82
> +        return self.generate_includes_from_entries(header_includes)

Should this be: return '\n'.join(self.generate_includes_from_entries(header_includes))?

If everyone does the join, maybe build that into the base function to reduce the client duplication?
Comment 5 Brian Burg 2018-02-06 14:46:29 PST
Comment on attachment 333121 [details]
Proposed Fix

View in context: https://bugs.webkit.org/attachment.cgi?id=333121&action=review

>> Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_backend_dispatcher_implementation.py:82
>> +        return self.generate_includes_from_entries(header_includes)
> 
> Should this be: return '\n'.join(self.generate_includes_from_entries(header_includes))?
> 
> If everyone does the join, maybe build that into the base function to reduce the client duplication?

This is the one counterexample where we need to add the guarded alternate dispatcher includes in the same part of the template, so they aren't joined until all the lines have been added.
Comment 6 WebKit Commit Bot 2018-02-06 15:10:58 PST
Comment on attachment 333121 [details]
Proposed Fix

Clearing flags on attachment: 333121

Committed r228196: <https://trac.webkit.org/changeset/228196>
Comment 7 WebKit Commit Bot 2018-02-06 15:10:59 PST
All reviewed patches have been landed.  Closing bug.
Comment 8 Radar WebKit Bug Importer 2018-02-06 15:11:27 PST
<rdar://problem/37290748>