Re: [PATCH] D19586: Misleading Indentation check

2016-09-27 Thread Gábor Horváth via cfe-commits
xazax.hun added inline comments. Comment at: test/clang-tidy/readability-misleading-indentation.cpp:16 @@ +15,3 @@ + // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: wrong indentation, 'else' belongs to 'if(cond2)' statement + // CHECK-FIXES: {{^}} // commen

Re: [PATCH] D19586: Misleading Indentation check

2016-09-05 Thread Pauer Gergely via cfe-commits
Pajesz marked 12 inline comments as done. Pajesz added a comment. so i have to submit K good to know Comment at: test/clang-tidy/readability-misleading-indentation.cpp:48 @@ +47,3 @@ + } + foo2(); // ok + nlewycky wrote: > This is arguably misleading ind

Re: [PATCH] D19586: Misleading Indentation check

2016-07-19 Thread Alexander Kornienko via cfe-commits
alexfh added a comment. Please mark all addressed comments "Done". Comment at: test/clang-tidy/readability-misleading-indentation.cpp:15 @@ +14,3 @@ + foo2(); // comment + // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: wrong indentation, 'else' belongs to 'if(con

Re: [PATCH] D19586: Misleading Indentation check

2016-07-14 Thread Pauer Gergely via cfe-commits
Pajesz updated this revision to Diff 63925. Pajesz added a comment. Minor changes in tests and doc and diff should be full now. http://reviews.llvm.org/D19586 Files: clang-tidy/readability/CMakeLists.txt clang-tidy/readability/MisleadingIndentationCheck.cpp clang-tidy/readability/Misleadi

Re: [PATCH] D19586: Misleading Indentation check

2016-07-06 Thread Alexander Kornienko via cfe-commits
alexfh added a comment. Gergely, it seems that the last diff is missing clang-tidy/readability/MisleadingIndentationCheck.cpp. A few more comments below. Comment at: docs/clang-tidy/checks/readability-misleading-indentation.rst:13 @@ +12,3 @@ + +The way to avoid dangling else

Re: [PATCH] D19586: Misleading Indentation check

2016-06-23 Thread Pauer Gergely via cfe-commits
Pajesz updated this revision to Diff 61651. Pajesz added a comment. Checker now works with for and while statements as well, new tests were added, other syntactical and logical updates have been made. http://reviews.llvm.org/D19586 Files: clang-tidy/readability/MisleadingIndentationCheck.h

Re: [PATCH] D19586: Misleading Indentation check

2016-04-29 Thread Etienne Bergeron via cfe-commits
etienneb added a comment. In http://reviews.llvm.org/D19586#417063, @xazax.hun wrote: > In http://reviews.llvm.org/D19586#417053, @etienneb wrote: > > > The rule also apply for statements in a same compound: > > > > { > > statement1(); > > statement2(); > > statement3(); > > > > >

Re: [PATCH] D19586: Misleading Indentation check

2016-04-29 Thread Gábor Horváth via cfe-commits
xazax.hun added a comment. In http://reviews.llvm.org/D19586#417053, @etienneb wrote: > The rule also apply for statements in a same compound: > > { > statement1(); > statement2(); > statement3(); > > > But this can be a further improvement. I believe this might be an intentiona

Re: [PATCH] D19586: Misleading Indentation check

2016-04-29 Thread Etienne Bergeron via cfe-commits
etienneb added a comment. You should not limit the checker to "if". The for-statement and while-statement are also wrong for the same reasons: while (x) statement1(); statement2(); for (...) statement1(); statement2(); You should test your code over large code base. You sh

Re: [PATCH] D19586: Misleading Indentation check

2016-04-29 Thread Etienne Bergeron via cfe-commits
etienneb requested changes to this revision. etienneb added a comment. This revision now requires changes to proceed. Could you lift some logics to the matcher instead of the check. Comment at: clang-tidy/readability/MisleadingIndentationCheck.cpp:22 @@ +21,3 @@ +const Match

Re: [PATCH] D19586: Misleading Indentation check

2016-04-28 Thread Pauer Gergely via cfe-commits
Pajesz updated this revision to Diff 55389. Pajesz marked 5 inline comments as done. Pajesz added a comment. Both dangling else and the other check now ignore one-line if-else statements. Corrected other reviews as well. http://reviews.llvm.org/D19586 Files: clang-tidy/readability/CMakeLists

Re: [PATCH] D19586: Misleading Indentation check

2016-04-28 Thread Gábor Horváth via cfe-commits
xazax.hun added a comment. In http://reviews.llvm.org/D19586#415123, @Pajesz wrote: > Both dangling else and the other check now ignore one-line if-else > statements. Corrected other reviews as well. I can not see a test case for one line if-then-else. Could you add it? http://reviews.llvm.o

Re: [PATCH] D19586: Misleading Indentation check

2016-04-27 Thread Nick Lewycky via cfe-commits
nlewycky added a subscriber: nlewycky. Comment at: clang-tidy/readability/MisleadingIndentationCheck.cpp:31 @@ +30,3 @@ + Result.SourceManager->getExpansionColumnNumber(ElseLoc)) +diag(ElseLoc, "potentional dangling else"); +} Typo of "potential" as "pote

Re: [PATCH] D19586: Misleading Indentation check

2016-04-27 Thread Eugene Zelenko via cfe-commits
Eugene.Zelenko added a subscriber: Eugene.Zelenko. Eugene.Zelenko added a comment. Please mention this check in docs/ReleaseNotes.rst (in alphabetical order). What about for ans while statements? Comment at: docs/clang-tidy/checks:10 @@ +9,3 @@ + +The way to avoid dangling else

Re: [PATCH] D19586: Misleading Indentation check

2016-04-27 Thread Pauer Gergely via cfe-commits
Pajesz updated this revision to Diff 55247. Pajesz added a comment. Probably fixed the broken patch. http://reviews.llvm.org/D19586 Files: clang-tidy/readability/CMakeLists.txt clang-tidy/readability/MisleadingIndentationCheck.cpp clang-tidy/readability/MisleadingIndentationCheck.h clan

Re: [PATCH] D19586: Misleading Indentation check

2016-04-27 Thread Alexander Kornienko via cfe-commits
alexfh added a comment. The patch is broken: Index: clang-tidy/readability/Mislead === --- /dev/null +++ clang-tidy/readability/Mislead @@ -0,0 +1,77 @@ +//===--- MisleadingIndentationCheck.cpp - clang-tidy--