示例#1
0
    def check_entry(self, first_line_checked, entry_lines):
        if not entry_lines:
            return
        for line in entry_lines:
            if parse_bug_id_from_changelog(line):
                break
            if searchIgnorecase("Unreviewed", line):
                break
            if searchIgnorecase("build", line) and searchIgnorecase("fix", line):
                break
        else:
            self.handle_style_error(first_line_checked,
                                    "changelog/bugnumber", 5,
                                    "ChangeLog entry has no bug number")
        # check file change descriptions for style violations
        line_no = first_line_checked - 1
        for line in entry_lines:
            line_no = line_no + 1
            # filter file change descriptions
            if not match('\s*\*\s', line):
                continue
            if search(':\s*$', line) or search(':\s', line):
                continue
            self.handle_style_error(line_no,
                                    "changelog/filechangedescriptionwhitespace", 5,
                                    "Need whitespace between colon and description")

        # check for a lingering "No new tests. (OOPS!)" left over from prepare-changeLog.
        line_no = first_line_checked - 1
        for line in entry_lines:
            line_no = line_no + 1
            if match('\s*No new tests. \(OOPS!\)$', line):
                self.handle_style_error(line_no,
                                        "changelog/nonewtests", 5,
                                        "You should remove the 'No new tests' and either add and list tests, or explain why no new tests were possible.")
示例#2
0
 def _check_non_lowercase_cmd(self, line_number, line_content, cmd):
     if searchIgnorecase('(^|\ +)' + cmd + '\ *\(', line_content) and \
        (not search('(^|\ +)' + cmd.lower() + '\ *\(', line_content)):
         msg = 'Use lowercase command "' + cmd.lower() + '"'
         self._handle_style_error(line_number, 'command/lowercase', 5, msg)
示例#3
0
 def contains_phrase_in_first_line_or_across_two_lines(
         self, phrase, line1, line2):
     return searchIgnorecase(phrase, line1) or (
         (not searchIgnorecase(phrase, line2))
         and searchIgnorecase(phrase, line1 + " " + line2))
示例#4
0
 def _check_non_lowercase_cmd(self, line_number, line_content, cmd):
     if searchIgnorecase('(^|\ +)' + cmd + '\ *\(', line_content) and \
        (not search('(^|\ +)' + cmd.lower() + '\ *\(', line_content)):
         msg = 'Use lowercase command "' + cmd.lower() + '"'
         self._handle_style_error(line_number, 'command/lowercase', 5, msg)
示例#5
0
 def contains_phrase_in_first_line_or_across_two_lines(self, phrase, line1, line2):
     return searchIgnorecase(phrase, line1) or ((not searchIgnorecase(phrase, line2)) and searchIgnorecase(phrase, line1 + " " + line2))