Bug 409986

Summary: clazy-standalone should emit supported checks (preferably with more meta data like level and categories)
Product: [Developer tools] clazy Reporter: Nikolai Kosjar <nikolai.kosjar>
Component: generalAssignee: Unassigned bugs mailing-list <unassigned-bugs>
Status: RESOLVED FIXED    
Severity: wishlist CC: smartins
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:

Description Nikolai Kosjar 2019-07-19 09:55:51 UTC
Qt Creator supports only a single clazy version, the one Qt Creator is build with.

Currently we read checks.json and generate a source file describing the checks (https://code.qt.io/cgit/qt-creator/qt-creator.git/tree/src/plugins/cpptools/cpptools_clazychecks.h) with the check name, level and categories. This is presented to the user in Menu: Tools > Options > C++ > Code Model > "Manage..." and select Clazy tab.

To support multiple clazy versions (e.g. for using newer clazy than Qt Creator was build against), it's desirable to query the clazy-standalone executable for supported checks.


Some thoughts/observations:

clang-tidy can dump the supported checks (names) with
    $ clang-tidy "-checks=*" --list-checks

Clazy could do that, too, especially in the light of https://bugs.kde.org/show_bug.cgi?id=407258

But to support the current clazy UI in Qt Creator, the check names are not enough. We would also need the level and categories (and later maybe some description of which checks support which settings).

Should clazy-standalone just dump it's checks.json (or some stripped version of it) to stdout if requested?
Comment 1 Nikolai Kosjar 2019-09-13 14:22:20 UTC
Git commit cc9c5da74bebd877538a581bcb7af0f01dbbfeb3 by Nikolai Kosjar.
Committed on 13/09/2019 at 14:22.
Pushed by nkosjar into branch 'master'.

Add '-supported-checks-json' command line option

Summary:
...to dump the contents of checks.json.

This is useful for IDEs as they can find out now whether a particular
check is supported.

Differential Revision: https://phabricator.kde.org/D23680

M  +3    -0    CMakeLists.txt
A  +28   -0    checks.json.h.in
M  +13   -1    src/ClazyStandaloneMain.cpp

https://commits.kde.org/clazy/cc9c5da74bebd877538a581bcb7af0f01dbbfeb3