The builtins generator does this, copying that approach.
Created attachment 333121 [details] Proposed Fix
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`)
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 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 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 on attachment 333121 [details] Proposed Fix Clearing flags on attachment: 333121 Committed r228196: <https://trac.webkit.org/changeset/228196>
All reviewed patches have been landed. Closing bug.
<rdar://problem/37290748>