Bug 419578 - Promote selected Clazy checks to errors
Summary: Promote selected Clazy checks to errors
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: Christian Schärf
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-03 10:20 UTC by Christian Schärf
Modified: 2020-04-24 17:57 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

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