banach-space / clang-tutor

A collection of out-of-tree Clang plugins for teaching and learning
The Unlicense
659 stars 62 forks source link

make -main-tu-only CodeStyleChecker behavior consistent with comments #6

Closed ivafanas closed 3 years ago

ivafanas commented 3 years ago

Comments sections notes:

//    By default this plugin will only run on the main translation unit. Use
//    `-main-tu-only=true` to make it run on e.g. included header files too.
//
// USAGE:
//    Main TU only:
//      * clang -cc1 -load libCodeStyleChecker.dylib -plugin CSC `\`
//        input-file.cpp
//    All TUs (the main file and the #includ-ed header files)
//      * clang -cc1 -load libCodeStyleChecker.dylib -plugin CSC `\`
//        -main-tu-only=true input-file.cpp

There is a mismatch between true/false value and desired behavior. Pull request is a proposal to change behavior and comment to make them consistent.

banach-space commented 3 years ago

Thank you for fixing this, this is very helpful!

Would you mind updating CodeStyleCheckerMain.cpp as well? https://github.com/banach-space/clang-tutor/blob/70e134b6c5e3aafa2ffcc3bf3ea8e48b2dc2af97/tools/CodeStyleCheckerMain.cpp#L13

ivafanas commented 3 years ago

Oops, yes, I will

ivafanas commented 3 years ago

Done.

Also fixed comment about passing command line option to plugin.