Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-12507

Improve the output format of s_clang_scan

    • Type: Icon: Technical Debt Technical Debt
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Lint
    • Storage Engines
    • 3
    • StorEng - Defined Pipeline

      While writing WT-12506 I realised the output produced by s_clang_format is hard to understand. This ticket is to clean up the output and make it easier to understand

      The way the script works is:

      • Run clang_scan
      • Capture the output from clang_scan, filter it to only report files and warnings (removing context such as line numbers)
      • Diff the filtered output with s_clang_scan.diff and fail if there is any delta
      • When there's a failure also dump the unfiltered clang_scan output to help with debugging

      This produces two different fail modes

      1. If there are suppressed errors in s_clang_scan.diff which aren't present in the clang_scan output then we just need to remove those lines from clang_scan.diff. This is not a real error and s_clang_scan.diff needs to be updated
      2. If there are errors in the clang_scan output which aren't suppressed by s_clang_scan.diff then we have an issue that needs to be addressed.

      Currently in both cases we'll report the diff and dump the unfiltered clang_scan output. This causes confusion as developers see the unfiltered output and assume they need to address errors which are already suppressed by s_clan_scan.diff.

      We should update the script to do the following:

      • In case 1) only report that lines need to be removed from s_clang_scan.diff
      • In case 2) Find a way to still report the unfiltered output, but make it clear that the only warnings that need to be addressed are the ones from the diff output reported under the
        =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
        scan-build output differs from expected:
        <<<<<<<<<< Expected >>>>>>>>>> Current
        =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 

        heading

       

            Assignee:
            backlog-server-storage-engines [DO NOT USE] Backlog - Storage Engines Team
            Reporter:
            andrew.morton@mongodb.com Andrew Morton
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: