Title: [243411] trunk/Tools
Revision
243411
Author
[email protected]
Date
2019-03-23 04:25:58 -0700 (Sat, 23 Mar 2019)

Log Message

[GTK][WPE] check-webkit-style doesn't complain about identifiers with underscores in files under glib, gtk or wpe dirs
https://bugs.webkit.org/show_bug.cgi?id=196143

Patch by Carlos Garcia Campos <[email protected]> on 2019-03-23
Reviewed by Michael Catanzaro.

Fix the check for the exception of identifiers starting with webkit_ in files under glib, gtk or wpe
directories.

* Scripts/webkitpy/style/checkers/cpp.py:
(check_identifier_name_in_declaration):
* Scripts/webkitpy/style/checkers/cpp_unittest.py:
(WebKitStyleTest.test_names):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (243410 => 243411)


--- trunk/Tools/ChangeLog	2019-03-23 10:56:59 UTC (rev 243410)
+++ trunk/Tools/ChangeLog	2019-03-23 11:25:58 UTC (rev 243411)
@@ -1,3 +1,18 @@
+2019-03-23  Carlos Garcia Campos  <[email protected]>
+
+        [GTK][WPE] check-webkit-style doesn't complain about identifiers with underscores in files under glib, gtk or wpe dirs
+        https://bugs.webkit.org/show_bug.cgi?id=196143
+
+        Reviewed by Michael Catanzaro.
+
+        Fix the check for the exception of identifiers starting with webkit_ in files under glib, gtk or wpe
+        directories.
+
+        * Scripts/webkitpy/style/checkers/cpp.py:
+        (check_identifier_name_in_declaration):
+        * Scripts/webkitpy/style/checkers/cpp_unittest.py:
+        (WebKitStyleTest.test_names):
+
 2019-03-22  Philippe Normand  <[email protected]>
 
         [Flatpak] Manifest expanding fails for qt WPE extension

Modified: trunk/Tools/Scripts/webkitpy/style/checkers/cpp.py (243410 => 243411)


--- trunk/Tools/Scripts/webkitpy/style/checkers/cpp.py	2019-03-23 10:56:59 UTC (rev 243410)
+++ trunk/Tools/Scripts/webkitpy/style/checkers/cpp.py	2019-03-23 11:25:58 UTC (rev 243411)
@@ -3585,7 +3585,7 @@
         if not file_state.is_objective_c_or_objective_cpp() and modified_identifier.find('_') >= 0:
             # Various exceptions to the rule: _javascript_ op codes functions, const_iterator.
             if (not (filename.find('_javascript_Core') >= 0 and (modified_identifier.find('op_') >= 0 or modified_identifier.find('intrinsic_') >= 0))
-                and not (('gtk' in filename or 'glib' in filename or 'wpe' in filename) and modified_identifier.startswith('webkit_') >= 0)
+                and not (('gtk' in filename or 'glib' in filename or 'wpe' in filename) and modified_identifier.startswith('webkit_'))
                 and not modified_identifier.startswith('tst_')
                 and not modified_identifier.startswith('webkit_dom_object_')
                 and not modified_identifier.startswith('webkit_soup')

Modified: trunk/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py (243410 => 243411)


--- trunk/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py	2019-03-23 10:56:59 UTC (rev 243410)
+++ trunk/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py	2019-03-23 11:25:58 UTC (rev 243411)
@@ -5372,6 +5372,10 @@
         # There is an exception for GTK+ API.
         self.assert_lint('void webkit_web_view_load(int var1, int var2)', '', 'Source/Webkit/gtk/webkit/foo.cpp')
         self.assert_lint('void webkit_web_view_load(int var1, int var2)', '', 'Source/Webkit2/UIProcess/gtk/foo.cpp')
+        self.assert_lint('void my_function(int variable_1)',
+                         ['my_function' + name_underscore_error_message,
+                          'variable_1' + name_underscore_error_message],
+                         'Source/Webkit2/UIProcess/gtk/foo.cpp')
 
         # Test that this doesn't also apply to files not in a 'gtk' directory.
         self.assert_lint('void webkit_web_view_load(int var1, int var2)',
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to