[PATCH] D27621: [clang-tidy] check to find declarations declaring more than one name

Firat Kasmis via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Jan 21 06:35:18 PST 2017


firolino marked 7 inline comments as done.
firolino added a comment.

- nothing special, just went through some open comments and marked them as Done.



================
Comment at: clang-tidy/readability/OneNamePerDeclarationCheck.cpp:246
+
+static std::string getCurrentLineIndent(SourceLocation Loc,
+                                        const SourceManager &SM) {
----------------
aaron.ballman wrote:
> firolino wrote:
> > malcolm.parsons wrote:
> > > Should checks care about formatting, or leave to clang-format?
> > At least, they should not change the formatting and try to preserve it. The user shouldn't be forced to run clang-format multiple times. Moreover, not everyone is using clang-format etc.
> > 
> > Having:
> > ```
> > const int myvalue( 42 ), value ( 4 );
> > 
> > {
> >     int a, b, c;
> > }
> > ```
> > and getting:
> > ```
> > const int myvalue(42);
> > const int value(4);
> > 
> > {
> >     int a;
> > int b;
> > int c;
> > }
> > ```
> > seems very unsatisfying to me. This would force a non-formatting-tool user to start using one.
> I think what @malcolm.parsons was getting at is that we have talked about automatically running clang-format over changes made from the FixIt engine instead of trying to add custom logic to all of the places we use FixIts.
Sounds good! Will clang-format be able to detect the code format in the future?


https://reviews.llvm.org/D27621





More information about the cfe-commits mailing list