stubber.codemod.add_comment¶
Add comment(s) to each file
Classes¶
A command that acts identically to a visitor-based transform, but also has |
Module Contents¶
- class stubber.codemod.add_comment.AddComment(context: libcst.codemod.CodemodContext, comments: List[str])¶
Bases:
libcst.codemod.VisitorBasedCodemodCommandA command that acts identically to a visitor-based transform, but also has the support of
add_args()and running supported helper transforms after execution. SeeCodemodCommandandContextAwareTransformerfor additional documentation.- Parameters:
context (libcst.codemod.CodemodContext)
comments (List[str])
- static add_args(arg_parser: argparse.ArgumentParser) None¶
Add command-line args that a user can specify for running this codemod.
- Parameters:
arg_parser (argparse.ArgumentParser)
- Return type:
None
- comments¶
- needs_add = True¶
- visit_Comment(node: libcst.Comment) None¶
connect comments from the source
- Parameters:
node (libcst.Comment)
- Return type:
None
- leave_Module(original_node: libcst.Module, updated_node: libcst.Module) libcst.Module¶
If the tag already exists, don’t modify the file.
- Parameters:
original_node (libcst.Module)
updated_node (libcst.Module)
- Return type:
libcst.Module