Changeset 54918 in webkit


Ignore:
Timestamp:
Feb 17, 2010 6:13:03 PM (14 years ago)
Author:
hamaji@chromium.org
Message:

2010-02-17 Shinichiro Hamaji <hamaji@chromium.org>

Reviewed by Eric Seidel.

check-webkit-style: Misses variables that contain underscores.
https://bugs.webkit.org/show_bug.cgi?id=33724

  • Check identifiers whose types are unsigned.
  • Check bitfields properly.
  • Scripts/webkitpy/style/processors/cpp.py:
  • Scripts/webkitpy/style/processors/cpp_unittest.py:
Location:
trunk/WebKitTools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKitTools/ChangeLog

    r54917 r54918  
     12010-02-17  Shinichiro Hamaji  <hamaji@chromium.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        check-webkit-style: Misses variables that contain underscores.
     6        https://bugs.webkit.org/show_bug.cgi?id=33724
     7
     8        - Check identifiers whose types are unsigned.
     9        - Check bitfields properly.
     10
     11        * Scripts/webkitpy/style/processors/cpp.py:
     12        * Scripts/webkitpy/style/processors/cpp_unittest.py:
     13
    1142010-02-17  Shinichiro Hamaji  <hamaji@chromium.org>
    215
  • trunk/WebKitTools/Scripts/webkitpy/style/processors/cpp.py

    r54808 r54918  
    24262426    # simple types, but don't remove simple "long".
    24272427    line = sub(r'long (long )?(?=long|double|int)', '', line)
    2428     line = sub(r'\b(unsigned|signed|inline|using|static|const|volatile|auto|register|extern|typedef|restrict|struct|class|virtual)(?=\W)', '', line)
     2428    # Convert unsigned/signed types to simple types, too.
     2429    line = sub(r'(unsigned|signed) (?=char|short|int|long)', '', line)
     2430    line = sub(r'\b(inline|using|static|const|volatile|auto|register|extern|typedef|restrict|struct|class|virtual)(?=\W)', '', line)
    24292431
    24302432    # Remove all template parameters by removing matching < and >.
     
    24542456    type_regexp = r'\w([\w]|\s*[*&]\s*|::)+'
    24552457    identifier_regexp = r'(?P<identifier>[\w:]+)'
     2458    maybe_bitfield_regexp = r'(:\s*\d+\s*)?'
    24562459    character_after_identifier_regexp = r'(?P<character_after_identifier>[[;()=,])(?!=)'
    2457     declaration_without_type_regexp = r'\s*' + identifier_regexp + r'\s*' + character_after_identifier_regexp
     2460    declaration_without_type_regexp = r'\s*' + identifier_regexp + r'\s*' + maybe_bitfield_regexp + character_after_identifier_regexp
    24582461    declaration_with_type_regexp = r'\s*' + type_regexp + r'\s' + declaration_without_type_regexp
    24592462    is_function_arguments = False
     
    29872990    processor = CppProcessor(filename, file_extension, error, verbosity)
    29882991    processor.process(lines)
    2989 
  • trunk/WebKitTools/Scripts/webkitpy/style/processors/cpp_unittest.py

    r54808 r54918  
    35173517        self.assert_lint('short length_;',
    35183518                         'length_' + name_error_message)
     3519        self.assert_lint('unsigned _length;',
     3520                         '_length' + name_error_message)
     3521        self.assert_lint('unsigned int _length;',
     3522                         '_length' + name_error_message)
     3523        self.assert_lint('unsigned long long _length;',
     3524                         '_length' + name_error_message)
    35193525
    35203526        # Pointers, references, functions, templates, and adjectives.
     
    36133619        self.assert_lint('typedef VectorType::const_iterator const_iterator;', '')
    36143620
     3621        # Bitfields.
     3622        self.assert_lint('unsigned _fillRule : 1;',
     3623                         '_fillRule' + name_error_message)
     3624
    36153625
    36163626    def test_comments(self):
Note: See TracChangeset for help on using the changeset viewer.