summaryrefslogtreecommitdiffstats
path: root/WebKitTools/Scripts/webkitpy/style
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2010-11-04 12:00:17 -0700
committerJohn Reck <jreck@google.com>2010-11-09 11:35:04 -0800
commite14391e94c850b8bd03680c23b38978db68687a8 (patch)
tree3fed87e6620fecaf3edc7259ae58a11662bedcb2 /WebKitTools/Scripts/webkitpy/style
parent1bd705833a68f07850cf7e204b26f8d328d16951 (diff)
downloadexternal_webkit-e14391e94c850b8bd03680c23b38978db68687a8.zip
external_webkit-e14391e94c850b8bd03680c23b38978db68687a8.tar.gz
external_webkit-e14391e94c850b8bd03680c23b38978db68687a8.tar.bz2
Merge Webkit at r70949: Initial merge by git.
Change-Id: I77b8645c083b5d0da8dba73ed01d4014aab9848e
Diffstat (limited to 'WebKitTools/Scripts/webkitpy/style')
-rw-r--r--WebKitTools/Scripts/webkitpy/style/checker.py22
-rwxr-xr-xWebKitTools/Scripts/webkitpy/style/checker_unittest.py5
-rw-r--r--WebKitTools/Scripts/webkitpy/style/checkers/cpp.py2
-rw-r--r--WebKitTools/Scripts/webkitpy/style/checkers/cpp_unittest.py13
-rw-r--r--WebKitTools/Scripts/webkitpy/style/checkers/test_expectations_unittest.py6
5 files changed, 35 insertions, 13 deletions
diff --git a/WebKitTools/Scripts/webkitpy/style/checker.py b/WebKitTools/Scripts/webkitpy/style/checker.py
index e0c956f..11e3e33 100644
--- a/WebKitTools/Scripts/webkitpy/style/checker.py
+++ b/WebKitTools/Scripts/webkitpy/style/checker.py
@@ -116,9 +116,9 @@ _PATH_RULES_SPECIFIER = [
# API and therefore do not follow the same header including
# discipline as WebCore.
(["WebKitTools/WebKitAPITest/",
- "WebKit/qt/QGVLauncher/"],
+ "WebKitTools/TestWebKitAPI/"],
["-build/include",
- "-readability/streams"]),
+ "-readability/naming"]),
([# The EFL APIs use EFL naming style, which includes
# both lower-cased and camel-cased, underscore-sparated
# values.
@@ -148,6 +148,24 @@ _PATH_RULES_SPECIFIER = [
"/JavaScriptCore/assembler/"],
["-readability/naming"]),
+ # WebKit2 rules:
+ # WebKit2 doesn't use config.h, and certain directories have other
+ # idiosyncracies.
+ ([# NPAPI has function names with underscores.
+ "WebKit2/WebProcess/Plugins/Netscape"],
+ ["-build/include_order",
+ "-readability/naming"]),
+ ([# The WebKit2 C API has names with underscores and whitespace-aligned
+ # struct members.
+ "WebKit2/UIProcess/API/C/",
+ "WebKit2/WebProcess/InjectedBundle/API/c/"],
+ ["-build/include_order",
+ "-readability/naming",
+ "-whitespace/declaration"]),
+ ([# Nothing in WebKit2 uses config.h.
+ "WebKit2/"],
+ ["-build/include_order"]),
+
# For third-party Python code, keep only the following checks--
#
# No tabs: to avoid having to set the SVN allow-tabs property.
diff --git a/WebKitTools/Scripts/webkitpy/style/checker_unittest.py b/WebKitTools/Scripts/webkitpy/style/checker_unittest.py
index 5254275..43d24fe 100755
--- a/WebKitTools/Scripts/webkitpy/style/checker_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/style/checker_unittest.py
@@ -213,11 +213,6 @@ class GlobalVariablesTest(unittest.TestCase):
"build/include")
assertNoCheck("WebKitTools/WebKitAPITest/main.cpp",
"build/include")
- assertNoCheck("WebKit/qt/QGVLauncher/main.cpp",
- "build/include")
- assertNoCheck("WebKit/qt/QGVLauncher/main.cpp",
- "readability/streams")
-
assertCheck("random_path.cpp",
"readability/naming")
assertNoCheck("WebKit/gtk/webkit/webkit.h",
diff --git a/WebKitTools/Scripts/webkitpy/style/checkers/cpp.py b/WebKitTools/Scripts/webkitpy/style/checkers/cpp.py
index 7c1cb3e..cd9e6ae 100644
--- a/WebKitTools/Scripts/webkitpy/style/checkers/cpp.py
+++ b/WebKitTools/Scripts/webkitpy/style/checkers/cpp.py
@@ -1293,7 +1293,7 @@ def check_spacing(file_extension, clean_lines, line_number, error):
line = clean_lines.elided[line_number] # get rid of comments and strings
# Don't try to do spacing checks for operator methods
- line = sub(r'operator(==|!=|<|<<|<=|>=|>>|>)\(', 'operator\(', line)
+ line = sub(r'operator(==|!=|<|<<|<=|>=|>>|>|\+=|-=|\*=|/=|%=|&=|\|=|^=|<<=|>>=)\(', 'operator\(', line)
# Don't try to do spacing checks for #include or #import statements at
# minimum because it messes up checks for spacing around /
if match(r'\s*#\s*(?:include|import)', line):
diff --git a/WebKitTools/Scripts/webkitpy/style/checkers/cpp_unittest.py b/WebKitTools/Scripts/webkitpy/style/checkers/cpp_unittest.py
index 071ce50..6d5c24b 100644
--- a/WebKitTools/Scripts/webkitpy/style/checkers/cpp_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/style/checkers/cpp_unittest.py
@@ -1313,6 +1313,19 @@ class CppStyleTest(CppStyleTestBase):
self.assert_multi_line_lint('#include "config.h"\n#import <foo/bar.h>\n',
'')
+ def test_operator_methods(self):
+ self.assert_lint('String operator+(const String&, const String&);', '')
+ self.assert_lint('bool operator==(const String&, const String&);', '')
+ self.assert_lint('String& operator-=(const String&, const String&);', '')
+ self.assert_lint('String& operator+=(const String&, const String&);', '')
+ self.assert_lint('String& operator*=(const String&, const String&);', '')
+ self.assert_lint('String& operator%=(const String&, const String&);', '')
+ self.assert_lint('String& operator&=(const String&, const String&);', '')
+ self.assert_lint('String& operator<<=(const String&, const String&);', '')
+ self.assert_lint('String& operator>>=(const String&, const String&);', '')
+ self.assert_lint('String& operator|=(const String&, const String&);', '')
+ self.assert_lint('String& operator^=(const String&, const String&);', '')
+
def test_spacing_before_last_semicolon(self):
self.assert_lint('call_function() ;',
'Extra space before last semicolon. If this should be an '
diff --git a/WebKitTools/Scripts/webkitpy/style/checkers/test_expectations_unittest.py b/WebKitTools/Scripts/webkitpy/style/checkers/test_expectations_unittest.py
index 747b8b4..31f0b40 100644
--- a/WebKitTools/Scripts/webkitpy/style/checkers/test_expectations_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/style/checkers/test_expectations_unittest.py
@@ -111,7 +111,7 @@ class TestExpectationsTestCase(unittest.TestCase):
["BUG1234 DEBUG MAC : passes/text.html = TIMEOUT PASS"],
"")
self.assert_lines_lint(
- ["SLOW DEFER BUG1234 : passes/text.html = PASS"],
+ ["SLOW BUG1234 : passes/text.html = PASS"],
"")
self.assert_lines_lint(
["WONTFIX SKIP : passes/text.html = TIMEOUT"],
@@ -126,10 +126,6 @@ class TestExpectationsTestCase(unittest.TestCase):
["SKIP : passes/text.html = PASS"],
"Test lacks BUG modifier. "
"passes/text.html [test/expectations] [2]")
- self.assert_lines_lint(
- ["WONTFIX DEFER : passes/text.html = PASS"],
- "Test cannot be both DEFER and WONTFIX. "
- "passes/text.html [test/expectations] [5]")
def test_expectation_errors(self):
self.assert_lines_lint(