Changeset 161535 in webkit


Ignore:
Timestamp:
Jan 8, 2014 6:13:07 PM (10 years ago)
Author:
commit-queue@webkit.org
Message:

Missleading style error when mixing system and non-system header include lines.
https://bugs.webkit.org/show_bug.cgi?id=126564

Patch by Gergo Balogh <geryxyz@inf.u-szeged.hu> on 2014-01-08
Reviewed by Ryosuke Niwa.

  • Scripts/webkitpy/style/checkers/cpp.py:

(check_include_line):

  • Scripts/webkitpy/style/checkers/cpp_unittest.py:

(OrderOfIncludesTest.test_check_alphabetical_include_order):
(OrderOfIncludesTest.test_public_primary_header):

Location:
trunk/Tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r161524 r161535  
     12014-01-08  Gergo Balogh  <geryxyz@inf.u-szeged.hu>
     2
     3        Missleading style error when mixing system and non-system header include lines.
     4        https://bugs.webkit.org/show_bug.cgi?id=126564
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        * Scripts/webkitpy/style/checkers/cpp.py:
     9        (check_include_line):
     10        * Scripts/webkitpy/style/checkers/cpp_unittest.py:
     11        (OrderOfIncludesTest.test_check_alphabetical_include_order):
     12        (OrderOfIncludesTest.test_public_primary_header):
     13
    1142014-01-08  Seokju Kwon  <seokju@webkit.org>
    215
  • trunk/Tools/Scripts/webkitpy/style/checkers/cpp.py

    r161510 r161535  
    29172917         if previous_match:
    29182918            previous_header_type = include_state.header_types[previous_line_number]
    2919             if previous_header_type == _OTHER_HEADER and previous_line.strip() > line.strip():
    2920                 # This type of error is potentially a problem with this line or the previous one,
    2921                 # so if the error is filtered for one line, report it for the next. This is so that
    2922                 # we properly handle patches, for which only modified lines produce errors.
    2923                 if not error(line_number - 1, 'build/include_order', 4, 'Alphabetical sorting problem.'):
    2924                     error(line_number, 'build/include_order', 4, 'Alphabetical sorting problem.')
     2919            if previous_header_type == _OTHER_HEADER:
     2920                if '<' in previous_line and '"' in line:
     2921                    error(line_number, 'build/include_order', 4, 'Bad include order. Mixing system and custom headers.')
     2922                elif previous_line.strip() > line.strip():
     2923                    # This type of error is potentially a problem with this line or the previous one,
     2924                    # so if the error is filtered for one line, report it for the next. This is so that
     2925                    # we properly handle patches, for which only modified lines produce errors.
     2926                    if not error(line_number - 1, 'build/include_order', 4, 'Alphabetical sorting problem.'):
     2927                        error(line_number, 'build/include_order', 4, 'Alphabetical sorting problem.')
    29252928
    29262929    if error_message:
  • trunk/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py

    r161510 r161535  
    26242624                                         '#include <assert.h>\n'
    26252625                                         '#include "bar.h"\n',
    2626                                          'Alphabetical sorting problem.  [build/include_order] [4]')
     2626                                         'Bad include order. Mixing system and custom headers.  [build/include_order] [4]')
    26272627
    26282628        self.assert_language_rules_check('foo.h',
     
    27762776                                         '\n'
    27772777                                         '#include "a.h"\n',
    2778                                          'Alphabetical sorting problem.  [build/include_order] [4]')
     2778                                         'Bad include order. Mixing system and custom headers.  [build/include_order] [4]')
    27792779
    27802780        # ...except that it starts with public/.
     
    27922792                                         '\n'
    27932793                                         '#include "a.h"\n',
    2794                                          'Alphabetical sorting problem.  [build/include_order] [4]')
     2794                                         'Bad include order. Mixing system and custom headers.  [build/include_order] [4]')
    27952795
    27962796    def test_check_wtf_includes(self):
Note: See TracChangeset for help on using the changeset viewer.