clang-tidy support followup (actually error travis job with warnings/errors)
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 74
- Forks
- 9
- PR merge metrics
- No merged PRs in 30d
Description
As mentioned at https://github.com/mapbox/node-cpp-skel/pull/64#discussion_r133848127 and https://github.com/mapbox/node-cpp-skel/pull/64#discussion_r133848275 when I set up the make tidy target I was unable to find a way to have clang-tidy return non-zero on warnings/errors.
What this means is that the clang-tidy job on travis will only fail when clang tidy notices problems AND fixes them. Then it will leave behind a git diff and the presence of that diff will trigger the job to fail.
But because clang-tidy cannot auto-fix all problems their is a large class of warnings/errors that do not fail the script and therefore may be present but not failing the travis job.
The todo here is to figure out if the usage of clang-tidy can be fixed (are we doing something wrong, forgetting some flag?) to make clang-tidy return a non-zero error code when it encounters warnings/errors.
/cc @GretaCB who saw this recently with shaver - locally @GretaCB saw a number of pretty important clang-tidy warnings that were silently passing on travis since they were not causing the job to fail.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the make tidy target and the Travis clang-tidy job, then read the two linked pull-request discussion comments for the original setup. Reproduce a warning that is not auto-fixed and check the command's exit status and resulting git diff. Done means clang-tidy warnings or errors reliably make the Travis job fail, including problems it cannot automatically fix.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- build-system, ci-cd, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100