Bug 419578

Summary: Promote selected Clazy checks to errors
Product: [Developer tools] clazy Reporter: Christian Schärf <c.schaerf>
Component: generalAssignee: Christian Schärf <c.schaerf>
Status: RESOLVED FIXED    
Severity: wishlist CC: smartins
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Christian Schärf 2020-04-03 10:20:37 UTC
Until now, it is only possible to promote all Clazy checks to compile errors by setting the -Werror compiler flag, or none by setting the environment variable CLAZY_NO_WERROR.

I propose to add a more fine-grained control, allowing to promote specific Clazy checks to compile errors. Using the -Werror=some-clazy-check compiler flag unfortunately does not work since only built-in warnings are recognized by this mechanism.

If this is deemed useful, I may be able to look into the implementation myself.
Comment 1 Sergio Martins 2020-04-03 10:26:40 UTC
If you could look at it it would be great.

Last time I checked (2 or 3 years ago) it was hard to do, as clang didn't accept custom check names in -Werror=, only the built-in ones, I wonder if this has changed
Comment 2 Christian Schärf 2020-04-03 11:15:07 UTC
My idea was to add another environment variable such as CLAZY_CHECKS_ERROR, but I can also look whether we can extend clangs command line interface.
Comment 3 Christian Schärf 2020-04-11 14:48:59 UTC
I have posted a patch to Phabricator (https://phabricator.kde.org/D28757),
please let me know what you think.