Bug 435620 - Formatting conflict between KDE clang-format and clazy
Summary: Formatting conflict between KDE clang-format and clazy
Status: REPORTED
Alias: None
Product: buildsystem
Classification: Developer tools
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Alexander Neundorf
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-04-11 15:57 UTC by Jonathan Marten
Modified: 2021-04-11 15: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 Jonathan Marten 2021-04-11 15:57:40 UTC
(Submitting to product 'buildsystem' because it has the potential to impact multiple products.  CC'ing clazy maintainer, please reassign if appropriate).

SUMMARY

There seems to be a difference of opinion between the standard KDE clang-format options and clazy, regarding the formatting of pointers in old style connect signatures. clang-format requires a space between the type and pointer, for example:

  connect(job, SIGNAL(result(KJob *)), SLOT(pasteJobDone(KJob *)));

but the 'connect-not-normalized' check in clazy would like there to be no space:

  connect(job, SIGNAL(result(KJob*)), SLOT(pasteJobDone(KJob*)));

The 'connect-not-normalized' check is included in level 0 and so runs as part of the 'build_clazy_clang_tidy' CI pipeline, causing it to fail (for example https://invent.kde.org/pim/akonadi/-/jobs/99829).  This means that any merge request marked as "automatically merge when the pipeline succeeds" will never succeed and manual intervention is needed.

The formatting and checking needs to be compatible between the two tools.