<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/55024>55024</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            missing build path in some clang-tidy-11 warnings
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          pjaitken
      </td>
    </tr>
</table>

<pre>
    Running clang-tidy-11 with "-p", some issues are prefixed with the "-p" path while others are not. eg:

`
$ clang-tidy-11 -header-filter=^((?!\.pb).)*\.h$ -checks=-readability-magic-numbers,-readability-isolate-declaration,-bugprone-reserved-identifier -p=/usr/src/packages/BUILD/builddir -quiet /usr/src/packages/BUILD/src/debug.c
../src/debug.c:151:11: warning: narrowing conversion from 'unsigned int' to signed type 'int' is implementation-defined [bugprone-narrowing-conversions]
                        return i;
                               ^
/usr/src/packages/BUILD/builddir/../src/debug.c:172:16: warning: integer literal has suffix 'ul', which is not uppercase [readability-uppercase-literal-suffix]
                dp_debug |= (1ul << i);
                             ^~~
                              UL
`

Notice that the first issue is reported against "../src/debug.c" (without the -p path) while the second is against "/usr/src/packages/BUILD/builddir/../src/debug.c" (which includes the -p path).

The -p path is included nearly 90% of the time.

As can be seen above, the path may or may not be included for analysis of any one file, and across multiple files it may or may not be included for a particular check type.

This is a problem when clang is run from a Jenkinsfile, where "recordIssues" parses the clang-tidy.log and reports "file not found" for each issue. clang-tidy.log has to be post-processed (with "sed") to normalise all the issues before parsing by recordIssues.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJylVVmP4zYM_jXOi2DDlnM-5GGOBtjFog9F97mgbdrRjix5dcw0_76k7LnS3e4ADRLFFikeHz9Sje0uxz-iMcoMotVghjyo7pJXlXhS4SwyKfOJlkzeCW9HFMr7iF6AQzE57NXf2M2a4Ywv2mIC2nk6K43CksDNB4wNhcAhq2-y8j4rn9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