def as_phabricator_lint(self):
     '''
     Outputs a Phabricator lint result
     '''
     return LintResult(
         name=self.message,
         code='coverity.{}'.format(self.kind),
         severity='error',
         path=self.path,
         line=self.line,
         description=self.body,
     )
Beispiel #2
0
 def as_phabricator_lint(self):
     '''
     Outputs a Phabricator lint result
     '''
     return LintResult(
         name=self.message,
         code='infer.{}'.format(self.bug_type),
         severity=self.kind,
         path=self.path,
         line=self.line,
         char=self.column,
         description=self.body,
     )
Beispiel #3
0
 def as_phabricator_lint(self):
     '''
     Outputs a Phabricator lint result
     '''
     description = None
     if self.patch:
         description = 'Replace with :\n\n```{}```'.format(self.patch)
     return LintResult(
         name='C/C++ style issue',
         description=description,
         code='clang-format',
         severity='warning',
         path=self.path,
         line=self.line,
         char=self.column,
     )
 def as_phabricator_lint(self):
     '''
     Outputs a Phabricator lint result
     '''
     description = self.message
     if self.body:
         description += '\n\n > {}'.format(self.body)
     return LintResult(
         name='Clang-Tidy - {}'.format(self.check),
         description=description,
         code='clang-tidy.{}'.format(self.check),
         severity='warning',
         path=self.path,
         line=self.line,
         char=self.char,
     )
Beispiel #5
0
    def as_phabricator_lint(self):
        '''
        Outputs a Phabricator lint result
        '''
        # If there is the reliability index use it
        message = f'Checker reliability is {self.reliability.value} (false positive risk).\n{self.message}' \
            if self.reliability != Reliability.Unknown \
            else self.message

        return LintResult(
            name=message,
            code='coverity.{}'.format(self.kind),
            severity='error',
            path=self.path,
            line=self.line,
            description=self.body,
        )
Beispiel #6
0
 def as_phabricator_lint(self):
     '''
     Outputs a Phabricator lint result
     '''
     code = self.linter
     name = 'MozLint {}'.format(self.linter.capitalize())
     if self.rule:
         code += '.{}'.format(self.rule)
         name += ' - {}'.format(self.rule)
     return LintResult(
         name=name,
         description=self.message,
         code=code,
         severity=self.level,
         path=self.path,
         line=self.line,
         char=self.column,
     )
Beispiel #7
0
    def as_phabricator_lint(self):
        '''
        Outputs a Phabricator lint result
        '''
        description = self.message

        # Append to description the reliability index if any
        if self.reliability != Reliability.Unknown:
            description += '\nChecker reliability is {} (false positive risk).'.format(self.reliability.value)

        if self.body:
            description += '\n\n > {}'.format(self.body)
        return LintResult(
            name='Clang-Tidy - {}'.format(self.check),
            description=description,
            code='clang-tidy.{}'.format(self.check),
            severity='warning',
            path=self.path,
            line=self.line,
            char=self.char,
        )