示例#1
0
 def on_pr_opened(self, api, payload):
     diff = api.get_diff()
     for line in diff.split('\n'):
         if is_addition(line) and line.find("<title></title>") > -1:
             # This test doesn't consider case and whitespace the same way
             # that a HTML parser does, so empty title elements might still
             # go unnoticed. It will catch the low-hanging fruit, though.
             self.warn(WARNING)
             return
示例#2
0
 def get_added_lines(self):
     diff = self.get_diff()
     for line in diff.splitlines():
         if is_addition(line):
             # prefix of one or two pluses (+)
             yield line
示例#3
0
 def on_pr_opened(self, api, payload):
     diff = api.get_diff()
     for line in diff.split('\n'):
         if is_addition(line) and line.find('unsafe ') > -1:
             self.warn(unsafe_warning_msg)
             return
示例#4
0
 def on_pr_opened(self, api, payload):
     diff = api.get_diff()
     for line in diff.split('\n'):
         if is_addition(line) and line.find('unsafe ') > -1:
             self.warn(unsafe_warning_msg)
             return