The output of clang-tidy itself already has enough newlines, so the resulting output is more in line with the usual compiler output.
Details
- Reviewers
alexfh JonasToth - Commits
- rZORG89516edcd6ef: [clang-tidy] Removed superfluous and slightly annoying newlines in run-clang…
rG89516edcd6ef: [clang-tidy] Removed superfluous and slightly annoying newlines in run-clang…
rGf12c9730ef0d: [clang-tidy] Removed superfluous and slightly annoying newlines in run-clang…
rCTE360883: [clang-tidy] Removed superfluous and slightly annoying newlines in run-clang…
rL360883: [clang-tidy] Removed superfluous and slightly annoying newlines in run-clang…
Diff Detail
- Repository
- rL LLVM
Event Timeline
I agree with the direction, please ensure that e.g. clang-analyzer-* output looks proper as well and -quiet does, too.
OK, are there any (unit) tests which I should run? If yes, how exactly? I have a successfully built a fork of https://github.com/llvm/llvm-project via ninja locally, but the documentation for the various subprojects is still a bit hard to find to me. Is there a ninja target for clang-tidy-related tests? Any hints to get started would be highly appreciated.
This and the other output-related patches are my first submissions here, and they are intentionally simple to get the workflow right. My real intention is trying to improve/fix the readability-identifier-naming check/fixer, which still has a few issues.
There are testing targets for clang-tidy and clang-tooling, i believe ninja check-clang-tools is includes clang-tidy (maybe ninja check-clang-tooling instead).
If this script is actually covered by testing is not know to me, i believe not.
For testing just run it over a project (e.g. parts of LLVM) with this tool instead of e.g. your distribution version of it.
For general development: clang-tools-extra/test/clang-tidy/* has the test-cases for clang-tidy checks, which are real world code examples that cover all representative cases (in theory).
- Write/adjust test
- Do changes in code
- Test with ninja check-clang-tools / ninja check-clang-tooling
That usually works. If you encounter any issues feel free to ask here/IRC/mail, we are happy to help out :)
I think ninja clang-test-tools is the right target here, and it is happy with the change, which is not very surprising: AFAICT, there is just a single, very simple check for run-clang-tidy.py. Anyway, my manual testing with and without -quiet shows no problems, either. Furthermore, we have a patched version with the above change in our CI for quite some time, and it works fine. And if I read the git history correctly, the output should be identical to the one before a fix for interleaved output was landed (that fix added the newlines somehow).