Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 84a87eb9 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Add new clang and clang-tidy warning patterns"

parents 756e5308 3bb6c944
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -93,6 +93,8 @@ warn_patterns = [
         [r".*: warning: Null passed to a callee that requires a non-null"]),
    medium('Unused command line argument',
           [r".*: warning: argument unused during compilation: .+"]),
    medium('Set but not used',
           [r".*: warning: .* set but not used.*Wunused-but-set"]),
    medium('Unused parameter',
           [r".*: warning: unused parameter '.*'"]),
    medium('Unused function, variable, label, comparison, etc.',
+8 −2
Original line number Diff line number Diff line
@@ -23,15 +23,19 @@ from .cpp_warn_patterns import compile_patterns
from .severity import Severity


def tidy_warn_pattern(description, pattern):
def tidy_warn(description, patterns):
  return {
      'category': 'C/C++',
      'severity': Severity.TIDY,
      'description': 'clang-tidy ' + description,
      'patterns': [r'.*: .+\[' + pattern + r'\]$']
      'patterns': patterns,
  }


def tidy_warn_pattern(description, pattern):
  return tidy_warn(description, [r'.*: .+\[' + pattern + r'\]$'])


def simple_tidy_warn_pattern(description):
  return tidy_warn_pattern(description, description)

@@ -168,6 +172,8 @@ warn_patterns = [
    simple_tidy_warn_pattern('portability-simd-intrinsics'),
    group_tidy_warn_pattern('portability'),

    tidy_warn('TIMEOUT', [r".*: warning: clang-tidy aborted "]),

    # warnings from clang-tidy's clang-analyzer checks
    analyzer_high('clang-analyzer-core, null pointer',
                  [r".*: warning: .+ pointer is null .*\[clang-analyzer-core"]),