RFC: clang-tidy, readability-isolate-declaration and readability-braces-around-statements
Open, Needs TriagePublic

Description

readability-isolate-declaration : one declaration per line, which is KF coding style

readability-braces-around-statements: always use braces around statements, again KF coding style

I don't think this needs to be a git hook, because such issues are usually easy to spot in code review, basically it would be a one-time run (and adding the commits to .git-blame-ignore-revs so as to keep git blame path clear).

run-clang-tidy -checks='-*,readability-braces-around-statements,readability-isolate-declaration' -jN -fix
alex added a subscriber: alex.Jul 20 2021, 5:25 AM

I don't think this needs to be a git hook, because such issues are usually easy to spot in code review, basically it would be a one-time run (and adding the commits to .git-blame-ignore-revs so as to keep git blame path clear).

Some projects use GitlabCI to enforce those checks, could be worth adding this check if it is production ready.

readability-braces-around-statements: always use braces around statements, again KF coding style

Yep, completely agree. I did this change to some repos in Plasma while working on the clang-format reformatting

If there are no objections I'll run this on KF repos right after the 5.85 release. (I'll ping this task before I actually start, just in case).

ahmadsamir moved this task from Backlog to Done on the Frameworks board.Aug 13 2021, 3:57 PM
alex added a comment.Aug 13 2021, 4:40 PM

Good job!