Open LegalizeAdulthood opened 9 years ago
Proposed check name: modernize-use-single-line-comments
Hi!
This issue may be a good introductory issue for people new to working on LLVM. If you would like to work on this issue, your first steps are:
1) Assign the issue to you.
2) Fix the issue locally.
3) Run the test suite locally.
3.1) Remember that the subdirectories under test/
create fine-grained testing targets, so you can
e.g. use make check-clang-ast
to only run Clang's AST tests.
4) Create a git
commit
5) Run git clang-format HEAD~1
to format your changes.
6) Submit the patch to Phabricator.
6.1) Detailed instructions can be found here
For more instructions on how to submit a patch to LLVM, see our documentation.
If you have any further questions about this issue, don't hesitate to ask via a comment on this Github issue.
@llvm/issue-subscribers-good-first-issue
@PiotrZSL can you provide some analysis and points of entry into codebase?
Create new check, call it modernize-use-double-slash-comments, modernize-use-cpp-comment-style or something else.
PP->addCommentHandler
clang::CommentHandler
interfaceStringRef CommentText = Lexer::getSourceText(CharSourceRange::getCharRange(CommentRange), PP.getSourceManager(), PP.getLangOpts());
"^[ \t]*/\\*+[ \t\n]*(.*[ \t\n]*)*[ \t\n]*\\*+/[ \t\n]*$"
(or implement this in other way)*****
or #######
)I would like to take up the issue if nobody is working as this would be a good start for me to begin llvm. So, please correct me if I am wrong. We have to implement a check that converts /* styled comment that is used for single line to // style. While doing that we have to take care of the like Doxygen comment (as @PiotrZSL mentioned) in clang-tidy.
I am new to this project please help me out.
Extended Description
Detect when C-style /.../ block comments are used to create a single-line comment. Replace those block-style comments with // style comments.
Possible false positives:
/* ....\ */
comments could result in a // comment like this:
// ...\
which would escape the newline and be a problem.