Unreviewed, rolling out r161427.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Jan 2014 17:48:04 +0000 (17:48 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Jan 2014 17:48:04 +0000 (17:48 +0000)
http://trac.webkit.org/changeset/161427
https://bugs.webkit.org/show_bug.cgi?id=126645

Emits a stye error on any newly added files (Requested by ap
on #webkit).

* Scripts/webkitpy/style/checkers/cpp.py:
(check_style):
(CppChecker):
* Scripts/webkitpy/style/checkers/cpp_unittest.py:
(WebKitStyleTest.test_other):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@161510 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/Scripts/webkitpy/style/checkers/cpp.py
Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py

index 3bd4612..74d3175 100644 (file)
@@ -1,3 +1,18 @@
+2014-01-08  Commit Queue  <commit-queue@webkit.org>
+
+        Unreviewed, rolling out r161427.
+        http://trac.webkit.org/changeset/161427
+        https://bugs.webkit.org/show_bug.cgi?id=126645
+
+        Emits a stye error on any newly added files (Requested by ap
+        on #webkit).
+
+        * Scripts/webkitpy/style/checkers/cpp.py:
+        (check_style):
+        (CppChecker):
+        * Scripts/webkitpy/style/checkers/cpp_unittest.py:
+        (WebKitStyleTest.test_other):
+
 2014-01-08  Peter Molnar  <pmolnar.u-szeged@partner.samsung.com>
 
         Remove run-webkit-tests wrapper script as all platform are using NRWT now.
index 7233b64..3974be2 100644 (file)
@@ -2719,14 +2719,6 @@ def check_style(clean_lines, line_number, file_extension, class_state, file_stat
     check_indentation_amount(clean_lines, line_number, error)
     check_enum_casing(clean_lines, line_number, enum_state, error)
 
-    # #defined constants should use all uppercase names with words separated by underscores.
-    define_check = match(r'#define\s(?P<name>[\w_]+)(\s.*|\s?)$', line)
-    if define_check:
-        name = define_check.group('name')
-        if not match(r'^[0-9A-Z_]+$', name):
-            error(line_number, 'readability/naming/define/constants', 4,
-                name + " is incorrect. #defined constants should use all uppercase names with words separated by underscores.")
-
 
 _RE_PATTERN_INCLUDE_NEW_STYLE = re.compile(r'#include +"[^/]+\.h"')
 _RE_PATTERN_INCLUDE = re.compile(r'^\s*#\s*include\s*([<"])([^>"]*)[>"].*$')
@@ -3708,7 +3700,6 @@ class CppChecker(object):
         'readability/parameter_name',
         'readability/naming',
         'readability/naming/underscores',
-        'readability/naming/define/constants',
         'readability/null',
         'readability/pass_ptr',
         'readability/streams',
index 2bb97bf..b479365 100644 (file)
@@ -5026,19 +5026,6 @@ class WebKitStyleTest(CppStyleTestBase):
         # FIXME: Implement this.
         pass
 
-    def test_define_constants(self):
-        bad_name_error = " is incorrect. #defined constants should use all uppercase names with words separated by underscores.  [readability/naming/define/constants] [4]"
-
-        self.assert_lint('#define lower1case', 'lower1case' + bad_name_error)
-        self.assert_lint('#define UPPER1CASE', '')
-        self.assert_lint('#define mixed1CASE', 'mixed1CASE' + bad_name_error)
-        self.assert_lint('#define lower_1case', 'lower_1case' + bad_name_error)
-        self.assert_lint('#define UPPER_1CASE', '')
-        self.assert_lint('#define mixed_1CASE', 'mixed_1CASE' + bad_name_error)
-        self.assert_lint('#define dlower1case some(bla)', 'dlower1case' + bad_name_error)
-        self.assert_lint('#define DUPPER1CASE dd(foo)', '')
-        self.assert_lint('#define Dmixed1CASE dkjgh[sdf]', 'Dmixed1CASE' + bad_name_error)
-
 
 class CppCheckerTest(unittest.TestCase):