Skip to main content

Qt C++ Code Review Skill V3.1 Adds clang-tidy and clazy

Comments

Version 3.1 of the Qt C++ code review skill can now run the clang-tidy and clazy code analysis tools. The new step is optional, and it makes more of the review deterministic instead of probabilistic.

Why static analysis matters for AI reviews

Why does that matter? An AI review is probabilistic: run it twice on the same code and you may get two different lists of findings. Version 3.0 already reduced that. Every review starts with a linter written in plain Python that checks the code against more than 60 Qt6 rules, and the AI is told not to report what the linter already found. But the linter works on patterns. Some defects can only be found by a tool that understands types and templates, and until now those were left to the AI, which has to read the code and judge it each time.

Qt-CPP-REVIEW v3.1 in Copilot

What clang-tidy and clazy add

clang-tidy and clazy are compiler-based static code analysis. They parse your code the way the compiler does, so the same code gives the same findings on every run, and they cost no tokens. In 3.1 they take over the checks where that precision matters. For example:

  • Results of calls such as QFile::open() that are discarded without being checked.

  • Polymorphic classes without a virtual destructor, or with a wrong override.

  • Old-style connect() calls, a missing Q_OBJECT macro, and copyable polymorphic classes.

What is new in 3.1

  • An optional analyse argument: the skill runs clang-tidy and clazy over the translation units in scope. Without it, the review runs exactly as in 3.0.

  • The analyser wins on overlap: where a tool covers a lint rule, the linter drops that rule on the analysed files. If the AI finds the same defect on the same line as a tool, the AI finding is dropped.

  • A hint when it fits: if your repository has a compile_commands.json and you did not ask for the analysers, the skill suggests them.

How to trigger the checks

To trigger the analysers, add the argument to the command:

  • /qt-cpp-review analyse

  • /qt-cpp-review framework analyse

The tools need a compile_commands.json to know how your code is built. With CMake, configure your project with -DCMAKE_EXPORT_COMPILE_COMMANDS=ON.

The benefit: a review you can repeat

The benefit is a review you can repeat. The more of it that is static analysis, the more of the result is deterministic, at least for the part of the code the tools can cover. The deep AI analysis remains probabilistic. That is why it only reports findings it can back with a symbol trace and a confidence score, and why it can now spend its effort on ownership, threading and model contracts, where judgement matters.

Tested with

We tested the skill in Claude Code CLI with Claude Sonnet 5.5, in Github Copilot in VS Code with GPT 6.1 Terra and Gemini 4 Hydrogen.

Try it

So, update the skill, try it on your own code, and let us know where we can do better. The skills are available from the TheQtCompanyRnD agent-skills GitHub repository or through the Claude Marketplace qt-development plug-in.

Comments

Subscribe to our blog

Try Qt 6.12 Now!

Download the latest release here: www.qt.io/download

Qt 6.12 LTS is now available, with new features and improvements for application developers and device creators.

We're Hiring

Check out all our open positions here and follow us on Instagram to see what it's like to be #QtPeople.