Changeset 56763 in webkit


Ignore:
Timestamp:
Mar 29, 2010 11:08:34 PM (14 years ago)
Author:
eric@webkit.org
Message:

2010-03-29 Hayato Ito <hayato@chromium.org>

Reviewed by Shinichiro Hamaji.

Remove '_flymake' suffix from base part of file name so that
check-webkit-style uses a correct header guard name when it is called from Emacs's flymake.

https://bugs.webkit.org/show_bug.cgi?id=36573

  • 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

    r56762 r56763  
     12010-03-29  Hayato Ito  <hayato@chromium.org>
     2
     3        Reviewed by Shinichiro Hamaji.
     4
     5        Remove '_flymake' suffix from base part of file name so that
     6        check-webkit-style uses a correct header guard name when it is called from Emacs's flymake.
     7
     8        https://bugs.webkit.org/show_bug.cgi?id=36573
     9
     10        * Scripts/webkitpy/style/processors/cpp.py:
     11        * Scripts/webkitpy/style/processors/cpp_unittest.py:
     12
    1132010-03-29  Chris Jerdonek  <cjerdonek@webkit.org>
    214
  • trunk/WebKitTools/Scripts/webkitpy/style/processors/cpp.py

    r56692 r56763  
    642642
    643643    """
     644
     645    # Restores original filename in case that style checker is invoked from Emacs's
     646    # flymake.
     647    filename = re.sub(r'_flymake\.h$', '.h', filename)
    644648
    645649    return sub(r'[-.\s]', '_', os.path.basename(filename))
     
    27702774    # e.g. If the file name is 'foo_flymake.cpp', we should search for 'foo.h'
    27712775    # instead of 'foo_flymake.h'
    2772     emacs_flymake_suffix = '_flymake.cpp'
    2773     if abs_filename.endswith(emacs_flymake_suffix):
    2774         abs_filename = abs_filename[:-len(emacs_flymake_suffix)] + '.cpp'
     2776    abs_filename = re.sub(r'_flymake\.cpp$', '.cpp', abs_filename)
    27752777
    27762778    # include_state is modified during iteration, so we iterate over a copy of
  • trunk/WebKitTools/Scripts/webkitpy/style/processors/cpp_unittest.py

    r56692 r56763  
    17371737            error_collector.result_list())
    17381738
     1739        # Special case for flymake
     1740        error_collector = ErrorCollector(self.assert_)
     1741        self.process_file_data('mydir/Foo_flymake.h', 'h',
     1742                               ['#ifndef %s' % expected_guard,
     1743                                '#define %s' % expected_guard,
     1744                                '#endif // %s' % expected_guard],
     1745                               error_collector)
     1746        for line in error_collector.result_list():
     1747            if line.find('build/header_guard') != -1:
     1748                self.fail('Unexpected error: %s' % line)
     1749
     1750        error_collector = ErrorCollector(self.assert_)
     1751        self.process_file_data('mydir/Foo_flymake.h', 'h', [], error_collector)
     1752        self.assertEquals(
     1753            1,
     1754            error_collector.result_list().count(
     1755                'No #ifndef header guard found, suggested CPP variable is: %s'
     1756                '  [build/header_guard] [5]' % expected_guard),
     1757            error_collector.result_list())
     1758
    17391759    def test_build_printf_format(self):
    17401760        self.assert_lint(
Note: See TracChangeset for help on using the changeset viewer.