Bug 409986 - clazy-standalone should emit supported checks (preferably with more meta data like level and categories)
Summary: clazy-standalone should emit supported checks (preferably with more meta data...
Status: RESOLVED FIXED
Alias: None
Product: clazy
Classification: Developer tools
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: Unassigned bugs mailing-list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-07-19 09:55 UTC by Nikolai Kosjar
Modified: 2019-09-13 14:22 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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