Bug 435620

Summary: Formatting conflict between KDE clang-format and clazy
Product: [Developer tools] buildsystem Reporter: Jonathan Marten <jjm>
Component: generalAssignee: Alexander Neundorf <neundorf>
Status: REPORTED ---    
Severity: normal CC: smartins
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

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.