stubber.codemod.add_comment =========================== .. py:module:: stubber.codemod.add_comment .. autoapi-nested-parse:: Add comment(s) to each file Classes ------- .. autoapisummary:: stubber.codemod.add_comment.AddComment Module Contents --------------- .. py:class:: AddComment(context: libcst.codemod.CodemodContext, comments: List[str]) Bases: :py:obj:`libcst.codemod.VisitorBasedCodemodCommand` A command that acts identically to a visitor-based transform, but also has the support of :meth:`~libcst.codemod.CodemodCommand.add_args` and running supported helper transforms after execution. See :class:`~libcst.codemod.CodemodCommand` and :class:`~libcst.codemod.ContextAwareTransformer` for additional documentation. .. py:attribute:: DESCRIPTION :type: str :value: 'Add comment(s) to each file' .. py:method:: add_args(arg_parser: argparse.ArgumentParser) -> None :staticmethod: Add command-line args that a user can specify for running this codemod. .. py:attribute:: comments .. py:attribute:: _regex_pattern :type: Pattern[str] .. py:attribute:: needs_add :value: True .. py:method:: visit_Comment(node: libcst.Comment) -> None connect comments from the source .. py:method:: leave_Module(original_node: libcst.Module, updated_node: libcst.Module) -> libcst.Module If the tag already exists, don't modify the file.