- creat() should be replaced by open(). [android-creat-usage]
Details
Diff Detail
Event Timeline
clang-tidy/utils/ExprToStr.cpp | ||
---|---|---|
18 | Maybe you can use clang::Lexer::getSourceText( CharSourceRange::getTokenRange(EX->getSourceRange()), ...) here? so that we don't need this utility fucntion. |
clang-tidy/android/CreatUsageCheck.cpp | ||
---|---|---|
43 | Most coding styles would prefer replacement text as "open(", instead of "open (". |
clang-tidy/android/CreatUsageCheck.cpp | ||
---|---|---|
30 | Nit: put the returns(isInteger()) in front of hasName() (make it align with cpp function declaration). | |
40 | Use MatchedCall->getSourceRange(). Again, no need to create a separate variable as this variable is used only once. | |
docs/clang-tidy/checks/android-creat-usage.rst | ||
7 | Would be nice to give some examples in the doc. | |
test/clang-tidy/android-creat-usage.cpp | ||
10 | Could you add test cases where the second parameter is not a magic number? E.g. creat("filename", mode);. |
Nit: put the returns(isInteger()) in front of hasName() (make it align with cpp function declaration).