robot.tidypkg package

Submodules

robot.tidypkg.transformers module

class robot.tidypkg.transformers.Cleaner[source]

Bases: robot.parsing.model.visitor.ModelTransformer

Clean up and normalize data.

Following transformations are made: 1) section headers are normalized to format *** Section Name *** 2) setting names are normalize in setting table and in test cases and

user keywords to format Setting Name or [Setting Name]
  1. settings without values are removed
  2. Empty lines after section headers and within items are removed
  3. For loop declaration and end tokens are normalized to FOR and END
  4. Old style for loop indent (i.e. a cell with only a ``) are removed
visit_CommentSection(section)[source]
visit_Section(section)[source]
visit_Statement(statement)[source]
visit_ForLoop(loop)[source]
generic_visit(node)

Called if no explicit visitor function exists for a node.

visit(node)

Visit a node.

class robot.tidypkg.transformers.NewlineNormalizer(newline, short_test_name_length)[source]

Bases: robot.parsing.model.visitor.ModelTransformer

Normalize new lines in test data

After this transformation, there is exactly one empty line between each section and between each test or user keyword.

visit_File(node)[source]
visit_Section(node)[source]
visit_CommentSection(node)[source]
visit_TestCaseSection(node)[source]
visit_TestCase(node)[source]
visit_KeywordSection(node)[source]
visit_Keyword(node)[source]
visit_Statement(statement)[source]
generic_visit(node)

Called if no explicit visitor function exists for a node.

visit(node)

Visit a node.

class robot.tidypkg.transformers.SeparatorNormalizer(use_pipes, space_count)[source]

Bases: robot.parsing.model.visitor.ModelTransformer

Make separators and indentation consistent.

visit_TestCase(node)[source]
visit_Keyword(node)[source]
visit_ForLoop(node)[source]
visit_Statement(statement)[source]
generic_visit(node)

Called if no explicit visitor function exists for a node.

visit(node)

Visit a node.

class robot.tidypkg.transformers.ColumnAligner(short_test_name_length, widths)[source]

Bases: robot.parsing.model.visitor.ModelTransformer

visit_TestCase(node)[source]
visit_ForLoop(node)[source]
visit_Statement(statement)[source]
align_header(statement)[source]
align_statement(statement)[source]
widths_for_line(line)[source]
should_write_content_after_name(line_pos)[source]
generic_visit(node)

Called if no explicit visitor function exists for a node.

visit(node)

Visit a node.

class robot.tidypkg.transformers.ColumnWidthCounter[source]

Bases: robot.parsing.model.visitor.ModelTransformer

visit_Statement(statement)[source]
generic_visit(node)

Called if no explicit visitor function exists for a node.

visit(node)

Visit a node.

class robot.tidypkg.transformers.Aligner(short_test_name_length, setting_and_variable_name_length, pipes_mode)[source]

Bases: robot.parsing.model.visitor.ModelTransformer

visit_TestCaseSection(section)[source]
visit_KeywordSection(section)[source]
visit_Statement(statement)[source]
generic_visit(node)

Called if no explicit visitor function exists for a node.

visit(node)

Visit a node.