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):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161510 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 4bd83075
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.
......
......@@ -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',
......
......@@ -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):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment