WIP: clang-tidy compatibility
Needs RevisionPublic

Authored by christiangagneraud on May 12 2019, 9:03 AM.

Details

Reviewers
smartins
Summary

This is a work in progress.
The goal is to make clazy a bit ore compatible with clang-tidy.
This requires to handle more command line options (eg, -list-checks),
handle check filtering (eg '*' and '-') and be able to load a default
config from a file.

See https://bugs.kde.org/show_bug.cgi?id=407258

Test Plan

None yet

Diff Detail

Repository
R74 Clazy
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 11757
Build 11775: arc lint + arc unit
christiangagneraud requested review of this revision.May 12 2019, 9:03 AM
christiangagneraud created this revision.
smartins requested changes to this revision.May 12 2019, 7:18 PM

some things are unrelated and so simple that should be committed directly already

thanks!

src/Clazy.cpp
175

remove extra set of ()

367

Put this chunk in a separate commit and push directly

src/Clazy.h
55

Do a separate commit just for the unrelated typos, and push it directly to master

This revision now requires changes to proceed.May 12 2019, 7:18 PM
src/Clazy.cpp
367

I'll push this one.

But there are more, in the docs:

chgans@chgans-workstation:~/Projects/clazy$ git grep -w CLAZY_FIXIT
docs/checks/README-auto-unexpected-qstringbuilder.md:    export CLAZY_FIXIT="fix-auto-unexpected-qstringbuilder"
docs/checks/README-function-args-by-ref.md:    export CLAZY_FIXIT="fix-function-args-by-ref"
docs/checks/README-old-style-connect.md:You can convert the most simple cases with `export CLAZY_FIXIT=fix-old-style-connect`.
docs/checks/README-qstring-allocations.md:        export CLAZY_FIXIT="fix-fromCharPtrAllocations"
docs/checks/README-qstring-ref.md:`export CLAZY_FIXIT="fix-missing-qstringref"`
docs/man/clazy.pod:clazy has the ability to "fix" the offending code in some cases.  See the B<CLAZY_FIXIT>
docs/man/clazy.pod:B<CLAZY_FIXIT> - some checkers are able to automatically re-write your source code whenever
docs/man/clazy.pod:% export CLAZY_FIXIT="fix-qlatin1string-allocations"
docs/man/clazy.pod:% export CLAZY_FIXIT=fix-old-style-connect
christiangagneraud marked 3 inline comments as done.May 13 2019, 2:08 AM

I'll fix the docs, thanks

needs a rebase, then it probably can be merged (if it's functionally equivalent, i.e. doesn't remove the env vars just yet)
then in another commit it can read from .clazy