- creat() should be replaced by open(). [android-creat-usage]
Details
Details
Diff Detail
Diff Detail
Event Timeline
clang-tidy/utils/ExprToStr.cpp | ||
---|---|---|
17 ↗ | (On Diff #101254) | 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 | ||
---|---|---|
42 ↗ | (On Diff #101829) | Most coding styles would prefer replacement text as "open(", instead of "open (". |
clang-tidy/android/CreatUsageCheck.cpp | ||
---|---|---|
29 ↗ | (On Diff #103792) | Nit: put the returns(isInteger()) in front of hasName() (make it align with cpp function declaration). |
39 ↗ | (On Diff #103792) | 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 | ||
6 ↗ | (On Diff #103792) | Would be nice to give some examples in the doc. |
test/clang-tidy/android-creat-usage.cpp | ||
9 ↗ | (On Diff #103792) | Could you add test cases where the second parameter is not a magic number? E.g. creat("filename", mode);. |