Changeset 53383 in webkit


Ignore:
Timestamp:
Jan 17, 2010 6:39:12 PM (14 years ago)
Author:
eric@webkit.org
Message:

2010-01-17 Adam Barth <abarth@webkit.org>

Reviewed by Darin Adler.

style-check script reports loads of errors on gtk2drawing.c
https://bugs.webkit.org/show_bug.cgi?id=33771

Exempt WebCore/platform/gtk/gtk2drawing.c and
WebCore/platform/gtk/gtk2drawing.h from style checks.

  • Scripts/webkitpy/style/cpp_style.py:
  • Scripts/webkitpy/style/cpp_style_unittest.py:
Location:
trunk/WebKitTools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKitTools/ChangeLog

    r53382 r53383  
     12010-01-17  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by Darin Adler.
     4
     5        style-check script reports loads of errors on gtk2drawing.c
     6        https://bugs.webkit.org/show_bug.cgi?id=33771
     7
     8        Exempt WebCore/platform/gtk/gtk2drawing.c and
     9        WebCore/platform/gtk/gtk2drawing.h from style checks.
     10
     11        * Scripts/webkitpy/style/cpp_style.py:
     12        * Scripts/webkitpy/style/cpp_style_unittest.py:
     13
    1142010-01-17  Chris Jerdonek  <cjerdonek@webkit.org>
    215
  • trunk/WebKitTools/Scripts/webkitpy/style/cpp_style.py

    r53382 r53383  
    28982898    if (filename != '-' and not can_handle(filename)):
    28992899        sys.stderr.write('Ignoring %s; not a .cpp, .c or .h file\n' % filename)
     2900    elif is_exempt(filename):
     2901        sys.stderr.write('Ignoring %s; This file is exempt from the style guide.\n' % filename)
    29002902    else:
    29012903        process_file_data(filename, file_extension, lines, error, verbosity)
     
    29152917     """
    29162918    return os.path.splitext(filename)[1] in ('.h', '.cpp', '.c')
     2919
     2920
     2921def is_exempt(filename):
     2922    """Checks if the given file is exempt from the style guide.  For example,
     2923    some files are purposefully mantained in Mozilla style to ease future
     2924    merges.
     2925
     2926    Args:
     2927      filename: A filename. It may contain directory names.
     2928     """
     2929    return os.path.basename(filename) in (
     2930        'gtk2drawing.c',
     2931        'gtk2drawing.h',
     2932    )
  • trunk/WebKitTools/Scripts/webkitpy/style/cpp_style_unittest.py

    r53382 r53383  
    36003600        self.assert_(not cpp_style.can_handle('-'))
    36013601
     3602    def test_is_exempt(self):
     3603        """Tests for cpp_style.is_exempt()."""
     3604        self.assert_(not cpp_style.is_exempt(''))
     3605        self.assert_(not cpp_style.is_exempt('foo.h'))
     3606        self.assert_(not cpp_style.is_exempt('foo.hpp'))
     3607        self.assert_(not cpp_style.is_exempt('foo.c'))
     3608        self.assert_(not cpp_style.is_exempt('foo.cpp'))
     3609        self.assert_(not cpp_style.is_exempt('-'))
     3610        self.assert_(cpp_style.is_exempt('gtk2drawing.h'))
     3611        self.assert_(cpp_style.is_exempt('WebCore/platform/gtk/gtk2drawing.h'))
     3612        self.assert_(cpp_style.is_exempt('gtk2drawing.c'))
     3613        self.assert_(cpp_style.is_exempt('WebCore/platform/gtk/gtk2drawing.c'))
    36023614
    36033615def tearDown():
Note: See TracChangeset for help on using the changeset viewer.