From dbaf57aede176b2c0b7652b17927700d4f1568fe Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Thu, 14 Sep 2023 21:30:28 +0200 Subject: [PATCH] Fix docstring indentation --- docs/_writing_argparse.rst | 4 +--- .../autopygen/argument_parser_conversion.py | 6 +++--- planemo/autopygen/commands/command_utils.py | 21 ++++++++++--------- .../local_module_parsing.py | 13 ++++++------ .../parser_discovery_and_init.py | 4 ++-- 5 files changed, 24 insertions(+), 24 deletions(-) diff --git a/docs/_writing_argparse.rst b/docs/_writing_argparse.rst index b7479a8fc..97fa30ccc 100644 --- a/docs/_writing_argparse.rst +++ b/docs/_writing_argparse.rst @@ -25,6 +25,4 @@ since in most cases ``argparse`` does not distinguish between input and output files all file parameters will be rendered as input parameters of the tool. Please open an issue if you have ideas on how to improve the generated tools: -https://github.com/galaxyproject/planemo/issues - - +https://github.com/galaxyproject/planemo/issues \ No newline at end of file diff --git a/planemo/autopygen/argument_parser_conversion.py b/planemo/autopygen/argument_parser_conversion.py index 2d0d7133a..b87d5e6d9 100644 --- a/planemo/autopygen/argument_parser_conversion.py +++ b/planemo/autopygen/argument_parser_conversion.py @@ -1,7 +1,7 @@ """ Functions used to extract initialized ArgumentParser from target source code, and to transform it into easily usable ParamInfo class containing - all the necessary info for 'inputs' element initialization +all the necessary info for 'inputs' element initialization """ import ast import logging @@ -57,7 +57,7 @@ def obtain_and_convert_parser(path: str) -> Optional[DecoyParser]: Parameters ---------- path : str - path to the source file containing argument parser init + path to the source file containing argument parser init Returns ------- @@ -80,7 +80,7 @@ def obtain_and_convert_parser_from_str(text: str) -> Optional[ArgumentParser]: Parameters ---------- text : str - variable containing target source code + variable containing target source code Returns ------- diff --git a/planemo/autopygen/commands/command_utils.py b/planemo/autopygen/commands/command_utils.py index 4d425af76..4d20e57cd 100644 --- a/planemo/autopygen/commands/command_utils.py +++ b/planemo/autopygen/commands/command_utils.py @@ -3,6 +3,7 @@ are parts of template, separated from the rest by comments with specific structure Example of the comments: + ## foo definition ... block itself ... ## end foo definition @@ -42,8 +43,8 @@ def create_flag( comment : str wrapping comment depth : int - integer, used to set the depth of the current element. - This value is used to indent the block properly + integer, used to set the depth of the current element. + This value is used to indent the block properly indent : int default value for size of the block indent add_comment : bool @@ -73,18 +74,18 @@ def create_element_with_body( Parameters ---------- kind : str - string defining what kind of element is created, for example if or for - (loop) + string defining what kind of element is created, for example if or for + (loop) head : str - body of block header, for example predicate of condition, or the - body of loop + body of block header, for example predicate of condition, or the + body of loop body : str - body of the block, can be another element + body of the block, can be another element comment : str - comment, used to set the start and end of the block + comment, used to set the start and end of the block depth : int - integer, used to set the depth of the current element. - This value is used to indent the block properly + integer, used to set the depth of the current element. + This value is used to indent the block properly indent : int default value for size of the block indent body_indented : bool diff --git a/planemo/autopygen/source_file_parsing/local_module_parsing.py b/planemo/autopygen/source_file_parsing/local_module_parsing.py index 27ff3c88b..4b6dd0d7a 100644 --- a/planemo/autopygen/source_file_parsing/local_module_parsing.py +++ b/planemo/autopygen/source_file_parsing/local_module_parsing.py @@ -23,9 +23,10 @@ class UnknownNamesRemoval(ast.NodeVisitor): Attributes --- + unknown: Set[str] - set of names that represent variables used in parser initialization, - that have not been resolved yet + set of names that represent variables used in parser initialization, + that have not been resolved yet """ @@ -104,10 +105,10 @@ def handle_local_module_names(actions: List[ast.AST], unknown_names: Set[str]) - Parameters ---------- - actions : List[ast.AST] - list of actions extracted so far - unknown_names : - set of unknown names that have to be extracted + actions: List[ast.AST] + list of actions extracted so far + unknown_names: + set of unknown names that have to be extracted Returns ------- diff --git a/planemo/autopygen/source_file_parsing/parser_discovery_and_init.py b/planemo/autopygen/source_file_parsing/parser_discovery_and_init.py index ef5313985..dc45b1529 100644 --- a/planemo/autopygen/source_file_parsing/parser_discovery_and_init.py +++ b/planemo/autopygen/source_file_parsing/parser_discovery_and_init.py @@ -90,7 +90,7 @@ class SimpleParserDiscoveryAndReplacement(Discovery): """ Class responsible for discovery of ArgumentParser creation and assignment, and replacement of the class definition - by the one supplied through constructor + by the one supplied through constructor """ def __init__( @@ -230,7 +230,7 @@ def get_parser_init_and_actions(source: ast.Module) -> Tuple[List[ast.AST], str, Parameters ---------- source : ast.Module - source file parsed into ATT + source file parsed into ATT Returns -------