├── .codespellrc ├── .coveragerc ├── .github ├── CODEOWNERS └── workflows │ ├── code-spell.yml │ ├── python-publish.yml │ └── unit-tests.yml ├── .gitignore ├── .pre-commit-config.yaml ├── .pre-commit-hooks.yaml ├── .readthedocs.yml ├── CHANGES.md ├── CONTRIBUTING.md ├── LICENSE ├── MANIFEST.in ├── README.md ├── codecov.yml ├── docs ├── Makefile ├── _templates │ └── sidebar │ │ └── brand.html ├── make.bat ├── releasenotes │ ├── 2.0.md │ ├── 2.0a1.md │ ├── 2.0b1.md │ ├── 3.0.rst │ ├── 3.0b1.rst │ ├── 3.1.rst │ ├── 3.2.rst │ ├── 3.3.1.rst │ ├── 3.3.2.rst │ ├── 3.3.3.rst │ ├── 3.3.rst │ ├── 3.4.0.rst │ ├── 3.5.0.rst │ ├── 4.0.0.rst │ ├── 4.0.1.rst │ ├── 4.1.0.rst │ ├── 4.10.0.rst │ ├── 4.11.0.rst │ ├── 4.12.0.rst │ ├── 4.13.0.rst │ ├── 4.14.0.rst │ ├── 4.16.0.rst │ ├── 4.2.0.rst │ ├── 4.2.1.rst │ ├── 4.3.0.rst │ ├── 4.4.0.rst │ ├── 4.5.0.rst │ ├── 4.7.0.rst │ ├── 4.8.0.rst │ ├── 4.8.1.rst │ ├── 4.9.0.rst │ └── unreleased │ │ └── template.jinja └── source │ ├── _static │ ├── robotidy.ico │ ├── robotidy_logo.png │ ├── robotidy_logo_small.png │ └── robotidy_logo_small_dark.png │ ├── conf.py │ ├── configuration │ ├── config_file.rst │ ├── configuring_transformers.rst │ ├── disablers.rst │ ├── index.rst │ └── skip_formatting.rst │ ├── external_transformers.rst │ ├── index.rst │ ├── overview.rst │ ├── quickstart.rst │ └── transformers │ ├── AddMissingEnd.rst │ ├── AlignKeywordsSection.rst │ ├── AlignSettingsSection.rst │ ├── AlignTemplatedTestCases.rst │ ├── AlignTestCasesSection.rst │ ├── AlignVariablesSection.rst │ ├── DiscardEmptySections.rst │ ├── GenerateDocumentation.rst │ ├── IndentNestedKeywords.rst │ ├── InlineIf.rst │ ├── MergeAndOrderSections.rst │ ├── NormalizeAssignments.rst │ ├── NormalizeComments.rst │ ├── NormalizeNewLines.rst │ ├── NormalizeSectionHeaderName.rst │ ├── NormalizeSeparators.rst │ ├── NormalizeSettingName.rst │ ├── NormalizeTags.rst │ ├── OrderSettings.rst │ ├── OrderSettingsSection.rst │ ├── OrderTags.rst │ ├── RemoveEmptySettings.rst │ ├── RenameKeywords.rst │ ├── RenameTestCases.rst │ ├── RenameVariables.rst │ ├── ReplaceBreakContinue.rst │ ├── ReplaceEmptyValues.rst │ ├── ReplaceReturns.rst │ ├── ReplaceRunKeywordIf.rst │ ├── ReplaceWithVAR.rst │ ├── SmartSortKeywords.rst │ ├── SplitTooLongLine.rst │ ├── Translate.rst │ ├── disabled_hint.txt │ ├── enabled_hint.txt │ └── index.rst ├── noxfile.py ├── pyproject.toml ├── robotidy ├── __init__.py ├── __main__.py ├── api.py ├── app.py ├── cli.py ├── config.py ├── decorators.py ├── disablers.py ├── exceptions.py ├── files.py ├── rich_console.py ├── skip.py ├── transformers │ ├── AddMissingEnd.py │ ├── AlignKeywordsSection.py │ ├── AlignSettingsSection.py │ ├── AlignTemplatedTestCases.py │ ├── AlignTestCasesSection.py │ ├── AlignVariablesSection.py │ ├── DiscardEmptySections.py │ ├── GenerateDocumentation.py │ ├── IndentNestedKeywords.py │ ├── InlineIf.py │ ├── MergeAndOrderSections.py │ ├── NormalizeAssignments.py │ ├── NormalizeComments.py │ ├── NormalizeNewLines.py │ ├── NormalizeSectionHeaderName.py │ ├── NormalizeSeparators.py │ ├── NormalizeSettingName.py │ ├── NormalizeTags.py │ ├── OrderSettings.py │ ├── OrderSettingsSection.py │ ├── OrderTags.py │ ├── RemoveEmptySettings.py │ ├── RenameKeywords.py │ ├── RenameTestCases.py │ ├── RenameVariables.py │ ├── ReplaceBreakContinue.py │ ├── ReplaceEmptyValues.py │ ├── ReplaceReturns.py │ ├── ReplaceRunKeywordIf.py │ ├── ReplaceWithVAR.py │ ├── SmartSortKeywords.py │ ├── SplitTooLongLine.py │ ├── Translate.py │ ├── __init__.py │ ├── aligners_core.py │ └── run_keywords.py ├── utils │ ├── misc.py │ └── variable_matcher.py └── version.py ├── setup.py ├── tasks.py ├── tests ├── README.rst ├── __init__.py ├── atest │ ├── __init__.py │ ├── configuration_files │ │ ├── __init__.py │ │ └── multiple_configs │ │ │ ├── __init__.py │ │ │ ├── expected │ │ │ ├── root │ │ │ │ ├── a │ │ │ │ │ ├── .robotidy │ │ │ │ │ └── a_test.robot │ │ │ │ ├── b │ │ │ │ │ └── bb │ │ │ │ │ │ └── bb_test.robot │ │ │ │ ├── c │ │ │ │ │ ├── c_test.robot │ │ │ │ │ └── pyproject.toml │ │ │ │ └── pyproject.toml │ │ │ └── test.robot │ │ │ ├── expected_config_option │ │ │ ├── root │ │ │ │ ├── a │ │ │ │ │ ├── .robotidy │ │ │ │ │ └── a_test.robot │ │ │ │ ├── b │ │ │ │ │ └── bb │ │ │ │ │ │ └── bb_test.robot │ │ │ │ ├── c │ │ │ │ │ ├── c_test.robot │ │ │ │ │ └── pyproject.toml │ │ │ │ └── pyproject.toml │ │ │ └── test.robot │ │ │ ├── source │ │ │ ├── root │ │ │ │ ├── a │ │ │ │ │ ├── .robotidy │ │ │ │ │ └── a_test.robot │ │ │ │ ├── b │ │ │ │ │ └── bb │ │ │ │ │ │ └── bb_test.robot │ │ │ │ ├── c │ │ │ │ │ ├── c_test.robot │ │ │ │ │ └── pyproject.toml │ │ │ │ └── pyproject.toml │ │ │ └── test.robot │ │ │ └── test_multiple_configs.py │ └── transformers │ │ ├── AddMissingEnd │ │ ├── __init__.py │ │ ├── expected │ │ │ ├── test.robot │ │ │ ├── test_5.robot │ │ │ └── test_selected.robot │ │ ├── source │ │ │ ├── test.robot │ │ │ ├── test_5.robot │ │ │ └── test_5_disablers.robot │ │ └── test_transformer.py │ │ ├── AlignKeywordsSection │ │ ├── __init__.py │ │ ├── expected │ │ │ ├── align_settings_separately.robot │ │ │ ├── blocks.robot │ │ │ ├── blocks_auto.robot │ │ │ ├── blocks_auto_0.robot │ │ │ ├── blocks_rf5.robot │ │ │ ├── compact_overflow_last_0.robot │ │ │ ├── documentation_auto_align_first_col.robot │ │ │ ├── documentation_auto_skip.robot │ │ │ ├── documentation_fixed_align_first_col.robot │ │ │ ├── documentation_fixed_skip.robot │ │ │ ├── groups.robot │ │ │ ├── non_ascii_spaces.robot │ │ │ ├── one_column.robot │ │ │ ├── overflow_first_line.robot │ │ │ ├── settings.robot │ │ │ ├── simple_auto_ignore_line_0.robot │ │ │ ├── simple_auto_ignore_line_24_0_24.robot │ │ │ ├── simple_auto_ignore_line_24_24_24.robot │ │ │ ├── simple_auto_ignore_line_24_40_24.robot │ │ │ ├── simple_auto_ignore_line_4_4_4.robot │ │ │ ├── simple_auto_ignore_rest_0.robot │ │ │ ├── simple_auto_ignore_rest_24_0_24.robot │ │ │ ├── simple_auto_ignore_rest_24_24_24.robot │ │ │ ├── simple_auto_ignore_rest_24_40_24.robot │ │ │ ├── simple_auto_ignore_rest_4_4_4.robot │ │ │ ├── simple_auto_overflow_0.robot │ │ │ ├── simple_auto_overflow_24_0_24.robot │ │ │ ├── simple_auto_overflow_24_24_24.robot │ │ │ ├── simple_auto_overflow_24_40_24.robot │ │ │ ├── simple_auto_overflow_4_4_4.robot │ │ │ ├── simple_fixed_ignore_line_0.robot │ │ │ ├── simple_fixed_ignore_line_24_0_24.robot │ │ │ ├── simple_fixed_ignore_line_24_24_24.robot │ │ │ ├── simple_fixed_ignore_line_24_40_24.robot │ │ │ ├── simple_fixed_ignore_line_4_4_4.robot │ │ │ ├── simple_fixed_ignore_rest_0.robot │ │ │ ├── simple_fixed_ignore_rest_24_0_24.robot │ │ │ ├── simple_fixed_ignore_rest_24_24_24.robot │ │ │ ├── simple_fixed_ignore_rest_24_40_24.robot │ │ │ ├── simple_fixed_ignore_rest_4_4_4.robot │ │ │ ├── simple_fixed_overflow_0.robot │ │ │ ├── simple_fixed_overflow_24_0_24.robot │ │ │ ├── simple_fixed_overflow_24_24_24.robot │ │ │ ├── simple_fixed_overflow_24_40_24.robot │ │ │ ├── simple_fixed_overflow_4_4_4.robot │ │ │ ├── skip_keywords.robot │ │ │ ├── skip_return_values.robot │ │ │ ├── skip_settings.robot │ │ │ ├── too_long_line.robot │ │ │ ├── too_long_line_disablers.robot │ │ │ ├── too_long_token_counter_compact_overflow.robot │ │ │ ├── too_long_token_counter_ignore_line.robot │ │ │ ├── too_long_token_counter_ignore_rest.robot │ │ │ └── too_long_token_counter_overflow.robot │ │ ├── source │ │ │ ├── align_settings_separately.robot │ │ │ ├── blocks.robot │ │ │ ├── blocks_rf5.robot │ │ │ ├── compact_overflow_last_0.robot │ │ │ ├── documentation.robot │ │ │ ├── error_node.robot │ │ │ ├── groups.robot │ │ │ ├── non_ascii_spaces.robot │ │ │ ├── one_column.robot │ │ │ ├── overflow_first_line.robot │ │ │ ├── settings.robot │ │ │ ├── simple.robot │ │ │ ├── skip_keywords.robot │ │ │ ├── skip_return_values.robot │ │ │ ├── too_long_line.robot │ │ │ ├── too_long_line_disablers.robot │ │ │ └── too_long_token_counter.robot │ │ └── test_transformer.py │ │ ├── AlignSettingsSection │ │ ├── __init__.py │ │ ├── expected │ │ │ ├── all_columns.robot │ │ │ ├── all_columns_fixed.robot │ │ │ ├── argument_indents.robot │ │ │ ├── blank_line_and_whitespace.robot │ │ │ ├── blank_line_doc.robot │ │ │ ├── empty_lines.robot │ │ │ ├── multiline_keywords.robot │ │ │ ├── multiline_keywords_0indent.robot │ │ │ ├── multiline_keywords_20indent.robot │ │ │ ├── multiline_keywords_2indent.robot │ │ │ ├── multiline_keywords_all_col.robot │ │ │ ├── selected_part.robot │ │ │ ├── selected_whole.robot │ │ │ ├── test.robot │ │ │ ├── test_disablers.robot │ │ │ ├── test_fixed.robot │ │ │ ├── test_min_width.robot │ │ │ ├── test_min_width_50_width.robot │ │ │ ├── test_skip_documentation.robot │ │ │ └── three_columns.robot │ │ ├── source │ │ │ ├── argument_indents.robot │ │ │ ├── blank_line_and_whitespace.robot │ │ │ ├── blank_line_doc.robot │ │ │ ├── empty_lines.robot │ │ │ ├── multiline_keywords.robot │ │ │ ├── test.robot │ │ │ └── test_disablers.robot │ │ └── test_transformer.py │ │ ├── AlignTemplatedTestCases │ │ ├── __init__.py │ │ ├── expected │ │ │ ├── no_header_col.robot │ │ │ ├── partly_templated.robot │ │ │ ├── tags_settings.robot │ │ │ ├── templated_for_loops.robot │ │ │ ├── templated_for_loops_and_without.robot │ │ │ ├── templated_for_loops_and_without_fixed.robot │ │ │ ├── templated_for_loops_header_cols.robot │ │ │ ├── test.robot │ │ │ ├── test_fixed.robot │ │ │ └── with_settings.robot │ │ ├── source │ │ │ ├── disablers.robot │ │ │ ├── empty_line.robot │ │ │ ├── for_loops.robot │ │ │ ├── no_header_col.robot │ │ │ ├── partly_templated.robot │ │ │ ├── tags_settings.robot │ │ │ ├── templated_for_loops.robot │ │ │ ├── templated_for_loops_and_without.robot │ │ │ ├── templated_for_loops_header_cols.robot │ │ │ ├── test.robot │ │ │ └── with_settings.robot │ │ └── test_transformer.py │ │ ├── AlignTestCasesSection │ │ ├── __init__.py │ │ ├── expected │ │ │ ├── blocks.robot │ │ │ ├── blocks_auto.robot │ │ │ ├── blocks_auto_0.robot │ │ │ ├── blocks_rf5.robot │ │ │ ├── compact_overflow_bug.robot │ │ │ ├── compact_overflow_last_0.robot │ │ │ ├── documentation_auto_align_first_col.robot │ │ │ ├── documentation_auto_skip.robot │ │ │ ├── documentation_fixed_align_first_col.robot │ │ │ ├── documentation_fixed_skip.robot │ │ │ ├── dynamic_compact_overflow.robot │ │ │ ├── dynamic_compact_overflow_limit_1.robot │ │ │ ├── groups.robot │ │ │ ├── non_ascii_spaces.robot │ │ │ ├── one_column.robot │ │ │ ├── overflow_first_line.robot │ │ │ ├── settings.robot │ │ │ ├── settings_auto_separate_settings.robot │ │ │ ├── simple_auto_ignore_line_0.robot │ │ │ ├── simple_auto_ignore_line_24_0_24.robot │ │ │ ├── simple_auto_ignore_line_24_24_24.robot │ │ │ ├── simple_auto_ignore_line_24_40_24.robot │ │ │ ├── simple_auto_ignore_line_4_4_4.robot │ │ │ ├── simple_auto_ignore_rest_0.robot │ │ │ ├── simple_auto_ignore_rest_24_0_24.robot │ │ │ ├── simple_auto_ignore_rest_24_24_24.robot │ │ │ ├── simple_auto_ignore_rest_24_40_24.robot │ │ │ ├── simple_auto_ignore_rest_4_4_4.robot │ │ │ ├── simple_auto_overflow_0.robot │ │ │ ├── simple_auto_overflow_24_0_24.robot │ │ │ ├── simple_auto_overflow_24_24_24.robot │ │ │ ├── simple_auto_overflow_24_40_24.robot │ │ │ ├── simple_auto_overflow_4_4_4.robot │ │ │ ├── simple_fixed_ignore_line_0.robot │ │ │ ├── simple_fixed_ignore_line_24_0_24.robot │ │ │ ├── simple_fixed_ignore_line_24_24_24.robot │ │ │ ├── simple_fixed_ignore_line_24_40_24.robot │ │ │ ├── simple_fixed_ignore_line_4_4_4.robot │ │ │ ├── simple_fixed_ignore_rest_0.robot │ │ │ ├── simple_fixed_ignore_rest_24_0_24.robot │ │ │ ├── simple_fixed_ignore_rest_24_24_24.robot │ │ │ ├── simple_fixed_ignore_rest_24_40_24.robot │ │ │ ├── simple_fixed_ignore_rest_4_4_4.robot │ │ │ ├── simple_fixed_overflow_0.robot │ │ │ ├── simple_fixed_overflow_24_0_24.robot │ │ │ ├── simple_fixed_overflow_24_24_24.robot │ │ │ ├── simple_fixed_overflow_24_40_24.robot │ │ │ ├── simple_fixed_overflow_4_4_4.robot │ │ │ ├── skip_keywords.robot │ │ │ ├── skip_return_values_overflow.robot │ │ │ ├── templated_with_setting.robot │ │ │ ├── templated_with_settings_auto.robot │ │ │ ├── too_long_token_counter_compact_overflow.robot │ │ │ ├── too_long_token_counter_ignore_line.robot │ │ │ ├── too_long_token_counter_ignore_rest.robot │ │ │ └── too_long_token_counter_overflow.robot │ │ ├── source │ │ │ ├── blocks.robot │ │ │ ├── blocks_rf5.robot │ │ │ ├── compact_overflow_bug.robot │ │ │ ├── compact_overflow_last_0.robot │ │ │ ├── documentation.robot │ │ │ ├── dynamic_compact_overflow.robot │ │ │ ├── dynamic_compact_overflow_limit_1.robot │ │ │ ├── groups.robot │ │ │ ├── non_ascii_spaces.robot │ │ │ ├── one_column.robot │ │ │ ├── overflow_first_line.robot │ │ │ ├── settings.robot │ │ │ ├── simple.robot │ │ │ ├── skip_keywords.robot │ │ │ ├── skip_return_values_overflow.robot │ │ │ ├── templated.robot │ │ │ ├── templated_with_setting.robot │ │ │ └── too_long_token_counter.robot │ │ └── test_transformer.py │ │ ├── AlignVariablesSection │ │ ├── __init__.py │ │ ├── expected │ │ │ ├── align_selected_part.robot │ │ │ ├── align_selected_skip.robot │ │ │ ├── align_selected_whole.robot │ │ │ ├── all_columns.robot │ │ │ ├── all_columns_fixed.robot │ │ │ ├── long_comment.robot │ │ │ ├── multiline_skip.robot │ │ │ ├── multiline_with_blank.robot │ │ │ ├── optional_equal_sign.robot │ │ │ ├── single_var.robot │ │ │ ├── tests.robot │ │ │ ├── tests_2space_sep.robot │ │ │ ├── tests_disablers.robot │ │ │ ├── tests_fixed.robot │ │ │ ├── tests_fixed_one.robot │ │ │ ├── tests_min_width.robot │ │ │ ├── tests_min_width_50_width.robot │ │ │ ├── tests_skip.robot │ │ │ └── three_columns.robot │ │ ├── source │ │ │ ├── align_selected.robot │ │ │ ├── long_comment.robot │ │ │ ├── multiline_skip.robot │ │ │ ├── multiline_with_blank.robot │ │ │ ├── optional_equal_sign.robot │ │ │ ├── single_var.robot │ │ │ ├── tests.robot │ │ │ └── tests_disablers.robot │ │ └── test_transformer.py │ │ ├── DiscardEmptySections │ │ ├── __init__.py │ │ ├── expected │ │ │ ├── removes_empty_sections.robot │ │ │ ├── removes_empty_sections_except_comments.robot │ │ │ ├── removes_empty_sections_skip_variables.robot │ │ │ └── removes_selected_empty_section.robot │ │ ├── source │ │ │ ├── removes_empty_sections.robot │ │ │ └── removes_empty_sections_disablers.robot │ │ └── test_transformer.py │ │ ├── ExternalTransformer │ │ ├── ExternalDisabledTransformer.py │ │ ├── ExternalTransformer.py │ │ ├── ExternalTransformers │ │ │ ├── __init__.py │ │ │ └── custom_class.py │ │ ├── ExternalTransformersOrdered │ │ │ ├── __init__.py │ │ │ ├── custom_class.py │ │ │ └── custom_class2.py │ │ ├── __init__.py │ │ ├── expected │ │ │ ├── tests.robot │ │ │ ├── tests_lowercase.robot │ │ │ ├── tests_module_load.robot │ │ │ ├── tests_module_load_configure.robot │ │ │ ├── tests_module_transform.robot │ │ │ ├── tests_module_transform_configure.robot │ │ │ ├── tests_only_defaults.robot │ │ │ ├── tests_with_defaults.robot │ │ │ └── tests_with_defaults_lowercase.robot │ │ ├── source │ │ │ └── tests.robot │ │ └── test_transformer.py │ │ ├── GenerateDocumentation │ │ ├── __init__.py │ │ ├── expected │ │ │ ├── overwrite.robot │ │ │ ├── template_with_defaults.robot │ │ │ ├── test.robot │ │ │ └── test_rf4.robot │ │ ├── source │ │ │ ├── invalid_template.jinja │ │ │ ├── template_with_defaults.txt │ │ │ └── test.robot │ │ └── test_transformer.py │ │ ├── IndentNestedKeywords │ │ ├── __init__.py │ │ ├── expected │ │ │ ├── comments.robot │ │ │ ├── indent_and_2spaces_4cont_indent.robot │ │ │ ├── keep_in_line.robot │ │ │ ├── run_keyword.robot │ │ │ ├── settings.robot │ │ │ ├── split_and_indent.robot │ │ │ └── too_long_line.robot │ │ ├── source │ │ │ ├── comments.robot │ │ │ ├── run_keyword.robot │ │ │ ├── settings.robot │ │ │ └── too_long_line.robot │ │ └── test_transformer.py │ │ ├── InlineIf │ │ ├── __init__.py │ │ ├── expected │ │ │ ├── one_if_2spaces.robot │ │ │ ├── one_if_4spaces.robot │ │ │ ├── test.robot │ │ │ ├── test_disablers.robot │ │ │ └── test_skip_else.robot │ │ ├── source │ │ │ ├── invalid_if.robot │ │ │ ├── invalid_inline_if.robot │ │ │ ├── one_if.robot │ │ │ ├── test.robot │ │ │ └── test_disablers.robot │ │ └── test_transformer.py │ │ ├── MergeAndOrderSections │ │ ├── __init__.py │ │ ├── expected │ │ │ ├── both_test_and_task.robot │ │ │ ├── both_test_and_task_rf6.robot │ │ │ ├── disablers.robot │ │ │ ├── empty_section.robot │ │ │ ├── multiple_header_comments.robot │ │ │ ├── nested_block_for.robot │ │ │ ├── nested_blocks.robot │ │ │ ├── order_settings_comments_keywords_variables_testcases.robot │ │ │ ├── tests.robot │ │ │ ├── tests_without_comment_section.robot │ │ │ ├── too_few_calls_in_keyword.robot │ │ │ └── translated.robot │ │ ├── source │ │ │ ├── both_test_and_task.robot │ │ │ ├── disablers.robot │ │ │ ├── empty_section.robot │ │ │ ├── inline_if.robot │ │ │ ├── invalid.robot │ │ │ ├── multiple_header_comments.robot │ │ │ ├── nested_block_for.robot │ │ │ ├── nested_blocks.robot │ │ │ ├── order.robot │ │ │ ├── parsing_error.robot │ │ │ ├── tests.robot │ │ │ ├── too_few_calls_in_keyword.robot │ │ │ └── translated.robot │ │ └── test_merge_and_order_sections.py │ │ ├── NormalizeAssignments │ │ ├── __init__.py │ │ ├── expected │ │ │ ├── common_equal_sign.robot │ │ │ ├── common_equal_sign_variables.robot │ │ │ ├── common_remove.robot │ │ │ ├── common_remove_variables.robot │ │ │ ├── common_space_and_equal_sign.robot │ │ │ ├── common_space_and_equal_sign_variables.robot │ │ │ ├── equal_sign.robot │ │ │ ├── remove.robot │ │ │ └── space_and_equal_sign.robot │ │ ├── source │ │ │ ├── common_equal_sign.robot │ │ │ ├── common_remove.robot │ │ │ ├── common_space_and_equal_sign.robot │ │ │ ├── disablers.robot │ │ │ └── tests.robot │ │ └── test_transformer.py │ │ ├── NormalizeComments │ │ ├── __init__.py │ │ ├── expected │ │ │ └── test.robot │ │ ├── source │ │ │ └── test.robot │ │ └── test_transformer.py │ │ ├── NormalizeNewLines │ │ ├── __init__.py │ │ ├── expected │ │ │ ├── blocks.robot │ │ │ ├── consecutive_empty_lines_0line.robot │ │ │ ├── consecutive_empty_lines_1line.robot │ │ │ ├── consecutive_empty_lines_2line.robot │ │ │ ├── disablers_selected.robot │ │ │ ├── inline_if.robot │ │ │ ├── language_header_0empty.robot │ │ │ ├── language_header_2empty.robot │ │ │ ├── language_header_and_comments.robot │ │ │ ├── multiline.robot │ │ │ ├── templated_tests.robot │ │ │ ├── templated_tests_with_1_line.robot │ │ │ ├── test_case_last.robot │ │ │ ├── tests.robot │ │ │ ├── tests_three_lines_section.robot │ │ │ └── tests_two_lines_keywords.robot │ │ ├── source │ │ │ ├── blocks.robot │ │ │ ├── consecutive_empty_lines.robot │ │ │ ├── disablers.robot │ │ │ ├── disablers_selected.robot │ │ │ ├── inline_if_0_lines.robot │ │ │ ├── inline_if_1_lines.robot │ │ │ ├── inline_if_2_lines.robot │ │ │ ├── language_header_0empty.robot │ │ │ ├── language_header_2empty.robot │ │ │ ├── language_header_5empty.robot │ │ │ ├── language_header_and_comments.robot │ │ │ ├── multiline.robot │ │ │ ├── templated_tests.robot │ │ │ ├── test_case_last_0_lines.robot │ │ │ ├── test_case_last_1_lines.robot │ │ │ └── tests.robot │ │ └── test_normalize_new_lines.py │ │ ├── NormalizeSectionHeaderName │ │ ├── __init__.py │ │ ├── expected │ │ │ ├── selected.robot │ │ │ ├── task.robot │ │ │ ├── task2.robot │ │ │ ├── tests.robot │ │ │ ├── translated.robot │ │ │ └── uppercase.robot │ │ ├── source │ │ │ ├── disablers.robot │ │ │ ├── task.robot │ │ │ ├── task2.robot │ │ │ ├── tests.robot │ │ │ └── translated.robot │ │ └── test_normalize_section_header.py │ │ ├── NormalizeSeparators │ │ ├── __init__.py │ │ ├── expected │ │ │ ├── bug390.robot │ │ │ ├── comments_skip_block_comments.robot │ │ │ ├── comments_skip_comments.robot │ │ │ ├── cont_indent_align_new_line.robot │ │ │ ├── continuation_indent.robot │ │ │ ├── flatten.robot │ │ │ ├── flatten_rf4.robot │ │ │ ├── groups.robot │ │ │ ├── inline_if_2indent_2spaces.robot │ │ │ ├── inline_if_2indent_4spaces.robot │ │ │ ├── inline_if_4indent_2spaces.robot │ │ │ ├── inline_if_4indent_4spaces.robot │ │ │ ├── inline_if_flatten.robot │ │ │ ├── pipes.robot │ │ │ ├── rf5_syntax.robot │ │ │ ├── settings_variables_testcases.robot │ │ │ ├── skip_documentation.robot │ │ │ ├── skip_none.robot │ │ │ ├── test.robot │ │ │ ├── test_8spaces.robot │ │ │ ├── test_skip_keyword.robot │ │ │ └── testcases_keywords.robot │ │ ├── source │ │ │ ├── bug390.robot │ │ │ ├── comments.robot │ │ │ ├── continuation_indent.robot │ │ │ ├── disablers.robot │ │ │ ├── disablers2.robot │ │ │ ├── disablers3.robot │ │ │ ├── disablers4.robot │ │ │ ├── flatten.robot │ │ │ ├── groups.robot │ │ │ ├── inline_if.robot │ │ │ ├── pipes.robot │ │ │ ├── rf5_syntax.robot │ │ │ └── test.robot │ │ └── test_transformer.py │ │ ├── NormalizeSettingName │ │ ├── __init__.py │ │ ├── expected │ │ │ ├── rf6.robot │ │ │ ├── selected.robot │ │ │ ├── tests.robot │ │ │ └── translated.robot │ │ ├── source │ │ │ ├── disablers.robot │ │ │ ├── rf6.robot │ │ │ ├── tests.robot │ │ │ └── translated.robot │ │ └── test_normalize_setting_name.py │ │ ├── NormalizeTags │ │ ├── __init__.py │ │ ├── expected │ │ │ ├── duplicates.robot │ │ │ ├── lowercase.robot │ │ │ ├── preserve_format_default.robot │ │ │ ├── preserve_format_enabled.robot │ │ │ ├── spacing_2indent_2spaces.robot │ │ │ ├── spacing_2indent_4spaces.robot │ │ │ ├── spacing_4indent_2spaces.robot │ │ │ ├── spacing_4indent_4spaces.robot │ │ │ ├── titlecase.robot │ │ │ ├── uppercase.robot │ │ │ ├── variables_in_tags_lowercase.robot │ │ │ ├── variables_in_tags_titlecase.robot │ │ │ └── variables_in_tags_uppercase.robot │ │ ├── source │ │ │ ├── disablers.robot │ │ │ ├── disablers2.robot │ │ │ ├── disablers3.robot │ │ │ ├── disablers4.robot │ │ │ ├── duplicates.robot │ │ │ ├── preserve_format.robot │ │ │ ├── rf6.robot │ │ │ ├── spacing.robot │ │ │ ├── tests.robot │ │ │ └── variables_in_tags.robot │ │ └── test_transformer.py │ │ ├── OrderSettings │ │ ├── __init__.py │ │ ├── expected │ │ │ ├── custom_order_all_end.robot │ │ │ ├── custom_order_all_end_pre_rf7.robot │ │ │ ├── custom_order_default.robot │ │ │ ├── custom_order_default_pre_rf7.robot │ │ │ ├── custom_order_without_test_teardown.robot │ │ │ ├── custom_order_without_test_teardown_pre_rf7.robot │ │ │ ├── stick_comments.robot │ │ │ ├── test.robot │ │ │ ├── test_pre_rf7.robot │ │ │ └── translated.robot │ │ ├── source │ │ │ ├── disablers.robot │ │ │ ├── stick_comments.robot │ │ │ ├── test.robot │ │ │ └── translated.robot │ │ └── test_order_settings.py │ │ ├── OrderSettingsSection │ │ ├── __init__.py │ │ ├── expected │ │ │ ├── last_section.robot │ │ │ ├── missing_group.robot │ │ │ ├── parsing_error.robot │ │ │ ├── remote_library.robot │ │ │ ├── test.robot │ │ │ ├── test_0_newline.robot │ │ │ ├── test_2_newline.robot │ │ │ ├── test_empty_group_order.robot │ │ │ ├── test_group_order.robot │ │ │ ├── test_group_order_import_ordered.robot │ │ │ ├── test_missing_group_from_param.robot │ │ │ ├── test_resource_metadata_first.robot │ │ │ └── test_tags.robot │ │ ├── source │ │ │ ├── disablers.robot │ │ │ ├── just_comment.robot │ │ │ ├── last_section.robot │ │ │ ├── missing_group.robot │ │ │ ├── parsing_error.robot │ │ │ ├── remote_library.robot │ │ │ ├── test.robot │ │ │ └── test_tags.robot │ │ └── test_transformer.py │ │ ├── OrderTags │ │ ├── __init__.py │ │ ├── expected │ │ │ ├── case_insensitive.robot │ │ │ ├── case_insensitive_reverse.robot │ │ │ ├── case_sensitive.robot │ │ │ ├── case_sensitive_reverse.robot │ │ │ ├── default.robot │ │ │ ├── default_tags_false.robot │ │ │ ├── force_tags_false.robot │ │ │ └── test_tags.robot │ │ ├── source │ │ │ ├── disablers.robot │ │ │ ├── test_tags.robot │ │ │ └── tests.robot │ │ └── test_transformer.py │ │ ├── RemoveEmptySettings │ │ ├── __init__.py │ │ ├── expected │ │ │ ├── empty_always_more_explicit.robot │ │ │ ├── empty_always_no_explicit.robot │ │ │ ├── empty_overwritten_ok_more_explicit.robot │ │ │ ├── empty_overwritten_ok_no_explicit.robot │ │ │ ├── overwritten_always_more_explicit.robot │ │ │ ├── overwritten_always_no_explicit.robot │ │ │ ├── overwritten_overwritten_ok_more_explicit.robot │ │ │ └── overwritten_overwritten_ok_no_explicit.robot │ │ ├── source │ │ │ ├── disablers.robot │ │ │ ├── empty.robot │ │ │ └── overwritten.robot │ │ └── test_transformer.py │ │ ├── RenameKeywords │ │ ├── __init__.py │ │ ├── expected │ │ │ ├── bug537_538.robot │ │ │ ├── capitalize_first.robot │ │ │ ├── embedded_variables.robot │ │ │ ├── library_embedded_var_pattern.robot │ │ │ ├── no_title_case.robot │ │ │ ├── rename_pattern_partial.robot │ │ │ ├── rename_pattern_whole.robot │ │ │ ├── run_keywords.robot │ │ │ ├── test.robot │ │ │ ├── test_transform_library.robot │ │ │ ├── with_library_name.robot │ │ │ ├── with_library_name_transform.robot │ │ │ └── with_underscores.robot │ │ ├── source │ │ │ ├── bug537_538.robot │ │ │ ├── disablers.robot │ │ │ ├── embedded_variables.robot │ │ │ ├── library_embedded_var_pattern.robot │ │ │ ├── no_title_case.robot │ │ │ ├── run_keywords.robot │ │ │ ├── test.robot │ │ │ └── with_library_name.robot │ │ └── test_transformer.py │ │ ├── RenameTestCases │ │ ├── __init__.py │ │ ├── expected │ │ │ ├── replace_pattern_empty.robot │ │ │ ├── replace_pattern_placeholder.robot │ │ │ ├── replace_pattern_special_chars.robot │ │ │ ├── selected.robot │ │ │ ├── test.robot │ │ │ └── upper_case.robot │ │ ├── source │ │ │ ├── disablers.robot │ │ │ ├── empty_test_name.robot │ │ │ └── test.robot │ │ └── test_transformer.py │ │ ├── RenameVariables │ │ ├── __init__.py │ │ ├── expected │ │ │ ├── VAR_syntax.robot │ │ │ ├── configure_ignore_vars.robot │ │ │ ├── disablers.robot │ │ │ ├── equal_sign_in_section.robot │ │ │ ├── excluded_vars.robot │ │ │ ├── groups.robot │ │ │ ├── if_while_conditions.robot │ │ │ ├── inline_if.robot │ │ │ ├── math_operations.robot │ │ │ ├── return_and_set_global.robot │ │ │ ├── test.robot │ │ │ ├── test_ignore_camel_case.robot │ │ │ ├── test_ignore_settings_case.robot │ │ │ ├── test_ignore_unknown.robot │ │ │ ├── test_ignore_var_separator.robot │ │ │ ├── test_lower.robot │ │ │ ├── test_lower_with_nested.robot │ │ │ ├── test_separator_underscore.robot │ │ │ ├── test_template.robot │ │ │ └── try_except.robot │ │ ├── source │ │ │ ├── VAR_syntax.robot │ │ │ ├── disablers.robot │ │ │ ├── equal_sign_in_section.robot │ │ │ ├── excluded_vars.robot │ │ │ ├── groups.robot │ │ │ ├── if_while_conditions.robot │ │ │ ├── inline_if.robot │ │ │ ├── math_operations.robot │ │ │ ├── return_and_set_global.robot │ │ │ ├── test.robot │ │ │ ├── test_template.robot │ │ │ └── try_except.robot │ │ └── test_transformer.py │ │ ├── ReplaceBreakContinue │ │ ├── __init__.py │ │ ├── expected │ │ │ └── test.robot │ │ ├── source │ │ │ ├── disablers.robot │ │ │ ├── errors.robot │ │ │ └── test.robot │ │ └── test_transformer.py │ │ ├── ReplaceEmptyValues │ │ ├── __init__.py │ │ ├── expected │ │ │ └── test.robot │ │ ├── source │ │ │ └── test.robot │ │ └── test_transformer.py │ │ ├── ReplaceReturns │ │ ├── __init__.py │ │ ├── expected │ │ │ ├── return_from_keyword.robot │ │ │ ├── return_from_keyword_if.robot │ │ │ ├── return_from_keyword_if_selected.robot │ │ │ ├── test.robot │ │ │ └── test_selected.robot │ │ ├── source │ │ │ ├── errors.robot │ │ │ ├── replace_returns_disablers.robot │ │ │ ├── return_from_keyword.robot │ │ │ ├── return_from_keyword_if.robot │ │ │ ├── run_keyword_and_return.robot │ │ │ ├── run_keyword_and_return_if.robot │ │ │ └── test.robot │ │ └── test_transformer.py │ │ ├── ReplaceRunKeywordIf │ │ ├── __init__.py │ │ ├── expected │ │ │ ├── configure_whitespace.robot │ │ │ ├── invalid_data.robot │ │ │ ├── keyword_name_in_var.robot │ │ │ ├── set_variable_workaround.robot │ │ │ ├── tests.robot │ │ │ └── tests_selected.robot │ │ ├── source │ │ │ ├── configure_whitespace.robot │ │ │ ├── disablers.robot │ │ │ ├── golden.robot │ │ │ ├── invalid_data.robot │ │ │ ├── keyword_name_in_var.robot │ │ │ ├── set_variable_workaround.robot │ │ │ └── tests.robot │ │ └── test_transformer.py │ │ ├── ReplaceWithVAR │ │ ├── __init__.py │ │ ├── expected │ │ │ ├── explicit_local.robot │ │ │ ├── replace_catenate_false.robot │ │ │ ├── replace_create_dictionary_false.robot │ │ │ ├── replace_create_list_false.robot │ │ │ ├── replace_set_variable_if_false.robot │ │ │ ├── test.robot │ │ │ └── too_long.robot │ │ ├── source │ │ │ ├── invalid_inline_if.robot │ │ │ ├── test.robot │ │ │ └── too_long.robot │ │ └── test_transformer.py │ │ ├── SmartSortKeywords │ │ ├── __init__.py │ │ ├── expected │ │ │ ├── multiple_sections.robot │ │ │ ├── sort_.robot │ │ │ ├── sort_ci.robot │ │ │ ├── sort_ci_ilu.robot │ │ │ ├── sort_ci_ilu_iou.robot │ │ │ ├── sort_ci_iou.robot │ │ │ ├── sort_ilu.robot │ │ │ ├── sort_ilu_iou.robot │ │ │ └── sort_iou.robot │ │ ├── source │ │ │ ├── disablers.robot │ │ │ ├── empty_before_fist_keyword.robot │ │ │ ├── multiple_sections.robot │ │ │ └── sort_input.robot │ │ └── test_transformer.py │ │ ├── SplitTooLongLine │ │ ├── __init__.py │ │ ├── expected │ │ │ ├── VAR_syntax.robot │ │ │ ├── align_new_line.robot │ │ │ ├── align_new_line_all.robot │ │ │ ├── comments.robot │ │ │ ├── comments_skip_comments.robot │ │ │ ├── comments_split_scalar.robot │ │ │ ├── continuation_indent_feed.robot │ │ │ ├── continuation_indent_split.robot │ │ │ ├── feed_until_line_length.robot │ │ │ ├── feed_until_line_length_4.robot │ │ │ ├── multiple_assignments_on_every_arg.robot │ │ │ ├── multiple_assignments_on_every_arg_120.robot │ │ │ ├── multiple_assignments_until_line_length.robot │ │ │ ├── settings_on_every_arg.robot │ │ │ ├── settings_skip_tests.robot │ │ │ ├── settings_until_line_length.robot │ │ │ ├── settings_until_line_length_skip_comments.robot │ │ │ ├── skip_keywords.robot │ │ │ ├── split_on_every_arg.robot │ │ │ ├── split_on_every_arg_4.robot │ │ │ ├── variables_feed.robot │ │ │ ├── variables_split_on_every_value.robot │ │ │ └── variables_split_scalar.robot │ │ ├── source │ │ │ ├── VAR_syntax.robot │ │ │ ├── align_new_line.robot │ │ │ ├── comments.robot │ │ │ ├── continuation_indent.robot │ │ │ ├── disablers.robot │ │ │ ├── multiple_assignments.robot │ │ │ ├── settings.robot │ │ │ ├── tests.robot │ │ │ └── variables.robot │ │ └── test_transformer.py │ │ ├── Translate │ │ ├── __init__.py │ │ ├── expected │ │ │ ├── add_lang_header │ │ │ │ ├── comment_section.robot │ │ │ │ ├── diff_lang_header.robot │ │ │ │ ├── en_header.robot │ │ │ │ └── no_lang_header.robot │ │ │ ├── bdd │ │ │ │ ├── pl.robot │ │ │ │ ├── pl_alternative.robot │ │ │ │ └── uk.robot │ │ │ ├── de.robot │ │ │ ├── en.robot │ │ │ ├── en_with_pl_header.robot │ │ │ └── pl.robot │ │ ├── source │ │ │ ├── add_lang_header │ │ │ │ ├── comment_section.robot │ │ │ │ ├── diff_lang_header.robot │ │ │ │ ├── empty.robot │ │ │ │ ├── en_header.robot │ │ │ │ └── no_lang_header.robot │ │ │ ├── bdd │ │ │ │ └── en_and_pl.robot │ │ │ ├── en.robot │ │ │ ├── pl.robot │ │ │ ├── pl_and_de.robot │ │ │ └── pl_language_header.robot │ │ └── test_transformer.py │ │ └── __init__.py ├── conftest.py ├── e2e │ ├── test_data │ │ └── too_long_variable.robot │ └── test_transform_stability.py ├── pytest.ini ├── rf_versions_matrix │ ├── rf4 │ │ └── requirements.txt │ ├── rf5 │ │ └── requirements.txt │ ├── rf6 │ │ └── requirements.txt │ └── rf7 │ │ └── requirements.txt └── utest │ ├── __init__.py │ ├── test_api.py │ ├── test_cli.py │ ├── test_config.py │ ├── test_disablers.py │ ├── test_load_transformers.py │ ├── test_skip.py │ ├── test_utils.py │ ├── testdata │ ├── auto_line_sep │ │ ├── .gitattributes │ │ ├── cr.robot │ │ ├── crlf.robot │ │ ├── crlf_mixed.robot │ │ ├── empty.robot │ │ └── lf.robot │ ├── check │ │ ├── golden.robot │ │ └── not_golden.robot │ ├── config.txt │ ├── config │ │ └── robotidy.toml │ ├── config_with_custom_transformers │ │ ├── CustomTransformer.py │ │ ├── custom_transformers.toml │ │ └── load_transformers.toml │ ├── disablers │ │ ├── empty.robot │ │ ├── file_disabled.robot │ │ ├── file_disabled_and_enabled.robot │ │ ├── file_disabled_enabled_in_comments.robot │ │ ├── file_disabled_in_comments.robot │ │ ├── file_disabled_in_comments_no_header.robot │ │ ├── file_disabled_in_selected.robot │ │ ├── open_disabler_in_section.robot │ │ └── test.robot │ ├── empty_pyproject1 │ │ └── pyproject.toml │ ├── empty_pyproject2 │ │ └── pyproject.toml │ ├── gitignore │ │ ├── .gitignore │ │ ├── nested │ │ │ ├── test.robot │ │ │ └── test2.robot │ │ ├── test.resource │ │ ├── test.robot │ │ ├── test.txt │ │ └── test2.robot │ ├── invalid_options_config │ │ ├── pyproject_confgure.toml │ │ └── pyproject_idontexist.toml │ ├── invalid_pyproject │ │ └── pyproject.toml │ ├── line_sep │ │ ├── expected.robot │ │ └── test.robot │ ├── nested │ │ ├── nested │ │ │ └── deeper │ │ │ │ └── test.robot │ │ └── robotidy.toml │ ├── only_pyproject │ │ └── pyproject.toml │ ├── pyproject_with_src │ │ ├── pyproject.toml │ │ ├── resources │ │ │ └── test.robot │ │ ├── test.robot │ │ └── test3.robot │ ├── read_only │ │ └── test.robot │ └── with_git_dir │ │ ├── project_a │ │ └── test.robot │ │ └── pyproject.toml │ └── utils.py └── utils ├── new_transformer_templates ├── docs.template ├── test_transformer.template └── transformer.template └── release_docs_templates └── new_release.template /.codespellrc: -------------------------------------------------------------------------------- 1 | [codespell] 2 | ignore-words-list=confgure,indention,cript 3 | skip=translated.robot,de.robot,pl_and_de.robot 4 | -------------------------------------------------------------------------------- /.coveragerc: -------------------------------------------------------------------------------- 1 | [run] 2 | omit = *tests* 3 | source = robotidy 4 | [report] 5 | exclude_lines = 6 | pragma: no cover 7 | if __name__ == .__main__.: 8 | raise NotImplementedError 9 | fail_under = 90 -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @bhirsz @mnojek 2 | -------------------------------------------------------------------------------- /.github/workflows/code-spell.yml: -------------------------------------------------------------------------------- 1 | name: Codespell 2 | 3 | on: 4 | pull_request: 5 | branches: [ main ] 6 | 7 | jobs: 8 | test: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - name: Checkout 12 | uses: actions/checkout@v4 13 | - name: Codespell 14 | uses: codespell-project/actions-codespell@master 15 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | repos: 2 | - repo: https://github.com/pycqa/isort 3 | rev: 5.11.5 4 | hooks: 5 | - id: isort 6 | name: isort (python) 7 | 8 | - repo: https://github.com/psf/black 9 | rev: 22.3.0 10 | hooks: 11 | - id: black 12 | -------------------------------------------------------------------------------- /.pre-commit-hooks.yaml: -------------------------------------------------------------------------------- 1 | - id: robotidy 2 | name: robotidy 3 | entry: robotidy 4 | files: '.*\.(robot|resource)$' 5 | language: python 6 | description: "RobotFramework source code formatter" 7 | -------------------------------------------------------------------------------- /.readthedocs.yml: -------------------------------------------------------------------------------- 1 | --- 2 | version: 2 3 | 4 | sphinx: 5 | configuration: docs/source/conf.py 6 | 7 | build: 8 | os: ubuntu-22.04 9 | tools: 10 | python: "3.8" 11 | 12 | python: 13 | install: 14 | - method: pip 15 | path: .[doc] 16 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | recursive-include robotidy * -------------------------------------------------------------------------------- /codecov.yml: -------------------------------------------------------------------------------- 1 | coverage: 2 | status: 3 | project: 4 | default: 5 | target: 90% 6 | patch: 7 | default: 8 | target: 0% -------------------------------------------------------------------------------- /docs/releasenotes/4.0.1.rst: -------------------------------------------------------------------------------- 1 | Robotidy 4.0.1 2 | ================ 3 | 4 | Fix release for breaking changes in the Robotidy 4.0. The spaces in param:value in ``pyproject.toml`` should not 5 | raise unrecognized parameter error anymore. 6 | 7 | You can install the latest available version by running:: 8 | 9 | pip install --upgrade robotframework-tidy 10 | 11 | or to install exactly this version:: 12 | 13 | pip install robotframework-tidy==4.0.1 14 | 15 | -------------------------------------------------------------------------------- /docs/releasenotes/4.1.0.rst: -------------------------------------------------------------------------------- 1 | Robotidy 4.1.0 2 | ================ 3 | 4 | Added ``--ignore_git_dir`` option that allows to ignore ``.git`` directories when looking for Robotidy configuration file. 5 | 6 | You can install the latest available version by running:: 7 | 8 | pip install --upgrade robotframework-tidy 9 | 10 | or to install exactly this version:: 11 | 12 | pip install robotframework-tidy==4.1.0 13 | 14 | -------------------------------------------------------------------------------- /docs/releasenotes/4.16.0.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | ============== 4 | Robotidy 4.16.0 5 | ============== 6 | 7 | 8 | Update Robotidy rules with GROUP support from Robot Framework 7.2. 9 | 10 | Following transformers are updated & tested with GROUPs: 11 | 12 | - ``AlignKeywordsSection`` 13 | - ``AlignTestCasesSection`` 14 | - ``NormalizeSeparators`` 15 | - ``RenameVariables`` 16 | -------------------------------------------------------------------------------- /docs/releasenotes/4.2.1.rst: -------------------------------------------------------------------------------- 1 | Robotidy 4.2.1 2 | ================ 3 | 4 | Fix release for breaking changes in the Robotidy 4.2.0. 5 | 6 | You can install the latest available version by running:: 7 | 8 | pip install --upgrade robotframework-tidy 9 | 10 | or to install exactly this version:: 11 | 12 | pip install robotframework-tidy==4.2.1 13 | 14 | Robotidy now handles missing configuration file (#526) 15 | ------------------------------------------------------- 16 | 17 | It is now possible to run Robotidy without providing configuring file, which was crashing the tool before. 18 | -------------------------------------------------------------------------------- /docs/source/_static/robotidy.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarketSquare/robotframework-tidy/a4940bdc61b5afb8af1e0036d1658b2d0a550ab6/docs/source/_static/robotidy.ico -------------------------------------------------------------------------------- /docs/source/_static/robotidy_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarketSquare/robotframework-tidy/a4940bdc61b5afb8af1e0036d1658b2d0a550ab6/docs/source/_static/robotidy_logo.png -------------------------------------------------------------------------------- /docs/source/_static/robotidy_logo_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarketSquare/robotframework-tidy/a4940bdc61b5afb8af1e0036d1658b2d0a550ab6/docs/source/_static/robotidy_logo_small.png -------------------------------------------------------------------------------- /docs/source/_static/robotidy_logo_small_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarketSquare/robotframework-tidy/a4940bdc61b5afb8af1e0036d1658b2d0a550ab6/docs/source/_static/robotidy_logo_small_dark.png -------------------------------------------------------------------------------- /docs/source/index.rst: -------------------------------------------------------------------------------- 1 | Robotidy documentation 2 | ========================= 3 | 4 | .. toctree:: 5 | :maxdepth: 2 6 | :caption: Contents: 7 | 8 | .. include:: overview.rst 9 | 10 | .. toctree:: 11 | :maxdepth: 2 12 | :hidden: 13 | 14 | quickstart.rst 15 | transformers/index.rst 16 | configuration/index.rst 17 | external_transformers.rst 18 | -------------------------------------------------------------------------------- /docs/source/transformers/disabled_hint.txt: -------------------------------------------------------------------------------- 1 | .. dropdown:: Enabling the transformer 2 | 3 | |TRANSFORMERNAME| is not included in default transformers, that's why you need to call it with ``--transform`` explicitly: 4 | 5 | .. parsed-literal:: 6 | 7 | robotidy --transform |TRANSFORMERNAME| src 8 | 9 | Or configure ``enabled`` parameter: 10 | 11 | .. parsed-literal:: 12 | 13 | robotidy --configure |TRANSFORMERNAME|:enabled=True 14 | -------------------------------------------------------------------------------- /docs/source/transformers/enabled_hint.txt: -------------------------------------------------------------------------------- 1 | .. dropdown:: Transformer configuration 2 | 3 | |TRANSFORMERNAME| is included in the default transformers, but it can be also run separately with: 4 | 5 | .. parsed-literal:: 6 | 7 | robotidy --transform |TRANSFORMERNAME| src 8 | 9 | You can also disable |TRANSFORMERNAME|: 10 | 11 | .. parsed-literal:: 12 | 13 | robotidy --configure |TRANSFORMERNAME|:enabled=False src 14 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [tool.black] 2 | line-length = 120 3 | [tool.isort] 4 | profile = "black" 5 | line_length = 120 -------------------------------------------------------------------------------- /robotidy/__init__.py: -------------------------------------------------------------------------------- 1 | from robotidy.version import __version__ 2 | 3 | __all__ = ["__version__"] 4 | -------------------------------------------------------------------------------- /robotidy/__main__.py: -------------------------------------------------------------------------------- 1 | from robotidy.cli import cli 2 | 3 | if __name__ == "__main__": 4 | cli() 5 | -------------------------------------------------------------------------------- /robotidy/rich_console.py: -------------------------------------------------------------------------------- 1 | try: 2 | from rich.console import Console 3 | except ImportError: # Fails on vendored-in LSP plugin 4 | 5 | class Console: 6 | @staticmethod 7 | def print(msg, *args, **kwargs): 8 | print( 9 | "It looks line you have rich module uninstalled. " 10 | "Install it to be able to use robotidy in the cli mode." 11 | ) 12 | print(msg) 13 | 14 | 15 | console = Console() 16 | -------------------------------------------------------------------------------- /robotidy/version.py: -------------------------------------------------------------------------------- 1 | __version__ = "4.17.0" 2 | -------------------------------------------------------------------------------- /tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarketSquare/robotframework-tidy/a4940bdc61b5afb8af1e0036d1658b2d0a550ab6/tests/__init__.py -------------------------------------------------------------------------------- /tests/atest/configuration_files/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarketSquare/robotframework-tidy/a4940bdc61b5afb8af1e0036d1658b2d0a550ab6/tests/atest/configuration_files/__init__.py -------------------------------------------------------------------------------- /tests/atest/configuration_files/multiple_configs/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarketSquare/robotframework-tidy/a4940bdc61b5afb8af1e0036d1658b2d0a550ab6/tests/atest/configuration_files/multiple_configs/__init__.py -------------------------------------------------------------------------------- /tests/atest/configuration_files/multiple_configs/expected/root/a/.robotidy: -------------------------------------------------------------------------------- 1 | overwrite = false 2 | src = ["."] 3 | transform = [ 4 | "DiscardEmptySections" 5 | ] -------------------------------------------------------------------------------- /tests/atest/configuration_files/multiple_configs/expected/root/a/a_test.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | 3 | 4 | *** Variables *** 5 | ${var} 1 6 | 7 | 8 | *** Keywords *** 9 | Keyword 10 | Step argument 11 | -------------------------------------------------------------------------------- /tests/atest/configuration_files/multiple_configs/expected/root/b/bb/bb_test.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | 3 | 4 | *** Variables *** 5 | ${var} 1 6 | 7 | 8 | *** Keywords *** 9 | Keyword 10 | Step argument 11 | -------------------------------------------------------------------------------- /tests/atest/configuration_files/multiple_configs/expected/root/c/c_test.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | 3 | 4 | *** Variables *** 5 | ${var} 1 6 | 7 | 8 | *** Keywords *** 9 | Keyword 10 | Step argument 11 | -------------------------------------------------------------------------------- /tests/atest/configuration_files/multiple_configs/expected/root/c/pyproject.toml: -------------------------------------------------------------------------------- 1 | [tool.robotidy] 2 | spacecount = 2 3 | indent = 4 4 | transform = [ 5 | "NormalizeSeparators" 6 | ] 7 | configure = [ 8 | "RenameVariables: enabled = True" 9 | ] -------------------------------------------------------------------------------- /tests/atest/configuration_files/multiple_configs/expected/root/pyproject.toml: -------------------------------------------------------------------------------- 1 | [tool.robotidy] 2 | diff = false 3 | transform = [ 4 | "NormalizeSeparators" 5 | ] -------------------------------------------------------------------------------- /tests/atest/configuration_files/multiple_configs/expected/test.robot: -------------------------------------------------------------------------------- 1 | *** Variables *** 2 | ${var} 1 3 | 4 | 5 | *** Keywords *** 6 | Keyword 7 | Step argument 8 | -------------------------------------------------------------------------------- /tests/atest/configuration_files/multiple_configs/expected_config_option/root/a/.robotidy: -------------------------------------------------------------------------------- 1 | overwrite = false 2 | src = ["."] 3 | transform = [ 4 | "DiscardEmptySections" 5 | ] -------------------------------------------------------------------------------- /tests/atest/configuration_files/multiple_configs/expected_config_option/root/a/a_test.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | 3 | 4 | *** Variables *** 5 | ${var} 1 6 | 7 | 8 | *** Keywords *** 9 | Keyword 10 | Step argument 11 | -------------------------------------------------------------------------------- /tests/atest/configuration_files/multiple_configs/expected_config_option/root/b/bb/bb_test.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | 3 | 4 | *** Variables *** 5 | ${var} 1 6 | 7 | 8 | *** Keywords *** 9 | Keyword 10 | Step argument 11 | -------------------------------------------------------------------------------- /tests/atest/configuration_files/multiple_configs/expected_config_option/root/c/c_test.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | 3 | 4 | *** Variables *** 5 | ${var} 1 6 | 7 | 8 | *** Keywords *** 9 | Keyword 10 | Step argument 11 | -------------------------------------------------------------------------------- /tests/atest/configuration_files/multiple_configs/expected_config_option/root/c/pyproject.toml: -------------------------------------------------------------------------------- 1 | [tool.robotidy] 2 | spacecount = 2 3 | indent = 4 4 | transform = [ 5 | "NormalizeSeparators" 6 | ] 7 | configure = [ 8 | "RenameVariables: enabled = True" 9 | ] -------------------------------------------------------------------------------- /tests/atest/configuration_files/multiple_configs/expected_config_option/root/pyproject.toml: -------------------------------------------------------------------------------- 1 | [tool.robotidy] 2 | diff = false 3 | transform = [ 4 | "NormalizeSeparators" 5 | ] -------------------------------------------------------------------------------- /tests/atest/configuration_files/multiple_configs/expected_config_option/test.robot: -------------------------------------------------------------------------------- 1 | *** Variables *** 2 | ${var} 1 3 | 4 | 5 | *** Keywords *** 6 | Keyword 7 | Step argument 8 | -------------------------------------------------------------------------------- /tests/atest/configuration_files/multiple_configs/source/root/a/.robotidy: -------------------------------------------------------------------------------- 1 | overwrite = false 2 | src = ["."] 3 | transform = [ 4 | "DiscardEmptySections" 5 | ] -------------------------------------------------------------------------------- /tests/atest/configuration_files/multiple_configs/source/root/a/a_test.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | 3 | 4 | *** Variables *** 5 | ${var} 1 6 | 7 | 8 | *** Keywords *** 9 | Keyword 10 | Step argument 11 | -------------------------------------------------------------------------------- /tests/atest/configuration_files/multiple_configs/source/root/b/bb/bb_test.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | 3 | 4 | *** Variables *** 5 | ${var} 1 6 | 7 | 8 | *** Keywords *** 9 | Keyword 10 | Step argument 11 | -------------------------------------------------------------------------------- /tests/atest/configuration_files/multiple_configs/source/root/c/c_test.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | 3 | 4 | *** Variables *** 5 | ${var} 1 6 | 7 | 8 | *** Keywords *** 9 | Keyword 10 | Step argument 11 | -------------------------------------------------------------------------------- /tests/atest/configuration_files/multiple_configs/source/root/c/pyproject.toml: -------------------------------------------------------------------------------- 1 | [tool.robotidy] 2 | spacecount = 2 3 | indent = 4 4 | transform = [ 5 | "NormalizeSeparators" 6 | ] 7 | configure = [ 8 | "RenameVariables: enabled = True" 9 | ] -------------------------------------------------------------------------------- /tests/atest/configuration_files/multiple_configs/source/root/pyproject.toml: -------------------------------------------------------------------------------- 1 | [tool.robotidy] 2 | diff = false 3 | transform = [ 4 | "NormalizeSeparators" 5 | ] -------------------------------------------------------------------------------- /tests/atest/configuration_files/multiple_configs/source/test.robot: -------------------------------------------------------------------------------- 1 | *** Variables *** 2 | ${var} 1 3 | 4 | 5 | *** Keywords *** 6 | Keyword 7 | Step argument 8 | -------------------------------------------------------------------------------- /tests/atest/transformers/AddMissingEnd/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarketSquare/robotframework-tidy/a4940bdc61b5afb8af1e0036d1658b2d0a550ab6/tests/atest/transformers/AddMissingEnd/__init__.py -------------------------------------------------------------------------------- /tests/atest/transformers/AddMissingEnd/expected/test_5.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | Inline IF 3 | IF $cond Keyword 4 | IF $cond Keyword ELSE Keyword2 ${var} 5 | 6 | WHILE 7 | WHILE $cond 8 | Keyword 9 | # comment 10 | END 11 | Keyword 2 12 | 13 | TRY EXCEPT 14 | TRY 15 | Some Keyword 16 | EXCEPT Error message # Try matching this first. 17 | IF $cond Keyword 18 | END 19 | -------------------------------------------------------------------------------- /tests/atest/transformers/AddMissingEnd/source/test_5.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | Inline IF 3 | IF $cond Keyword 4 | IF $cond Keyword ELSE Keyword2 ${var} 5 | 6 | WHILE 7 | WHILE $cond 8 | Keyword 9 | # comment 10 | Keyword 2 11 | 12 | TRY EXCEPT 13 | TRY 14 | Some Keyword 15 | EXCEPT Error message # Try matching this first. 16 | IF $cond Keyword 17 | -------------------------------------------------------------------------------- /tests/atest/transformers/AddMissingEnd/source/test_5_disablers.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | Inline IF 3 | IF $cond Keyword 4 | IF $cond Keyword ELSE Keyword2 ${var} 5 | 6 | WHILE 7 | # robotidy: off 8 | WHILE $cond 9 | Keyword 10 | # comment 11 | Keyword 2 12 | # robotidy: on 13 | 14 | TRY EXCEPT 15 | # robotidy: off 16 | TRY 17 | Some Keyword 18 | EXCEPT Error message # Try matching this first. 19 | IF $cond Keyword 20 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignKeywordsSection/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarketSquare/robotframework-tidy/a4940bdc61b5afb8af1e0036d1658b2d0a550ab6/tests/atest/transformers/AlignKeywordsSection/__init__.py -------------------------------------------------------------------------------- /tests/atest/transformers/AlignKeywordsSection/expected/align_settings_separately.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | Keyword 3 | [Arguments] ${argument_name} 4 | [Tags] tag tag 5 | Log ${argument_name} 6 | Perform Action And Wait ${argument_name} 7 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignKeywordsSection/expected/compact_overflow_last_0.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | Keyword 3 | Longer Than Limit ${arg} 4 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignKeywordsSection/expected/settings.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | Keyword With Settings 3 | [Documentation] Docs should be left alone 4 | ... even misaligned. 5 | [Arguments] ${args} ${args} # comment 6 | [Teardown] Keyword 7 | [Timeout] 1min 8 | Short 9 | Keyword Arg ${arg} 10 | FOR ${var} IN RANGE 10 11 | Keyword Arg ${arg} 12 | Other Keyword ${arg} 13 | END 14 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignKeywordsSection/expected/simple_auto_ignore_line_0.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | Keyword 3 | ${assign} Looooooooonger Keyword Name ${argument} 4 | Short Short Short 5 | Single 6 | Multi ${arg} 7 | ... ${arg} 8 | 9 | Second Keyword 10 | Looooooooonger Keyword Name 11 | 12 | With Comments 13 | Single # comment 1 14 | With Arg # comment 2 comment 3 15 | Multi ${arg} # comment 4 16 | ... ${arg} # comment 5 17 | Three Args argument argument 18 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignKeywordsSection/expected/simple_auto_ignore_line_24_0_24.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | Keyword 3 | ${assign} Looooooooonger Keyword Name ${argument} 4 | Short Short Short 5 | Single 6 | Multi ${arg} 7 | ... ${arg} 8 | 9 | Second Keyword 10 | Looooooooonger Keyword Name 11 | 12 | With Comments 13 | Single # comment 1 14 | With Arg # comment 2 comment 3 15 | Multi ${arg} # comment 4 16 | ... ${arg} # comment 5 17 | Three Args argument argument 18 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignKeywordsSection/expected/simple_auto_ignore_line_24_24_24.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | Keyword 3 | ${assign} Looooooooonger Keyword Name ${argument} 4 | Short Short Short 5 | Single 6 | Multi ${arg} 7 | ... ${arg} 8 | 9 | Second Keyword 10 | Looooooooonger Keyword Name 11 | 12 | With Comments 13 | Single # comment 1 14 | With Arg # comment 2 comment 3 15 | Multi ${arg} # comment 4 16 | ... ${arg} # comment 5 17 | Three Args argument argument 18 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignKeywordsSection/expected/simple_auto_ignore_line_24_40_24.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | Keyword 3 | ${assign} Looooooooonger Keyword Name ${argument} 4 | Short Short Short 5 | Single 6 | Multi ${arg} 7 | ... ${arg} 8 | 9 | Second Keyword 10 | Looooooooonger Keyword Name 11 | 12 | With Comments 13 | Single # comment 1 14 | With Arg # comment 2 comment 3 15 | Multi ${arg} # comment 4 16 | ... ${arg} # comment 5 17 | Three Args argument argument 18 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignKeywordsSection/expected/simple_auto_ignore_line_4_4_4.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | Keyword 3 | ${assign} Looooooooonger Keyword Name ${argument} 4 | Short Short Short 5 | Single 6 | Multi ${arg} 7 | ... ${arg} 8 | 9 | Second Keyword 10 | Looooooooonger Keyword Name 11 | 12 | With Comments 13 | Single # comment 1 14 | With Arg # comment 2 comment 3 15 | Multi ${arg} # comment 4 16 | ... ${arg} # comment 5 17 | Three Args argument argument 18 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignKeywordsSection/expected/simple_auto_ignore_rest_0.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | Keyword 3 | ${assign} Looooooooonger Keyword Name ${argument} 4 | Short Short Short 5 | Single 6 | Multi ${arg} 7 | ... ${arg} 8 | 9 | Second Keyword 10 | Looooooooonger Keyword Name 11 | 12 | With Comments 13 | Single # comment 1 14 | With Arg # comment 2 comment 3 15 | Multi ${arg} # comment 4 16 | ... ${arg} # comment 5 17 | Three Args argument argument 18 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignKeywordsSection/expected/simple_auto_ignore_rest_24_0_24.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | Keyword 3 | ${assign} Looooooooonger Keyword Name ${argument} 4 | Short Short Short 5 | Single 6 | Multi ${arg} 7 | ... ${arg} 8 | 9 | Second Keyword 10 | Looooooooonger Keyword Name 11 | 12 | With Comments 13 | Single # comment 1 14 | With Arg # comment 2 comment 3 15 | Multi ${arg} # comment 4 16 | ... ${arg} # comment 5 17 | Three Args argument argument 18 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignKeywordsSection/expected/simple_auto_ignore_rest_24_24_24.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | Keyword 3 | ${assign} Looooooooonger Keyword Name ${argument} 4 | Short Short Short 5 | Single 6 | Multi ${arg} 7 | ... ${arg} 8 | 9 | Second Keyword 10 | Looooooooonger Keyword Name 11 | 12 | With Comments 13 | Single # comment 1 14 | With Arg # comment 2 comment 3 15 | Multi ${arg} # comment 4 16 | ... ${arg} # comment 5 17 | Three Args argument argument 18 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignKeywordsSection/expected/simple_auto_ignore_rest_24_40_24.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | Keyword 3 | ${assign} Looooooooonger Keyword Name ${argument} 4 | Short Short Short 5 | Single 6 | Multi ${arg} 7 | ... ${arg} 8 | 9 | Second Keyword 10 | Looooooooonger Keyword Name 11 | 12 | With Comments 13 | Single # comment 1 14 | With Arg # comment 2 comment 3 15 | Multi ${arg} # comment 4 16 | ... ${arg} # comment 5 17 | Three Args argument argument 18 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignKeywordsSection/expected/simple_auto_ignore_rest_4_4_4.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | Keyword 3 | ${assign} Looooooooonger Keyword Name ${argument} 4 | Short Short Short 5 | Single 6 | Multi ${arg} 7 | ... ${arg} 8 | 9 | Second Keyword 10 | Looooooooonger Keyword Name 11 | 12 | With Comments 13 | Single # comment 1 14 | With Arg # comment 2 comment 3 15 | Multi ${arg} # comment 4 16 | ... ${arg} # comment 5 17 | Three Args argument argument 18 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignKeywordsSection/expected/simple_auto_overflow_0.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | Keyword 3 | ${assign} Looooooooonger Keyword Name ${argument} 4 | Short Short Short 5 | Single 6 | Multi ${arg} 7 | ... ${arg} 8 | 9 | Second Keyword 10 | Looooooooonger Keyword Name 11 | 12 | With Comments 13 | Single # comment 1 14 | With Arg # comment 2 comment 3 15 | Multi ${arg} # comment 4 16 | ... ${arg} # comment 5 17 | Three Args argument argument 18 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignKeywordsSection/expected/simple_auto_overflow_24_0_24.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | Keyword 3 | ${assign} Looooooooonger Keyword Name ${argument} 4 | Short Short Short 5 | Single 6 | Multi ${arg} 7 | ... ${arg} 8 | 9 | Second Keyword 10 | Looooooooonger Keyword Name 11 | 12 | With Comments 13 | Single # comment 1 14 | With Arg # comment 2 comment 3 15 | Multi ${arg} # comment 4 16 | ... ${arg} # comment 5 17 | Three Args argument argument 18 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignKeywordsSection/expected/simple_auto_overflow_24_24_24.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | Keyword 3 | ${assign} Looooooooonger Keyword Name ${argument} 4 | Short Short Short 5 | Single 6 | Multi ${arg} 7 | ... ${arg} 8 | 9 | Second Keyword 10 | Looooooooonger Keyword Name 11 | 12 | With Comments 13 | Single # comment 1 14 | With Arg # comment 2 comment 3 15 | Multi ${arg} # comment 4 16 | ... ${arg} # comment 5 17 | Three Args argument argument 18 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignKeywordsSection/expected/simple_auto_overflow_24_40_24.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | Keyword 3 | ${assign} Looooooooonger Keyword Name ${argument} 4 | Short Short Short 5 | Single 6 | Multi ${arg} 7 | ... ${arg} 8 | 9 | Second Keyword 10 | Looooooooonger Keyword Name 11 | 12 | With Comments 13 | Single # comment 1 14 | With Arg # comment 2 comment 3 15 | Multi ${arg} # comment 4 16 | ... ${arg} # comment 5 17 | Three Args argument argument 18 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignKeywordsSection/expected/simple_auto_overflow_4_4_4.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | Keyword 3 | ${assign} Looooooooonger Keyword Name ${argument} 4 | Short Short Short 5 | Single 6 | Multi ${arg} 7 | ... ${arg} 8 | 9 | Second Keyword 10 | Looooooooonger Keyword Name 11 | 12 | With Comments 13 | Single # comment 1 14 | With Arg # comment 2 comment 3 15 | Multi ${arg} # comment 4 16 | ... ${arg} # comment 5 17 | Three Args argument argument 18 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignKeywordsSection/expected/simple_fixed_ignore_line_0.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | Keyword 3 | ${assign} Looooooooonger Keyword Name ${argument} 4 | Short Short Short 5 | Single 6 | Multi ${arg} 7 | ... ${arg} 8 | 9 | Second Keyword 10 | Looooooooonger Keyword Name 11 | 12 | With Comments 13 | Single # comment 1 14 | With Arg # comment 2 comment 3 15 | Multi ${arg} # comment 4 16 | ... ${arg} # comment 5 17 | Three Args argument argument 18 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignKeywordsSection/expected/simple_fixed_ignore_line_4_4_4.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | Keyword 3 | ${assign} Looooooooonger Keyword Name ${argument} 4 | Short Short Short 5 | Single 6 | Multi ${arg} 7 | ... ${arg} 8 | 9 | Second Keyword 10 | Looooooooonger Keyword Name 11 | 12 | With Comments 13 | Single # comment 1 14 | With Arg # comment 2 comment 3 15 | Multi ${arg} # comment 4 16 | ... ${arg} # comment 5 17 | Three Args argument argument 18 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignKeywordsSection/expected/simple_fixed_ignore_rest_0.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | Keyword 3 | ${assign} Looooooooonger Keyword Name ${argument} 4 | Short Short Short 5 | Single 6 | Multi ${arg} 7 | ... ${arg} 8 | 9 | Second Keyword 10 | Looooooooonger Keyword Name 11 | 12 | With Comments 13 | Single # comment 1 14 | With Arg # comment 2 comment 3 15 | Multi ${arg} # comment 4 16 | ... ${arg} # comment 5 17 | Three Args argument argument 18 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignKeywordsSection/expected/simple_fixed_ignore_rest_4_4_4.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | Keyword 3 | ${assign} Looooooooonger Keyword Name ${argument} 4 | Short Short Short 5 | Single 6 | Multi ${arg} 7 | ... ${arg} 8 | 9 | Second Keyword 10 | Looooooooonger Keyword Name 11 | 12 | With Comments 13 | Single # comment 1 14 | With Arg # comment 2 comment 3 15 | Multi ${arg} # comment 4 16 | ... ${arg} # comment 5 17 | Three Args argument argument 18 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignKeywordsSection/expected/simple_fixed_overflow_0.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | Keyword 3 | ${assign} Looooooooonger Keyword Name ${argument} 4 | Short Short Short 5 | Single 6 | Multi ${arg} 7 | ... ${arg} 8 | 9 | Second Keyword 10 | Looooooooonger Keyword Name 11 | 12 | With Comments 13 | Single # comment 1 14 | With Arg # comment 2 comment 3 15 | Multi ${arg} # comment 4 16 | ... ${arg} # comment 5 17 | Three Args argument argument 18 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignKeywordsSection/expected/simple_fixed_overflow_4_4_4.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | Keyword 3 | ${assign} Looooooooonger Keyword Name ${argument} 4 | Short Short Short 5 | Single 6 | Multi ${arg} 7 | ... ${arg} 8 | 9 | Second Keyword 10 | Looooooooonger Keyword Name 11 | 12 | With Comments 13 | Single # comment 1 14 | With Arg # comment 2 comment 3 15 | Multi ${arg} # comment 4 16 | ... ${arg} # comment 5 17 | Three Args argument argument 18 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignKeywordsSection/expected/skip_settings.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | Keyword With Settings 3 | [Documentation] Docs should be left alone 4 | ... even misaligned. 5 | [Arguments] ${args} ${args} # comment 6 | [Teardown] Keyword 7 | [Timeout] 1min 8 | Short 9 | Keyword Arg ${arg} 10 | FOR ${var} IN RANGE 10 11 | Keyword Arg ${arg} 12 | Other Keyword ${arg} 13 | END 14 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignKeywordsSection/expected/too_long_token_counter_compact_overflow.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | Second Column Should Not Be Counted 3 | I am too long to be counted Do not count me 4 | Short Short Short 5 | Longer 6 | ... ${arg} ${arg} 7 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignKeywordsSection/expected/too_long_token_counter_ignore_line.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | Second Column Should Not Be Counted 3 | I am too long to be counted Do not count me 4 | Short Short Short 5 | Longer 6 | ... ${arg} ${arg} 7 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignKeywordsSection/expected/too_long_token_counter_ignore_rest.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | Second Column Should Not Be Counted 3 | I am too long to be counted Do not count me 4 | Short Short Short 5 | Longer 6 | ... ${arg} ${arg} 7 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignKeywordsSection/expected/too_long_token_counter_overflow.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | Second Column Should Not Be Counted 3 | I am too long to be counted Do not count me 4 | Short Short Short 5 | Longer 6 | ... ${arg} ${arg} 7 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignKeywordsSection/source/align_settings_separately.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | Keyword 3 | [Arguments] ${argument_name} 4 | [Tags] tag tag 5 | Log ${argument_name} 6 | Perform Action And Wait ${argument_name} 7 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignKeywordsSection/source/blocks_rf5.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | Inline IF 3 | IF ${condition} Keyword ${arg} 4 | ${assign} IF $flag Other Keyword ${argument} ELSE Set Variable ${None} 5 | 6 | TRY 7 | TRY 8 | ${variable} Keyword ${var} 9 | EXCEPT Error 10 | ${variable} Keyword ${var} 11 | ELSE 12 | ${variable} Keyword ${var} 13 | FINALLY 14 | ${variable} Keyword ${var} 15 | END 16 | 17 | While 18 | WHILE ${condition} 19 | ${variable} Keyword ${var} 20 | END 21 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignKeywordsSection/source/compact_overflow_last_0.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | Keyword 3 | Longer Than Limit ${arg} 4 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignKeywordsSection/source/error_node.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | Missing keyword call 3 | WHILE $condition 4 | ${var} 5 | END 6 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignKeywordsSection/source/settings.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | Keyword With Settings 3 | [Documentation] Docs should be left alone 4 | ... even misaligned. 5 | [Arguments] ${args} ${args} # comment 6 | [Teardown] Keyword 7 | [Timeout] 1min 8 | Short 9 | Keyword Arg ${arg} 10 | FOR ${var} IN RANGE 10 11 | Keyword Arg ${arg} 12 | Other Keyword ${arg} 13 | END 14 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignKeywordsSection/source/simple.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | Keyword 3 | ${assign} Looooooooonger Keyword Name ${argument} 4 | Short Short Short 5 | Single 6 | Multi ${arg} 7 | ... ${arg} 8 | 9 | Second Keyword 10 | Looooooooonger Keyword Name 11 | 12 | With Comments 13 | Single # comment 1 14 | With Arg # comment 2 comment 3 15 | Multi ${arg} # comment 4 16 | ... ${arg} # comment 5 17 | Three Args argument argument 18 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignKeywordsSection/source/too_long_token_counter.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | Second Column Should Not Be Counted 3 | I am too long to be counted Do not count me 4 | Short Short Short 5 | Longer 6 | ... ${arg} ${arg} 7 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignSettingsSection/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarketSquare/robotframework-tidy/a4940bdc61b5afb8af1e0036d1658b2d0a550ab6/tests/atest/transformers/AlignSettingsSection/__init__.py -------------------------------------------------------------------------------- /tests/atest/transformers/AlignSettingsSection/expected/blank_line_and_whitespace.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation Documentation with extra 3 | ... 4 | ... spaces 5 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignSettingsSection/expected/blank_line_doc.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation Description of what the file does 3 | ... 4 | ... Copyright 2021 by company I am paid by 5 | Test Template test 6 | Force Tags tag 7 | ... 8 | ... tag2 9 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignSettingsSection/expected/empty_lines.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation This is 3 | ... multiline line 4 | ... docs 5 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignSettingsSection/expected/multiline_keywords.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation this 3 | ... is documentation for comparison longer longer 4 | 5 | Force Tags tag tag2 6 | 7 | Suite Setup Start Session 8 | ... host=${IPADDRESS} 9 | ... user=${USERNAME} 10 | ... password=${PASSWORD} 11 | Suite Teardown Close Session 12 | 13 | Test Setup Two Arguments One Line 14 | ... ${arg} ${arg2} 15 | ... ${arg3} 16 | ... ${arg4} ${arg5} 17 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignSettingsSection/source/blank_line_and_whitespace.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation Documentation with extra 3 | ... 4 | ... spaces 5 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignSettingsSection/source/blank_line_doc.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation Description of what the file does 3 | ... 4 | ... Copyright 2021 by company I am paid by 5 | Test Template test 6 | Force Tags tag 7 | ... 8 | ... tag2 9 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignSettingsSection/source/empty_lines.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation This is 3 | ... multiline line 4 | 5 | ... docs 6 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignSettingsSection/source/multiline_keywords.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation this 3 | ... is documentation for comparison longer longer 4 | 5 | Force Tags tag tag2 6 | 7 | Suite Setup Start Session 8 | ... host=${IPADDRESS} 9 | ... user=${USERNAME} 10 | ... password=${PASSWORD} 11 | Suite Teardown Close Session 12 | 13 | Test Setup Two Arguments One Line 14 | ... ${arg} ${arg2} 15 | ... ${arg3} 16 | ... ${arg4} ${arg5} 17 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignTemplatedTestCases/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarketSquare/robotframework-tidy/a4940bdc61b5afb8af1e0036d1658b2d0a550ab6/tests/atest/transformers/AlignTemplatedTestCases/__init__.py -------------------------------------------------------------------------------- /tests/atest/transformers/AlignTemplatedTestCases/expected/no_header_col.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Test Template bar 3 | 4 | *** Test Cases *** 5 | # some comment 6 | test1 hi hello 7 | test2 long test name asdfasdf asdsdfgsdfg 8 | bar1 bar2 9 | # some comment 10 | 11 | *** Keywords *** 12 | bar 13 | [Arguments] ${baz} ${qux} 14 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignTemplatedTestCases/expected/templated_for_loops.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Test Template Dummy 3 | 4 | *** Test Cases *** 5 | Template with for loop 6 | FOR ${item} IN @{ITEMS} 7 | ${item} 2nd arg 8 | END 9 | FOR ${index} IN RANGE 42 10 | 1st arg ${index} 11 | END 12 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignTemplatedTestCases/expected/templated_for_loops_and_without.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Test Template Dummy 3 | 4 | *** Test Cases *** 5 | Template with for loop 6 | FOR ${item} IN @{ITEMS} 7 | ${item} 2nd arg 8 | END 9 | FOR ${index} IN RANGE 42 10 | 1st arg ${index} 11 | END 12 | test ${arg} 13 | 14 | # some comment 15 | test1 hi hello 16 | test2 long test name asdfasdf asdsdfgsdfg -------------------------------------------------------------------------------- /tests/atest/transformers/AlignTemplatedTestCases/expected/templated_for_loops_header_cols.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Test Template Dummy 3 | 4 | *** Test Cases *** foo bar 5 | Template with for loop 6 | FOR ${item} IN @{ITEMS} 7 | ${item} 2nd arg 8 | END 9 | FOR ${index} IN RANGE 42 10 | 1st arg ${index} 11 | END 12 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignTemplatedTestCases/expected/test.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Test Template bar 3 | 4 | *** Test Cases *** baz qux 5 | # some comment 6 | test1 hi hello 7 | test2 long test name asdfasdf asdsdfgsdfg 8 | bar1 bar2 9 | # some comment 10 | 11 | *** Keywords *** 12 | bar 13 | [Arguments] ${baz} ${qux} 14 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignTemplatedTestCases/expected/test_fixed.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Test Template bar 3 | 4 | *** Test Cases *** baz qux 5 | # some comment 6 | test1 hi hello 7 | test2 long test name asdfasdf asdsdfgsdfg 8 | bar1 bar2 9 | # some comment 10 | 11 | *** Keywords *** 12 | bar 13 | [Arguments] ${baz} ${qux} 14 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignTemplatedTestCases/expected/with_settings.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Test Template Dummy 3 | 4 | *** Test Cases *** 5 | Test1 ARG1 6 | [Tags] sanity 7 | [Documentation] Validate Test1 8 | Test2 ARG2 9 | [Tags] smoke 10 | [Documentation] Validate Test2 11 | Test3 ARG3 12 | [Tags] valid 13 | [Documentation] Validate Test3 14 | Test4 ARG4 15 | [Tags] sanity 16 | [Documentation] Validate Test4 -------------------------------------------------------------------------------- /tests/atest/transformers/AlignTemplatedTestCases/source/disablers.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Test Template bar 3 | 4 | *** Test Cases *** 5 | # some comment 6 | test1 hi hello # robotidy: off 7 | # robotidy: off 8 | test2 long test name asdfasdf asdsdfgsdfg 9 | bar1 bar2 10 | # some comment 11 | 12 | *** Keywords *** 13 | bar 14 | [Arguments] ${baz} ${qux} 15 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignTemplatedTestCases/source/empty_line.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Test Template bar 3 | 4 | *** Test Cases *** baz qux 5 | test1 6 | hi hello 7 | test2 long test name 8 | asdfasdf asdsdfgsdfg 9 | 10 | *** Keywords *** 11 | bar 12 | [Arguments] ${baz} ${qux} -------------------------------------------------------------------------------- /tests/atest/transformers/AlignTemplatedTestCases/source/no_header_col.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Test Template bar 3 | 4 | *** Test Cases *** 5 | # some comment 6 | test1 hi hello 7 | test2 long test name asdfasdf asdsdfgsdfg 8 | bar1 bar2 9 | # some comment 10 | 11 | *** Keywords *** 12 | bar 13 | [Arguments] ${baz} ${qux} 14 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignTemplatedTestCases/source/templated_for_loops.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Test Template Dummy 3 | 4 | *** Test Cases *** 5 | Template with for loop 6 | FOR ${item} IN @{ITEMS} 7 | ${item} 2nd arg 8 | END 9 | FOR ${index} IN RANGE 42 10 | 1st arg ${index} 11 | END 12 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignTemplatedTestCases/source/templated_for_loops_and_without.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Test Template Dummy 3 | 4 | *** Test Cases *** 5 | Template with for loop 6 | FOR ${item} IN @{ITEMS} 7 | ${item} 2nd arg 8 | END 9 | FOR ${index} IN RANGE 42 10 | 1st arg ${index} 11 | END 12 | test ${arg} 13 | 14 | # some comment 15 | test1 hi hello 16 | test2 long test name asdfasdf asdsdfgsdfg -------------------------------------------------------------------------------- /tests/atest/transformers/AlignTemplatedTestCases/source/templated_for_loops_header_cols.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Test Template Dummy 3 | 4 | *** Test Cases *** foo bar 5 | Template with for loop 6 | FOR ${item} IN @{ITEMS} 7 | ${item} 2nd arg 8 | END 9 | FOR ${index} IN RANGE 42 10 | 1st arg ${index} 11 | END 12 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignTemplatedTestCases/source/test.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Test Template bar 3 | 4 | *** Test Cases *** baz qux 5 | # some comment 6 | test1 hi hello 7 | test2 long test name asdfasdf asdsdfgsdfg 8 | bar1 bar2 9 | # some comment 10 | 11 | *** Keywords *** 12 | bar 13 | [Arguments] ${baz} ${qux} 14 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignTemplatedTestCases/source/with_settings.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Test Template Dummy 3 | 4 | *** Test Cases *** 5 | Test1 ARG1 6 | [Tags] sanity 7 | [Documentation] Validate Test1 8 | Test2 ARG2 9 | [Tags] smoke 10 | [Documentation] Validate Test2 11 | Test3 ARG3 12 | [Tags] valid 13 | [Documentation] Validate Test3 14 | Test4 ARG4 15 | [Tags] sanity 16 | [Documentation] Validate Test4 -------------------------------------------------------------------------------- /tests/atest/transformers/AlignTestCasesSection/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarketSquare/robotframework-tidy/a4940bdc61b5afb8af1e0036d1658b2d0a550ab6/tests/atest/transformers/AlignTestCasesSection/__init__.py -------------------------------------------------------------------------------- /tests/atest/transformers/AlignTestCasesSection/expected/compact_overflow_bug.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | Test 3 | VaHa_ValmiitTapahtumatTarkista_Osto ${NIMIKE} Ostotilaus ${OSTOTILAUS} ${MAARA} ${ALIVARASTO} varastopaika=${EMPTY} tilauspvm=${TILAUSPVM} 4 | 5 | Test2 6 | Lava_VastaanottotapahtumatTarkista ${VASTAANOTTO} ${TILAUS_OCC} ${OSTOTILAUS} ${LAHETYS} ${TILAUSPVM} ${NIMIKE} ${NIMIKEKUVAUS} 7 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignTestCasesSection/expected/compact_overflow_last_0.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | Keyword 3 | Longer Than Limit ${arg} 4 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignTestCasesSection/expected/settings.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | Keyword With Settings 3 | [Documentation] Docs should be left alone 4 | ... even misaligned. 5 | [Tags] 1234 1234 # comment 6 | [Teardown] Keyword 7 | [Timeout] 1min 8 | Short 9 | Keyword Arg ${arg} 10 | FOR ${var} IN RANGE 10 11 | Keyword Arg ${arg} 12 | Other Keyword ${arg} 13 | END 14 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignTestCasesSection/expected/settings_auto_separate_settings.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | Keyword With Settings 3 | [Documentation] Docs should be left alone 4 | ... even misaligned. 5 | [Tags] 1234 1234 # comment 6 | [Teardown] Keyword 7 | [Timeout] 1min 8 | Short 9 | Keyword Arg ${arg} 10 | FOR ${var} IN RANGE 10 11 | Keyword Arg ${arg} 12 | Other Keyword ${arg} 13 | END 14 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignTestCasesSection/expected/simple_auto_ignore_line_0.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | Keyword 3 | ${assign} Looooooooonger Keyword Name ${argument} 4 | Short Short Short 5 | Single 6 | Multi ${arg} 7 | ... ${arg} 8 | 9 | Second Keyword 10 | Looooooooonger Keyword Name 11 | 12 | With Comments 13 | Single # comment 1 14 | With Arg # comment 2 comment 3 15 | Multi ${arg} # comment 4 16 | ... ${arg} # comment 5 17 | Three Args argument argument 18 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignTestCasesSection/expected/simple_auto_ignore_line_24_0_24.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | Keyword 3 | ${assign} Looooooooonger Keyword Name ${argument} 4 | Short Short Short 5 | Single 6 | Multi ${arg} 7 | ... ${arg} 8 | 9 | Second Keyword 10 | Looooooooonger Keyword Name 11 | 12 | With Comments 13 | Single # comment 1 14 | With Arg # comment 2 comment 3 15 | Multi ${arg} # comment 4 16 | ... ${arg} # comment 5 17 | Three Args argument argument 18 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignTestCasesSection/expected/simple_auto_ignore_line_24_24_24.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | Keyword 3 | ${assign} Looooooooonger Keyword Name ${argument} 4 | Short Short Short 5 | Single 6 | Multi ${arg} 7 | ... ${arg} 8 | 9 | Second Keyword 10 | Looooooooonger Keyword Name 11 | 12 | With Comments 13 | Single # comment 1 14 | With Arg # comment 2 comment 3 15 | Multi ${arg} # comment 4 16 | ... ${arg} # comment 5 17 | Three Args argument argument 18 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignTestCasesSection/expected/simple_auto_ignore_line_24_40_24.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | Keyword 3 | ${assign} Looooooooonger Keyword Name ${argument} 4 | Short Short Short 5 | Single 6 | Multi ${arg} 7 | ... ${arg} 8 | 9 | Second Keyword 10 | Looooooooonger Keyword Name 11 | 12 | With Comments 13 | Single # comment 1 14 | With Arg # comment 2 comment 3 15 | Multi ${arg} # comment 4 16 | ... ${arg} # comment 5 17 | Three Args argument argument 18 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignTestCasesSection/expected/simple_auto_ignore_line_4_4_4.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | Keyword 3 | ${assign} Looooooooonger Keyword Name ${argument} 4 | Short Short Short 5 | Single 6 | Multi ${arg} 7 | ... ${arg} 8 | 9 | Second Keyword 10 | Looooooooonger Keyword Name 11 | 12 | With Comments 13 | Single # comment 1 14 | With Arg # comment 2 comment 3 15 | Multi ${arg} # comment 4 16 | ... ${arg} # comment 5 17 | Three Args argument argument 18 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignTestCasesSection/expected/simple_auto_ignore_rest_0.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | Keyword 3 | ${assign} Looooooooonger Keyword Name ${argument} 4 | Short Short Short 5 | Single 6 | Multi ${arg} 7 | ... ${arg} 8 | 9 | Second Keyword 10 | Looooooooonger Keyword Name 11 | 12 | With Comments 13 | Single # comment 1 14 | With Arg # comment 2 comment 3 15 | Multi ${arg} # comment 4 16 | ... ${arg} # comment 5 17 | Three Args argument argument 18 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignTestCasesSection/expected/simple_auto_ignore_rest_24_0_24.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | Keyword 3 | ${assign} Looooooooonger Keyword Name ${argument} 4 | Short Short Short 5 | Single 6 | Multi ${arg} 7 | ... ${arg} 8 | 9 | Second Keyword 10 | Looooooooonger Keyword Name 11 | 12 | With Comments 13 | Single # comment 1 14 | With Arg # comment 2 comment 3 15 | Multi ${arg} # comment 4 16 | ... ${arg} # comment 5 17 | Three Args argument argument 18 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignTestCasesSection/expected/simple_auto_ignore_rest_24_24_24.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | Keyword 3 | ${assign} Looooooooonger Keyword Name ${argument} 4 | Short Short Short 5 | Single 6 | Multi ${arg} 7 | ... ${arg} 8 | 9 | Second Keyword 10 | Looooooooonger Keyword Name 11 | 12 | With Comments 13 | Single # comment 1 14 | With Arg # comment 2 comment 3 15 | Multi ${arg} # comment 4 16 | ... ${arg} # comment 5 17 | Three Args argument argument 18 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignTestCasesSection/expected/simple_auto_ignore_rest_24_40_24.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | Keyword 3 | ${assign} Looooooooonger Keyword Name ${argument} 4 | Short Short Short 5 | Single 6 | Multi ${arg} 7 | ... ${arg} 8 | 9 | Second Keyword 10 | Looooooooonger Keyword Name 11 | 12 | With Comments 13 | Single # comment 1 14 | With Arg # comment 2 comment 3 15 | Multi ${arg} # comment 4 16 | ... ${arg} # comment 5 17 | Three Args argument argument 18 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignTestCasesSection/expected/simple_auto_ignore_rest_4_4_4.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | Keyword 3 | ${assign} Looooooooonger Keyword Name ${argument} 4 | Short Short Short 5 | Single 6 | Multi ${arg} 7 | ... ${arg} 8 | 9 | Second Keyword 10 | Looooooooonger Keyword Name 11 | 12 | With Comments 13 | Single # comment 1 14 | With Arg # comment 2 comment 3 15 | Multi ${arg} # comment 4 16 | ... ${arg} # comment 5 17 | Three Args argument argument 18 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignTestCasesSection/expected/simple_auto_overflow_0.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | Keyword 3 | ${assign} Looooooooonger Keyword Name ${argument} 4 | Short Short Short 5 | Single 6 | Multi ${arg} 7 | ... ${arg} 8 | 9 | Second Keyword 10 | Looooooooonger Keyword Name 11 | 12 | With Comments 13 | Single # comment 1 14 | With Arg # comment 2 comment 3 15 | Multi ${arg} # comment 4 16 | ... ${arg} # comment 5 17 | Three Args argument argument 18 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignTestCasesSection/expected/simple_auto_overflow_24_0_24.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | Keyword 3 | ${assign} Looooooooonger Keyword Name ${argument} 4 | Short Short Short 5 | Single 6 | Multi ${arg} 7 | ... ${arg} 8 | 9 | Second Keyword 10 | Looooooooonger Keyword Name 11 | 12 | With Comments 13 | Single # comment 1 14 | With Arg # comment 2 comment 3 15 | Multi ${arg} # comment 4 16 | ... ${arg} # comment 5 17 | Three Args argument argument 18 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignTestCasesSection/expected/simple_auto_overflow_24_24_24.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | Keyword 3 | ${assign} Looooooooonger Keyword Name ${argument} 4 | Short Short Short 5 | Single 6 | Multi ${arg} 7 | ... ${arg} 8 | 9 | Second Keyword 10 | Looooooooonger Keyword Name 11 | 12 | With Comments 13 | Single # comment 1 14 | With Arg # comment 2 comment 3 15 | Multi ${arg} # comment 4 16 | ... ${arg} # comment 5 17 | Three Args argument argument 18 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignTestCasesSection/expected/simple_auto_overflow_24_40_24.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | Keyword 3 | ${assign} Looooooooonger Keyword Name ${argument} 4 | Short Short Short 5 | Single 6 | Multi ${arg} 7 | ... ${arg} 8 | 9 | Second Keyword 10 | Looooooooonger Keyword Name 11 | 12 | With Comments 13 | Single # comment 1 14 | With Arg # comment 2 comment 3 15 | Multi ${arg} # comment 4 16 | ... ${arg} # comment 5 17 | Three Args argument argument 18 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignTestCasesSection/expected/simple_auto_overflow_4_4_4.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | Keyword 3 | ${assign} Looooooooonger Keyword Name ${argument} 4 | Short Short Short 5 | Single 6 | Multi ${arg} 7 | ... ${arg} 8 | 9 | Second Keyword 10 | Looooooooonger Keyword Name 11 | 12 | With Comments 13 | Single # comment 1 14 | With Arg # comment 2 comment 3 15 | Multi ${arg} # comment 4 16 | ... ${arg} # comment 5 17 | Three Args argument argument 18 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignTestCasesSection/expected/simple_fixed_ignore_line_0.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | Keyword 3 | ${assign} Looooooooonger Keyword Name ${argument} 4 | Short Short Short 5 | Single 6 | Multi ${arg} 7 | ... ${arg} 8 | 9 | Second Keyword 10 | Looooooooonger Keyword Name 11 | 12 | With Comments 13 | Single # comment 1 14 | With Arg # comment 2 comment 3 15 | Multi ${arg} # comment 4 16 | ... ${arg} # comment 5 17 | Three Args argument argument 18 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignTestCasesSection/expected/simple_fixed_ignore_line_4_4_4.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | Keyword 3 | ${assign} Looooooooonger Keyword Name ${argument} 4 | Short Short Short 5 | Single 6 | Multi ${arg} 7 | ... ${arg} 8 | 9 | Second Keyword 10 | Looooooooonger Keyword Name 11 | 12 | With Comments 13 | Single # comment 1 14 | With Arg # comment 2 comment 3 15 | Multi ${arg} # comment 4 16 | ... ${arg} # comment 5 17 | Three Args argument argument 18 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignTestCasesSection/expected/simple_fixed_ignore_rest_0.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | Keyword 3 | ${assign} Looooooooonger Keyword Name ${argument} 4 | Short Short Short 5 | Single 6 | Multi ${arg} 7 | ... ${arg} 8 | 9 | Second Keyword 10 | Looooooooonger Keyword Name 11 | 12 | With Comments 13 | Single # comment 1 14 | With Arg # comment 2 comment 3 15 | Multi ${arg} # comment 4 16 | ... ${arg} # comment 5 17 | Three Args argument argument 18 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignTestCasesSection/expected/simple_fixed_ignore_rest_4_4_4.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | Keyword 3 | ${assign} Looooooooonger Keyword Name ${argument} 4 | Short Short Short 5 | Single 6 | Multi ${arg} 7 | ... ${arg} 8 | 9 | Second Keyword 10 | Looooooooonger Keyword Name 11 | 12 | With Comments 13 | Single # comment 1 14 | With Arg # comment 2 comment 3 15 | Multi ${arg} # comment 4 16 | ... ${arg} # comment 5 17 | Three Args argument argument 18 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignTestCasesSection/expected/simple_fixed_overflow_0.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | Keyword 3 | ${assign} Looooooooonger Keyword Name ${argument} 4 | Short Short Short 5 | Single 6 | Multi ${arg} 7 | ... ${arg} 8 | 9 | Second Keyword 10 | Looooooooonger Keyword Name 11 | 12 | With Comments 13 | Single # comment 1 14 | With Arg # comment 2 comment 3 15 | Multi ${arg} # comment 4 16 | ... ${arg} # comment 5 17 | Three Args argument argument 18 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignTestCasesSection/expected/simple_fixed_overflow_4_4_4.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | Keyword 3 | ${assign} Looooooooonger Keyword Name ${argument} 4 | Short Short Short 5 | Single 6 | Multi ${arg} 7 | ... ${arg} 8 | 9 | Second Keyword 10 | Looooooooonger Keyword Name 11 | 12 | With Comments 13 | Single # comment 1 14 | With Arg # comment 2 comment 3 15 | Multi ${arg} # comment 4 16 | ... ${arg} # comment 5 17 | Three Args argument argument 18 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignTestCasesSection/expected/too_long_token_counter_compact_overflow.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | Second Column Should Not Be Counted 3 | I am too long to be counted Do not count me 4 | Short Short Short 5 | Longer 6 | ... ${arg} ${arg} 7 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignTestCasesSection/expected/too_long_token_counter_ignore_line.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | Second Column Should Not Be Counted 3 | I am too long to be counted Do not count me 4 | Short Short Short 5 | Longer 6 | ... ${arg} ${arg} 7 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignTestCasesSection/expected/too_long_token_counter_ignore_rest.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | Second Column Should Not Be Counted 3 | I am too long to be counted Do not count me 4 | Short Short Short 5 | Longer 6 | ... ${arg} ${arg} 7 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignTestCasesSection/expected/too_long_token_counter_overflow.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | Second Column Should Not Be Counted 3 | I am too long to be counted Do not count me 4 | Short Short Short 5 | Longer 6 | ... ${arg} ${arg} 7 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignTestCasesSection/source/blocks_rf5.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | Inline IF 3 | IF ${condition} Keyword ${arg} 4 | ${assign} IF $flag Other Keyword ${argument} ELSE Set Variable ${None} 5 | 6 | TRY 7 | TRY 8 | ${variable} Keyword ${var} 9 | EXCEPT Error 10 | ${variable} Keyword ${var} 11 | ELSE 12 | ${variable} Keyword ${var} 13 | FINALLY 14 | ${variable} Keyword ${var} 15 | END 16 | 17 | While 18 | WHILE ${condition} 19 | ${variable} Keyword ${var} 20 | END 21 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignTestCasesSection/source/compact_overflow_bug.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | Test 3 | VaHa_ValmiitTapahtumatTarkista_Osto ${NIMIKE} Ostotilaus ${OSTOTILAUS} ${MAARA} ${ALIVARASTO} varastopaika=${EMPTY} tilauspvm=${TILAUSPVM} 4 | 5 | Test2 6 | Lava_VastaanottotapahtumatTarkista ${VASTAANOTTO} ${TILAUS_OCC} ${OSTOTILAUS} ${LAHETYS} ${TILAUSPVM} ${NIMIKE} ${NIMIKEKUVAUS} 7 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignTestCasesSection/source/compact_overflow_last_0.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | Keyword 3 | Longer Than Limit ${arg} 4 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignTestCasesSection/source/settings.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | Keyword With Settings 3 | [Documentation] Docs should be left alone 4 | ... even misaligned. 5 | [Tags] 1234 1234 # comment 6 | [Teardown] Keyword 7 | [Timeout] 1min 8 | Short 9 | Keyword Arg ${arg} 10 | FOR ${var} IN RANGE 10 11 | Keyword Arg ${arg} 12 | Other Keyword ${arg} 13 | END 14 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignTestCasesSection/source/simple.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | Keyword 3 | ${assign} Looooooooonger Keyword Name ${argument} 4 | Short Short Short 5 | Single 6 | Multi ${arg} 7 | ... ${arg} 8 | 9 | Second Keyword 10 | Looooooooonger Keyword Name 11 | 12 | With Comments 13 | Single # comment 1 14 | With Arg # comment 2 comment 3 15 | Multi ${arg} # comment 4 16 | ... ${arg} # comment 5 17 | Three Args argument argument 18 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignTestCasesSection/source/templated.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Test Template bar 3 | 4 | *** Test Cases *** baz qux 5 | # some comment 6 | test1 hi hello 7 | test2 long test name asdfasdf asdsdfgsdfg 8 | bar1 bar2 9 | # some comment 10 | 11 | *** Keywords *** 12 | bar 13 | [Arguments] ${baz} ${qux} 14 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignTestCasesSection/source/too_long_token_counter.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | Second Column Should Not Be Counted 3 | I am too long to be counted Do not count me 4 | Short Short Short 5 | Longer 6 | ... ${arg} ${arg} 7 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignVariablesSection/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarketSquare/robotframework-tidy/a4940bdc61b5afb8af1e0036d1658b2d0a550ab6/tests/atest/transformers/AlignVariablesSection/__init__.py -------------------------------------------------------------------------------- /tests/atest/transformers/AlignVariablesSection/expected/align_selected_part.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation This is doc 3 | 4 | 5 | *** Variables *** 6 | # some comment 7 | 8 | ${VARIABLE 1} 10 # comment 9 | @{LIST} a b c d 10 | ${LONGER_NAME_THAT_GOES_AND_GOES} longer value that goes and goes 11 | 12 | &{MULTILINE} a=b 13 | ... b=c 14 | ... d=1 15 | ${invalid} 16 | ${invalid_more} 17 | 18 | *** Keywords *** 19 | Keyword 20 | Keyword Call 21 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignVariablesSection/expected/align_selected_skip.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation This is doc 3 | 4 | 5 | *** Variables *** 6 | # some comment 7 | 8 | ${VARIABLE 1} 10 # comment 9 | @{LIST} a b c d 10 | ${LONGER_NAME_THAT_GOES_AND_GOES} longer value that goes and goes 11 | 12 | &{MULTILINE} a=b 13 | ... b=c 14 | ... d=1 15 | ${invalid} 16 | ${invalid_more} 17 | 18 | *** Keywords *** 19 | Keyword 20 | Keyword Call 21 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignVariablesSection/expected/align_selected_whole.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation This is doc 3 | 4 | 5 | *** Variables *** 6 | # some comment 7 | 8 | ${VARIABLE 1} 10 # comment 9 | @{LIST} a b c d 10 | ${LONGER_NAME_THAT_GOES_AND_GOES} longer value that goes and goes 11 | 12 | &{MULTILINE} a=b 13 | ... b=c 14 | ... d=1 15 | ${invalid} 16 | ${invalid_more} 17 | 18 | *** Keywords *** 19 | Keyword 20 | Keyword Call 21 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignVariablesSection/expected/all_columns_fixed.robot: -------------------------------------------------------------------------------- 1 | *** Variables *** 2 | # some comment 3 | 4 | ${VARIABLE 1} 10 # comment 5 | @{LIST} a b c d 6 | ${LONGER_NAME_THAT_GOES_AND_GOES} longer value that goes and goes 7 | 8 | &{MULTILINE} a=b 9 | ... b=c 10 | ... d=1 11 | ${invalid} 12 | ${invalid_more} 13 | 14 | # should be left aligned 15 | # should be left aligned 16 | ${variable} 1 -------------------------------------------------------------------------------- /tests/atest/transformers/AlignVariablesSection/expected/long_comment.robot: -------------------------------------------------------------------------------- 1 | *** Variables *** 2 | # some comment that is longer than usual and can go and go and ends here 3 | 4 | ${VARIABLE 1} 10 # comment 5 | @{LIST} a b c d 6 | ${LONGER_NAME_THAT_GOES_AND_GOES} longer value that goes and goes 7 | 8 | &{MULTILINE} a=b 9 | ... b=c 10 | ... d=1 11 | ${invalid} 12 | ${invalid_more} -------------------------------------------------------------------------------- /tests/atest/transformers/AlignVariablesSection/expected/multiline_skip.robot: -------------------------------------------------------------------------------- 1 | *** Variables *** 2 | ${VARIABLE 1} 10 # comment 3 | @{LIST} a 4 | ... b 5 | ... c 6 | ... d 7 | ${LONGER_NAME_THAT_GOES_AND_GOES} longer value that goes and goes 8 | &{SOME_DICT} key=value key2=value 9 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignVariablesSection/expected/multiline_with_blank.robot: -------------------------------------------------------------------------------- 1 | *** Variables *** 2 | ${VARIABLE} 1 3 | ... 2 4 | ... 5 | ... 3 6 | ${OTHER_AND_LONGER} a 7 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignVariablesSection/expected/optional_equal_sign.robot: -------------------------------------------------------------------------------- 1 | *** Variables *** 2 | # some comment 3 | 4 | ${VARIABLE 1}= 10 # comment 5 | @{LIST} a b c d 6 | ${LONGER_NAME_THAT_GOES_AND_GOES} = longer value that goes and goes 7 | 8 | &{MULTILINE} a=b 9 | ... b=c 10 | ... d=1 11 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignVariablesSection/expected/single_var.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation Test 3 | 4 | *** Variables *** 5 | ${VAR_NAME_25_CHARACTERS} Test 6 | 7 | *** Test Cases *** 8 | Test1 9 | ${test_col_21_chars}= Set Variable Test 10 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignVariablesSection/expected/tests.robot: -------------------------------------------------------------------------------- 1 | *** Variables *** 2 | # some comment 3 | 4 | ${VARIABLE 1} 10 # comment 5 | @{LIST} a b c d 6 | ${LONGER_NAME_THAT_GOES_AND_GOES} longer value that goes and goes 7 | 8 | &{MULTILINE} a=b 9 | ... b=c 10 | ... d=1 11 | ${invalid} 12 | ${invalid_more} 13 | 14 | # should be left aligned 15 | # should be left aligned 16 | ${variable} 1 -------------------------------------------------------------------------------- /tests/atest/transformers/AlignVariablesSection/expected/tests_2space_sep.robot: -------------------------------------------------------------------------------- 1 | *** Variables *** 2 | # some comment 3 | 4 | ${VARIABLE 1} 10 # comment 5 | @{LIST} a b c d 6 | ${LONGER_NAME_THAT_GOES_AND_GOES} longer value that goes and goes 7 | 8 | &{MULTILINE} a=b 9 | ... b=c 10 | ... d=1 11 | ${invalid} 12 | ${invalid_more} 13 | 14 | # should be left aligned 15 | # should be left aligned 16 | ${variable} 1 -------------------------------------------------------------------------------- /tests/atest/transformers/AlignVariablesSection/expected/tests_disablers.robot: -------------------------------------------------------------------------------- 1 | *** Variables *** 2 | # some comment 3 | 4 | ${VARIABLE 1} 10 # comment 5 | @{LIST} a b c d # robotidy: off 6 | ${LONGER_NAME_THAT_GOES_AND_GOES} longer value that goes and goes 7 | 8 | # robotidy: off 9 | &{MULTILINE} a=b 10 | ... b=c 11 | ... d=1 12 | ${invalid} 13 | # robotidy: on 14 | ${invalid_more} 15 | 16 | # should be left aligned 17 | # should be left aligned 18 | ${variable} 1 -------------------------------------------------------------------------------- /tests/atest/transformers/AlignVariablesSection/expected/tests_fixed.robot: -------------------------------------------------------------------------------- 1 | *** Variables *** 2 | # some comment 3 | 4 | ${VARIABLE 1} 10 # comment 5 | @{LIST} a b c d 6 | ${LONGER_NAME_THAT_GOES_AND_GOES} longer value that goes and goes 7 | 8 | &{MULTILINE} a=b 9 | ... b=c 10 | ... d=1 11 | ${invalid} 12 | ${invalid_more} 13 | 14 | # should be left aligned 15 | # should be left aligned 16 | ${variable} 1 -------------------------------------------------------------------------------- /tests/atest/transformers/AlignVariablesSection/expected/tests_fixed_one.robot: -------------------------------------------------------------------------------- 1 | *** Variables *** 2 | # some comment 3 | 4 | ${VARIABLE 1} 10 # comment 5 | @{LIST} a b c d 6 | ${LONGER_NAME_THAT_GOES_AND_GOES} longer value that goes and goes 7 | 8 | &{MULTILINE} a=b 9 | ... b=c 10 | ... d=1 11 | ${invalid} 12 | ${invalid_more} 13 | 14 | # should be left aligned 15 | # should be left aligned 16 | ${variable} 1 -------------------------------------------------------------------------------- /tests/atest/transformers/AlignVariablesSection/expected/tests_min_width.robot: -------------------------------------------------------------------------------- 1 | *** Variables *** 2 | # some comment 3 | 4 | ${VARIABLE 1} 10 # comment 5 | @{LIST} a b c d 6 | ${LONGER_NAME_THAT_GOES_AND_GOES} longer value that goes and goes 7 | 8 | &{MULTILINE} a=b 9 | ... b=c 10 | ... d=1 11 | ${invalid} 12 | ${invalid_more} 13 | 14 | # should be left aligned 15 | # should be left aligned 16 | ${variable} 1 -------------------------------------------------------------------------------- /tests/atest/transformers/AlignVariablesSection/expected/tests_skip.robot: -------------------------------------------------------------------------------- 1 | *** Variables *** 2 | # some comment 3 | 4 | ${VARIABLE 1} 10 # comment 5 | @{LIST} a b c d 6 | ${LONGER_NAME_THAT_GOES_AND_GOES} longer value that goes and goes 7 | 8 | &{MULTILINE} a=b 9 | ... b=c 10 | ... d=1 11 | ${invalid} 12 | ${invalid_more} 13 | 14 | # should be left aligned 15 | # should be left aligned 16 | ${variable} 1 -------------------------------------------------------------------------------- /tests/atest/transformers/AlignVariablesSection/source/align_selected.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation This is doc 3 | 4 | 5 | *** Variables *** 6 | # some comment 7 | 8 | ${VARIABLE 1} 10 # comment 9 | @{LIST} a b c d 10 | ${LONGER_NAME_THAT_GOES_AND_GOES} longer value that goes and goes 11 | 12 | &{MULTILINE} a=b 13 | ... b=c 14 | ... d=1 15 | ${invalid} 16 | ${invalid_more} 17 | 18 | *** Keywords *** 19 | Keyword 20 | Keyword Call 21 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignVariablesSection/source/long_comment.robot: -------------------------------------------------------------------------------- 1 | *** Variables *** 2 | # some comment that is longer than usual and can go and go and ends here 3 | 4 | ${VARIABLE 1} 10 # comment 5 | @{LIST} a b c d 6 | ${LONGER_NAME_THAT_GOES_AND_GOES} longer value that goes and goes 7 | 8 | &{MULTILINE} a=b 9 | ... b=c 10 | ... d=1 11 | ${invalid} 12 | ${invalid_more} -------------------------------------------------------------------------------- /tests/atest/transformers/AlignVariablesSection/source/multiline_skip.robot: -------------------------------------------------------------------------------- 1 | *** Variables *** 2 | ${VARIABLE 1} 10 # comment 3 | @{LIST} a 4 | ... b 5 | ... c 6 | ... d 7 | ${LONGER_NAME_THAT_GOES_AND_GOES} longer value that goes and goes 8 | &{SOME_DICT} key=value key2=value 9 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignVariablesSection/source/multiline_with_blank.robot: -------------------------------------------------------------------------------- 1 | *** Variables *** 2 | ${VARIABLE} 1 3 | ... 2 4 | ... 5 | ... 3 6 | ${OTHER_AND_LONGER} a 7 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignVariablesSection/source/optional_equal_sign.robot: -------------------------------------------------------------------------------- 1 | *** Variables *** 2 | # some comment 3 | 4 | ${VARIABLE 1}= 10 # comment 5 | @{LIST} a b c d 6 | ${LONGER_NAME_THAT_GOES_AND_GOES} = longer value that goes and goes 7 | 8 | &{MULTILINE} a=b 9 | ... b=c 10 | ... d=1 11 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignVariablesSection/source/single_var.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation Test 3 | 4 | *** Variables *** 5 | ${VAR_NAME_25_CHARACTERS} Test 6 | 7 | *** Test Cases *** 8 | Test1 9 | ${test_col_21_chars}= Set Variable Test 10 | -------------------------------------------------------------------------------- /tests/atest/transformers/AlignVariablesSection/source/tests.robot: -------------------------------------------------------------------------------- 1 | *** Variables *** 2 | # some comment 3 | 4 | ${VARIABLE 1} 10 # comment 5 | @{LIST} a b c d 6 | ${LONGER_NAME_THAT_GOES_AND_GOES} longer value that goes and goes 7 | 8 | &{MULTILINE} a=b 9 | ... b=c 10 | ... d=1 11 | ${invalid} 12 | ${invalid_more} 13 | 14 | # should be left aligned 15 | # should be left aligned 16 | ${variable} 1 -------------------------------------------------------------------------------- /tests/atest/transformers/AlignVariablesSection/source/tests_disablers.robot: -------------------------------------------------------------------------------- 1 | *** Variables *** 2 | # some comment 3 | 4 | ${VARIABLE 1} 10 # comment 5 | @{LIST} a b c d # robotidy: off 6 | ${LONGER_NAME_THAT_GOES_AND_GOES} longer value that goes and goes 7 | 8 | # robotidy: off 9 | &{MULTILINE} a=b 10 | ... b=c 11 | ... d=1 12 | ${invalid} 13 | # robotidy: on 14 | ${invalid_more} 15 | 16 | # should be left aligned 17 | # should be left aligned 18 | ${variable} 1 -------------------------------------------------------------------------------- /tests/atest/transformers/DiscardEmptySections/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarketSquare/robotframework-tidy/a4940bdc61b5afb8af1e0036d1658b2d0a550ab6/tests/atest/transformers/DiscardEmptySections/__init__.py -------------------------------------------------------------------------------- /tests/atest/transformers/DiscardEmptySections/expected/removes_empty_sections.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | Test 3 | [Documentation] doc 4 | [Tags] sometag 5 | Pass 6 | Keyword 7 | One More 8 | 9 | 10 | *** Comments *** 11 | # robocop: disable=all 12 | -------------------------------------------------------------------------------- /tests/atest/transformers/DiscardEmptySections/expected/removes_empty_sections_except_comments.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | Test 3 | [Documentation] doc 4 | [Tags] sometag 5 | Pass 6 | Keyword 7 | One More 8 | 9 | 10 | *** Keywords *** 11 | # This section is considered to be empty. 12 | 13 | 14 | *** Comments *** 15 | # robocop: disable=all 16 | -------------------------------------------------------------------------------- /tests/atest/transformers/DiscardEmptySections/expected/removes_empty_sections_skip_variables.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | Test 3 | [Documentation] doc 4 | [Tags] sometag 5 | Pass 6 | Keyword 7 | One More 8 | 9 | 10 | *** Keywords *** 11 | # This section is considered to be empty. 12 | 13 | 14 | *** Variables *** 15 | 16 | *** Comments *** 17 | # robocop: disable=all 18 | -------------------------------------------------------------------------------- /tests/atest/transformers/DiscardEmptySections/expected/removes_selected_empty_section.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | 3 | 4 | *** Test Cases *** 5 | Test 6 | [Documentation] doc 7 | [Tags] sometag 8 | Pass 9 | Keyword 10 | One More 11 | 12 | 13 | *** Keywords *** 14 | # This section is considered to be empty. 15 | 16 | 17 | *** Comments *** 18 | # robocop: disable=all 19 | -------------------------------------------------------------------------------- /tests/atest/transformers/DiscardEmptySections/source/removes_empty_sections.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | 3 | 4 | *** Test Cases *** 5 | Test 6 | [Documentation] doc 7 | [Tags] sometag 8 | Pass 9 | Keyword 10 | One More 11 | 12 | 13 | *** Keywords *** 14 | # This section is considered to be empty. 15 | 16 | 17 | *** Variables *** 18 | 19 | *** Comments *** 20 | # robocop: disable=all 21 | -------------------------------------------------------------------------------- /tests/atest/transformers/DiscardEmptySections/source/removes_empty_sections_disablers.robot: -------------------------------------------------------------------------------- 1 | # robotidy: off 2 | *** Settings *** 3 | 4 | 5 | # robotidy: on 6 | *** Test Cases *** 7 | Test 8 | [Documentation] doc 9 | [Tags] sometag 10 | Pass 11 | Keyword 12 | One More 13 | # robotidy: off 14 | 15 | 16 | *** Keywords *** 17 | # This section is considered to be empty. 18 | # robotidy: off 19 | 20 | 21 | *** Variables *** # robotidy: off 22 | 23 | *** Comments *** 24 | # robocop: disable=all 25 | -------------------------------------------------------------------------------- /tests/atest/transformers/ExternalTransformer/ExternalDisabledTransformer.py: -------------------------------------------------------------------------------- 1 | from robotidy.transformers import Transformer 2 | 3 | 4 | class ExternalDisabledTransformer(Transformer): 5 | """ 6 | This transformer is disabled by default. If it is enabled, it replaces setting names to lowercase. 7 | """ 8 | 9 | ENABLED = False 10 | 11 | def visit_SectionHeader(self, node): # noqa 12 | if not node.name: 13 | return node 14 | node.data_tokens[0].value = node.data_tokens[0].value.lower() 15 | return node 16 | -------------------------------------------------------------------------------- /tests/atest/transformers/ExternalTransformer/ExternalTransformer.py: -------------------------------------------------------------------------------- 1 | from robot.api.parsing import EmptyLine, ModelTransformer 2 | 3 | 4 | class ExternalTransformer(ModelTransformer): 5 | """ 6 | This transformer add `param` number of empty lines at the end of 7 | *** Settings *** section. 8 | """ 9 | 10 | def __init__(self, param: int = 10): 11 | self.param = param 12 | 13 | def visit_SettingSection(self, node): # noqa 14 | empty_line = EmptyLine.from_params() 15 | node.body += [empty_line] * self.param 16 | return node 17 | -------------------------------------------------------------------------------- /tests/atest/transformers/ExternalTransformer/ExternalTransformers/__init__.py: -------------------------------------------------------------------------------- 1 | from .custom_class import CustomClass1, CustomClass2, Transformer 2 | -------------------------------------------------------------------------------- /tests/atest/transformers/ExternalTransformer/ExternalTransformersOrdered/__init__.py: -------------------------------------------------------------------------------- 1 | from .custom_class import CustomClass1 2 | from .custom_class2 import CustomClass2, ModelTransformer 3 | 4 | # ModelTransformed is imported only to verify it will be not recognized as transformer itself 5 | 6 | # CustomClass1 lower case, and CustomClass2 upper case of Settings section header 7 | TRANSFORMERS = ["CustomClass2", "CustomClass1"] 8 | -------------------------------------------------------------------------------- /tests/atest/transformers/ExternalTransformer/ExternalTransformersOrdered/custom_class.py: -------------------------------------------------------------------------------- 1 | from robotidy.transformers import Transformer 2 | 3 | 4 | class CustomClass1(Transformer): 5 | def visit_SettingSection(self, node): 6 | node.header.data_tokens[0].value = node.header.data_tokens[0].value.lower() 7 | return node 8 | -------------------------------------------------------------------------------- /tests/atest/transformers/ExternalTransformer/ExternalTransformersOrdered/custom_class2.py: -------------------------------------------------------------------------------- 1 | from robot.api.parsing import ModelTransformer 2 | 3 | 4 | class CustomClass2(ModelTransformer): 5 | def visit_SettingSection(self, node): 6 | node.header.data_tokens[0].value = node.header.data_tokens[0].value.upper() 7 | return node 8 | -------------------------------------------------------------------------------- /tests/atest/transformers/ExternalTransformer/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarketSquare/robotframework-tidy/a4940bdc61b5afb8af1e0036d1658b2d0a550ab6/tests/atest/transformers/ExternalTransformer/__init__.py -------------------------------------------------------------------------------- /tests/atest/transformers/ExternalTransformer/expected/tests.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Library KeywordLibrary 3 | 4 | 5 | 6 | 7 | *** Test Cases 8 | Test 9 | Pass 10 | -------------------------------------------------------------------------------- /tests/atest/transformers/ExternalTransformer/expected/tests_lowercase.robot: -------------------------------------------------------------------------------- 1 | *** settings *** 2 | Library KeywordLibrary 3 | 4 | 5 | *** test cases 6 | Test 7 | Pass 8 | -------------------------------------------------------------------------------- /tests/atest/transformers/ExternalTransformer/expected/tests_module_load.robot: -------------------------------------------------------------------------------- 1 | *** settings *** 2 | Library KeywordLibrary 3 | 4 | 5 | *** Test Cases *** 6 | Test 7 | Pass 8 | -------------------------------------------------------------------------------- /tests/atest/transformers/ExternalTransformer/expected/tests_module_load_configure.robot: -------------------------------------------------------------------------------- 1 | *** settings *** 2 | Library KeywordLibrary 3 | 4 | 5 | *** Test Cases *** 6 | test 7 | Pass 8 | -------------------------------------------------------------------------------- /tests/atest/transformers/ExternalTransformer/expected/tests_module_transform.robot: -------------------------------------------------------------------------------- 1 | *** settings *** 2 | Library KeywordLibrary 3 | 4 | 5 | *** Test Cases 6 | Test 7 | Pass 8 | -------------------------------------------------------------------------------- /tests/atest/transformers/ExternalTransformer/expected/tests_module_transform_configure.robot: -------------------------------------------------------------------------------- 1 | *** settings *** 2 | Library KeywordLibrary 3 | 4 | 5 | *** Test Cases 6 | test 7 | Pass 8 | -------------------------------------------------------------------------------- /tests/atest/transformers/ExternalTransformer/expected/tests_only_defaults.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Library KeywordLibrary 3 | 4 | 5 | *** Test Cases *** 6 | Test 7 | Pass 8 | -------------------------------------------------------------------------------- /tests/atest/transformers/ExternalTransformer/expected/tests_with_defaults.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Library KeywordLibrary 3 | 4 | 5 | 6 | 7 | *** Test Cases *** 8 | Test 9 | Pass 10 | -------------------------------------------------------------------------------- /tests/atest/transformers/ExternalTransformer/expected/tests_with_defaults_lowercase.robot: -------------------------------------------------------------------------------- 1 | *** settings *** 2 | Library KeywordLibrary 3 | 4 | 5 | *** test cases *** 6 | Test 7 | Pass 8 | -------------------------------------------------------------------------------- /tests/atest/transformers/ExternalTransformer/source/tests.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Library KeywordLibrary 3 | 4 | 5 | *** Test Cases 6 | Test 7 | Pass 8 | -------------------------------------------------------------------------------- /tests/atest/transformers/GenerateDocumentation/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarketSquare/robotframework-tidy/a4940bdc61b5afb8af1e0036d1658b2d0a550ab6/tests/atest/transformers/GenerateDocumentation/__init__.py -------------------------------------------------------------------------------- /tests/atest/transformers/GenerateDocumentation/source/invalid_template.jinja: -------------------------------------------------------------------------------- 1 | {{ not_exist }} 2 | {%- for arg in keyword.arguments %} -------------------------------------------------------------------------------- /tests/atest/transformers/GenerateDocumentation/source/template_with_defaults.txt: -------------------------------------------------------------------------------- 1 | {{ formatting.separator }}{{ keyword.name }} 2 | {% if keyword.arguments|length > 0 %} 3 | {{ formatting.cont_indent }}Arguments: 4 | {%- for arg in keyword.arguments %} 5 | {{ formatting.cont_indent }}{{ formatting.cont_indent }}{{ arg.name }}{% if arg.default %} = '{{ arg.default }}'{% endif %}: {% endfor %} 6 | {% endif -%} 7 | {% if keyword.returns|length > 0 %} 8 | {{ formatting.cont_indent }}Returned values: 9 | {%- for value in keyword.returns %} 10 | {{ formatting.cont_indent }}{{ formatting.cont_indent }}{{ value }}: {% endfor %} 11 | {% endif -%} -------------------------------------------------------------------------------- /tests/atest/transformers/IndentNestedKeywords/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarketSquare/robotframework-tidy/a4940bdc61b5afb8af1e0036d1658b2d0a550ab6/tests/atest/transformers/IndentNestedKeywords/__init__.py -------------------------------------------------------------------------------- /tests/atest/transformers/InlineIf/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarketSquare/robotframework-tidy/a4940bdc61b5afb8af1e0036d1658b2d0a550ab6/tests/atest/transformers/InlineIf/__init__.py -------------------------------------------------------------------------------- /tests/atest/transformers/InlineIf/expected/one_if_2spaces.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | Simple IF 3 | # indent is preserved, separator changes 4 | IF $condition1 Keyword argument 5 | -------------------------------------------------------------------------------- /tests/atest/transformers/InlineIf/expected/one_if_4spaces.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | Simple IF 3 | # indent is preserved, separator changes 4 | IF $condition1 Keyword argument 5 | -------------------------------------------------------------------------------- /tests/atest/transformers/InlineIf/source/one_if.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | Simple IF 3 | # indent is preserved, separator changes 4 | IF $condition1 5 | Keyword argument 6 | END 7 | -------------------------------------------------------------------------------- /tests/atest/transformers/MergeAndOrderSections/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarketSquare/robotframework-tidy/a4940bdc61b5afb8af1e0036d1658b2d0a550ab6/tests/atest/transformers/MergeAndOrderSections/__init__.py -------------------------------------------------------------------------------- /tests/atest/transformers/MergeAndOrderSections/expected/both_test_and_task.robot: -------------------------------------------------------------------------------- 1 | *** Comments *** 2 | i am comment 3 | *** Test Case *** 4 | Test 1 5 | IF ${condition} 6 | Log stuff 7 | END 8 | 9 | Task 1 10 | IF ${condition} 11 | Log stuff 12 | END 13 | 14 | -------------------------------------------------------------------------------- /tests/atest/transformers/MergeAndOrderSections/expected/both_test_and_task_rf6.robot: -------------------------------------------------------------------------------- 1 | *** Comments *** 2 | i am comment 3 | *** Test Case *** 4 | Test 1 5 | IF ${condition} 6 | Log stuff 7 | END 8 | 9 | *** Task *** 10 | Task 1 11 | IF ${condition} 12 | Log stuff 13 | END 14 | 15 | -------------------------------------------------------------------------------- /tests/atest/transformers/MergeAndOrderSections/expected/empty_section.robot: -------------------------------------------------------------------------------- 1 | *** Comments *** 2 | *** Variables *** 3 | ${variable} some variable 4 | 5 | -------------------------------------------------------------------------------- /tests/atest/transformers/MergeAndOrderSections/expected/multiple_header_comments.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** header comment 2 | 3 | 4 | *** Variables header comment 5 | 6 | -------------------------------------------------------------------------------- /tests/atest/transformers/MergeAndOrderSections/expected/nested_block_for.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | Test 3 | FOR ${var} IN 1 2 4 | No Operation 5 | END 6 | 7 | Test 8 | FOR ${var} IN 1 2 9 | No Operation 10 | END 11 | -------------------------------------------------------------------------------- /tests/atest/transformers/MergeAndOrderSections/expected/nested_blocks.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | Keyword 3 | IF ${condition} 4 | Keyword 5 | END 6 | 7 | Keyword 8 | IF ${condition} 9 | Keyword 10 | END 11 | -------------------------------------------------------------------------------- /tests/atest/transformers/MergeAndOrderSections/expected/order_settings_comments_keywords_variables_testcases.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Library stuff 3 | 4 | *** Comments *** 5 | stuff 6 | 7 | *** Keywords *** 8 | Keyword 9 | No Operation 10 | *** Variables *** 11 | ${variable} stuff 12 | 13 | *** Test Cases *** 14 | Test 15 | Keyword 16 | 17 | -------------------------------------------------------------------------------- /tests/atest/transformers/MergeAndOrderSections/expected/too_few_calls_in_keyword.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation doc 3 | 4 | 5 | *** Test Cases *** 6 | Test 7 | [Documentation] doc 8 | [Tags] sometag 9 | Pass 10 | Keyword 11 | One More 12 | 13 | 14 | *** Keywords *** 15 | Keyword 16 | [Documentation] this is doc 17 | No Operation 18 | Pass 19 | No Operation 20 | Fail 21 | 22 | Short Keyword 23 | Keyword 24 | 25 | Empty Keyword 26 | 27 | -------------------------------------------------------------------------------- /tests/atest/transformers/MergeAndOrderSections/source/both_test_and_task.robot: -------------------------------------------------------------------------------- 1 | *** Test Case *** 2 | Test 1 3 | IF ${condition} 4 | Log stuff 5 | END 6 | 7 | *** Task *** 8 | Task 1 9 | IF ${condition} 10 | Log stuff 11 | END 12 | 13 | *** Comments *** 14 | i am comment -------------------------------------------------------------------------------- /tests/atest/transformers/MergeAndOrderSections/source/empty_section.robot: -------------------------------------------------------------------------------- 1 | *** Variables *** 2 | ${variable} some variable 3 | 4 | *** Comments *** -------------------------------------------------------------------------------- /tests/atest/transformers/MergeAndOrderSections/source/inline_if.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | foo 3 | No Operation 4 | 5 | *** Keywords *** 6 | Bar 7 | IF ${True} No Operation 8 | -------------------------------------------------------------------------------- /tests/atest/transformers/MergeAndOrderSections/source/invalid.robot: -------------------------------------------------------------------------------- 1 | *** Ustawienia *** 2 | 3 | *** Testy *** 4 | Test 5 | No Operation 6 | -------------------------------------------------------------------------------- /tests/atest/transformers/MergeAndOrderSections/source/multiple_header_comments.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** header comment 2 | 3 | *** Variables header comment 4 | 5 | *** Settings *** 6 | 7 | *** Variables also header comment 8 | -------------------------------------------------------------------------------- /tests/atest/transformers/MergeAndOrderSections/source/nested_block_for.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | Test 3 | FOR ${var} IN 1 2 4 | No Operation 5 | END 6 | 7 | *** Test Cases *** 8 | Test 9 | FOR ${var} IN 1 2 10 | No Operation 11 | END -------------------------------------------------------------------------------- /tests/atest/transformers/MergeAndOrderSections/source/nested_blocks.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | Keyword 3 | IF ${condition} 4 | Keyword 5 | END 6 | 7 | *** Keywords *** 8 | Keyword 9 | IF ${condition} 10 | Keyword 11 | END -------------------------------------------------------------------------------- /tests/atest/transformers/MergeAndOrderSections/source/order.robot: -------------------------------------------------------------------------------- 1 | *** Comments *** 2 | stuff 3 | 4 | *** Settings *** 5 | Library stuff 6 | 7 | *** Variables *** 8 | ${variable} stuff 9 | 10 | *** Test Cases *** 11 | Test 12 | Keyword 13 | 14 | *** Keywords *** 15 | Keyword 16 | No Operation 17 | -------------------------------------------------------------------------------- /tests/atest/transformers/MergeAndOrderSections/source/too_few_calls_in_keyword.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation doc 3 | 4 | 5 | *** Test Cases *** 6 | Test 7 | [Documentation] doc 8 | [Tags] sometag 9 | Pass 10 | Keyword 11 | One More 12 | 13 | 14 | *** Keywords *** 15 | Keyword 16 | [Documentation] this is doc 17 | No Operation 18 | Pass 19 | No Operation 20 | Fail 21 | 22 | Short Keyword 23 | Keyword 24 | 25 | Empty Keyword 26 | -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeAssignments/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarketSquare/robotframework-tidy/a4940bdc61b5afb8af1e0036d1658b2d0a550ab6/tests/atest/transformers/NormalizeAssignments/__init__.py -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeAssignments/expected/common_equal_sign.robot: -------------------------------------------------------------------------------- 1 | *** Variables *** 2 | ${var} ${1} 3 | @{list} a 4 | ... b 5 | ... c 6 | 7 | ${variable} 10 8 | 9 | 10 | *** Keywords *** 11 | Keyword 12 | ${var}= Keyword1 13 | ${var}= Keyword2 14 | ${var}= Keyword 15 | -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeAssignments/expected/common_equal_sign_variables.robot: -------------------------------------------------------------------------------- 1 | *** Variables *** 2 | ${var}= ${1} 3 | @{list}= a 4 | ... b 5 | ... c 6 | 7 | ${variable}= 10 8 | 9 | 10 | *** Keywords *** 11 | Keyword 12 | ${var}= Keyword1 13 | ${var}= Keyword2 14 | ${var}= Keyword 15 | -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeAssignments/expected/common_remove.robot: -------------------------------------------------------------------------------- 1 | *** Variables *** 2 | ${var} ${1} 3 | @{list} a 4 | ... b 5 | ... c 6 | 7 | ${variable} 10 8 | 9 | 10 | *** Keywords *** 11 | Keyword 12 | ${var} Keyword1 13 | ${var} Keyword2 14 | ${var} Keyword 15 | -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeAssignments/expected/common_remove_variables.robot: -------------------------------------------------------------------------------- 1 | *** Variables *** 2 | ${var} ${1} 3 | @{list} a 4 | ... b 5 | ... c 6 | 7 | ${variable} 10 8 | 9 | 10 | *** Keywords *** 11 | Keyword 12 | ${var} Keyword1 13 | ${var} Keyword2 14 | ${var} Keyword 15 | -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeAssignments/expected/common_space_and_equal_sign.robot: -------------------------------------------------------------------------------- 1 | *** Variables *** 2 | ${var} ${1} 3 | @{list} a 4 | ... b 5 | ... c 6 | 7 | ${variable} 10 8 | 9 | 10 | *** Keywords *** 11 | Keyword 12 | ${var} = Keyword1 13 | ${var} = Keyword2 14 | ${var} = Keyword 15 | -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeAssignments/expected/common_space_and_equal_sign_variables.robot: -------------------------------------------------------------------------------- 1 | *** Variables *** 2 | ${var} = ${1} 3 | @{list} = a 4 | ... b 5 | ... c 6 | 7 | ${variable} = 10 8 | 9 | 10 | *** Keywords *** 11 | Keyword 12 | ${var} = Keyword1 13 | ${var} = Keyword2 14 | ${var} = Keyword 15 | -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeAssignments/expected/equal_sign.robot: -------------------------------------------------------------------------------- 1 | *** Variables *** 2 | ${var} ${1} 3 | @{list} a 4 | ... b 5 | ... c 6 | 7 | ${variable} 10 8 | 9 | 10 | *** Keywords *** 11 | Keyword 12 | ${var}= Keyword1 13 | ${var}= Keyword2 14 | ${var}= Keyword 15 | -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeAssignments/expected/remove.robot: -------------------------------------------------------------------------------- 1 | *** Variables *** 2 | ${var} ${1} 3 | @{list} a 4 | ... b 5 | ... c 6 | 7 | ${variable} 10 8 | 9 | 10 | *** Keywords *** 11 | Keyword 12 | ${var} Keyword1 13 | ${var} Keyword2 14 | ${var} Keyword 15 | -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeAssignments/expected/space_and_equal_sign.robot: -------------------------------------------------------------------------------- 1 | *** Variables *** 2 | ${var} ${1} 3 | @{list} a 4 | ... b 5 | ... c 6 | 7 | ${variable} 10 8 | 9 | 10 | *** Keywords *** 11 | Keyword 12 | ${var} = Keyword1 13 | ${var} = Keyword2 14 | ${var} = Keyword 15 | -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeAssignments/source/common_equal_sign.robot: -------------------------------------------------------------------------------- 1 | *** Variables *** 2 | ${var}= ${1} 3 | @{list}= a 4 | ... b 5 | ... c 6 | 7 | ${variable} 10 8 | 9 | 10 | *** Keywords *** 11 | Keyword 12 | ${var}= Keyword1 13 | ${var} = Keyword2 14 | ${var} Keyword 15 | -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeAssignments/source/common_remove.robot: -------------------------------------------------------------------------------- 1 | *** Variables *** 2 | ${var} ${1} 3 | @{list}= a 4 | ... b 5 | ... c 6 | 7 | ${variable} 10 8 | 9 | 10 | *** Keywords *** 11 | Keyword 12 | ${var}= Keyword1 13 | ${var} Keyword2 14 | ${var} Keyword 15 | -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeAssignments/source/common_space_and_equal_sign.robot: -------------------------------------------------------------------------------- 1 | *** Variables *** 2 | ${var} = ${1} 3 | @{list} = a 4 | ... b 5 | ... c 6 | 7 | ${variable} 10 8 | 9 | 10 | *** Keywords *** 11 | Keyword 12 | ${var} = Keyword1 13 | ${var} = Keyword2 14 | ${var} Keyword 15 | -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeAssignments/source/disablers.robot: -------------------------------------------------------------------------------- 1 | *** Variables *** 2 | # robotidy: off 3 | ${var} = ${1} 4 | @{list}= a 5 | ... b 6 | ... c 7 | 8 | ${variable} 10 9 | 10 | 11 | *** Keywords *** 12 | Keyword 13 | ${var} = Keyword1 14 | ${var} = Keyword2 15 | ${var} Keyword # robotidy: off 16 | -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeAssignments/source/tests.robot: -------------------------------------------------------------------------------- 1 | *** Variables *** 2 | ${var} = ${1} 3 | @{list}= a 4 | ... b 5 | ... c 6 | 7 | ${variable} 10 8 | 9 | 10 | *** Keywords *** 11 | Keyword 12 | ${var} = Keyword1 13 | ${var} = Keyword2 14 | ${var} Keyword 15 | -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeComments/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarketSquare/robotframework-tidy/a4940bdc61b5afb8af1e0036d1658b2d0a550ab6/tests/atest/transformers/NormalizeComments/__init__.py -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeComments/test_transformer.py: -------------------------------------------------------------------------------- 1 | from tests.atest import TransformerAcceptanceTest 2 | 3 | 4 | class TestNormalizeComments(TransformerAcceptanceTest): 5 | TRANSFORMER_NAME = "NormalizeComments" 6 | 7 | def test_transformer(self): 8 | self.compare(source="test.robot", expected="test.robot") 9 | -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeNewLines/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarketSquare/robotframework-tidy/a4940bdc61b5afb8af1e0036d1658b2d0a550ab6/tests/atest/transformers/NormalizeNewLines/__init__.py -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeNewLines/expected/consecutive_empty_lines_0line.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Resource resource.robot 3 | Default Tags tag 4 | Documentation doc 5 | 6 | 7 | *** Test Cases *** 8 | Test Capitalized 9 | Pass Execution 10 | 11 | test not capitalized 12 | Pass Execution 13 | 14 | TEST UPPERCASE 15 | Pass Execution 16 | 17 | Test with first letter capitalized 18 | Pass Execution 19 | # no test case name 20 | Log To Console hello 21 | 22 | 23 | *** Keywords *** 24 | Keyword 25 | Empty Line Before 26 | One Line 27 | Two Empty Lines 28 | -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeNewLines/expected/consecutive_empty_lines_1line.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Resource resource.robot 3 | 4 | Default Tags tag 5 | 6 | Documentation doc 7 | 8 | 9 | *** Test Cases *** 10 | Test Capitalized 11 | Pass Execution 12 | 13 | test not capitalized 14 | Pass Execution 15 | 16 | TEST UPPERCASE 17 | Pass Execution 18 | 19 | Test with first letter capitalized 20 | Pass Execution 21 | 22 | # no test case name 23 | Log To Console hello 24 | 25 | 26 | *** Keywords *** 27 | Keyword 28 | Empty Line Before 29 | 30 | One Line 31 | 32 | Two Empty Lines 33 | -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeNewLines/expected/inline_if.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | foo 3 | No Operation 4 | 5 | 6 | *** Keywords *** 7 | Bar 8 | IF ${True} No Operation 9 | -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeNewLines/expected/language_header_0empty.robot: -------------------------------------------------------------------------------- 1 | language: pl 2 | *** Ustawienia *** 3 | 4 | 5 | *** Zmienne *** 6 | -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeNewLines/expected/language_header_2empty.robot: -------------------------------------------------------------------------------- 1 | language: pl 2 | 3 | 4 | *** Ustawienia *** 5 | 6 | 7 | *** Zmienne *** 8 | -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeNewLines/expected/language_header_and_comments.robot: -------------------------------------------------------------------------------- 1 | language: pl 2 | I am free comment 3 | 4 | 5 | *** Ustawienia *** 6 | 7 | 8 | *** Zmienne *** 9 | -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeNewLines/expected/multiline.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Force Tags tag 3 | ... other tag 4 | ... also tag 5 | 6 | 7 | *** Test Cases *** 8 | Test 9 | Keyword With 10 | ... Multiline arguments 11 | ... With empty lines 12 | ... Which should be removed 13 | 14 | 15 | *** Keywords *** 16 | Multiline assignments 17 | ${argument} 18 | ... ${argument} 19 | ... Keyword 20 | ... ${value} 21 | 22 | Header 23 | [Setup] Keyword 24 | ... ${arg} 25 | FOR ${var} IN ${val} 26 | ... 5 27 | ... 6 28 | Keyword 29 | END 30 | -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeNewLines/expected/test_case_last.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | Values Are Equal Fails 3 | Log 1111 4 | 5 | Values Are Equal Fails 6 | Log 1111 7 | -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeNewLines/source/inline_if_0_lines.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | foo 3 | No Operation 4 | 5 | *** Keywords *** 6 | Bar 7 | IF ${True} No Operation -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeNewLines/source/inline_if_1_lines.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | foo 3 | No Operation 4 | 5 | *** Keywords *** 6 | Bar 7 | IF ${True} No Operation 8 | -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeNewLines/source/inline_if_2_lines.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | foo 3 | No Operation 4 | 5 | *** Keywords *** 6 | Bar 7 | IF ${True} No Operation 8 | 9 | -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeNewLines/source/language_header_0empty.robot: -------------------------------------------------------------------------------- 1 | language: pl 2 | *** Ustawienia *** 3 | *** Zmienne *** -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeNewLines/source/language_header_2empty.robot: -------------------------------------------------------------------------------- 1 | language: pl 2 | 3 | 4 | *** Ustawienia *** 5 | *** Zmienne *** -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeNewLines/source/language_header_5empty.robot: -------------------------------------------------------------------------------- 1 | language: pl 2 | 3 | 4 | 5 | 6 | 7 | *** Ustawienia *** 8 | *** Zmienne *** -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeNewLines/source/language_header_and_comments.robot: -------------------------------------------------------------------------------- 1 | language: pl 2 | I am free comment 3 | *** Ustawienia *** 4 | *** Zmienne *** 5 | -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeNewLines/source/test_case_last_0_lines.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | Values Are Equal Fails 3 | Log 1111 4 | 5 | Values Are Equal Fails 6 | Log 1111 -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeNewLines/source/test_case_last_1_lines.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | Values Are Equal Fails 3 | Log 1111 4 | 5 | Values Are Equal Fails 6 | Log 1111 7 | -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeSectionHeaderName/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarketSquare/robotframework-tidy/a4940bdc61b5afb8af1e0036d1658b2d0a550ab6/tests/atest/transformers/NormalizeSectionHeaderName/__init__.py -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeSectionHeaderName/expected/selected.robot: -------------------------------------------------------------------------------- 1 | ** settings *** 2 | 3 | *** test cASE *** 4 | 5 | *** Keywords *** data driven columns for col names 6 | 7 | *** coMment *** 8 | -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeSectionHeaderName/expected/task.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | 3 | *** Tasks *** -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeSectionHeaderName/expected/task2.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | 3 | *** Tasks *** -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeSectionHeaderName/expected/tests.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | 3 | *** Test Cases *** 4 | 5 | *** Keywords *** data driven columns for col names 6 | 7 | *** Comments *** 8 | -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeSectionHeaderName/expected/translated.robot: -------------------------------------------------------------------------------- 1 | language: pl 2 | I am free comment 3 | *** Ustawienia *** 4 | *** Zmienne *** 5 | *** Słowa Kluczowe *** 6 | -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeSectionHeaderName/expected/uppercase.robot: -------------------------------------------------------------------------------- 1 | *** SETTINGS *** 2 | 3 | *** TEST CASES *** 4 | 5 | *** KEYWORDS *** data driven columns for col names 6 | 7 | *** COMMENTS *** 8 | -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeSectionHeaderName/source/disablers.robot: -------------------------------------------------------------------------------- 1 | ** settings *** # robotidy: off 2 | 3 | *** test cASE *** # robotidy: off 4 | 5 | *KEYWORDs data driven columns for col names # robotidy: off 6 | 7 | *** coMment *** # robotidy: off 8 | -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeSectionHeaderName/source/task.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | 3 | *** task *** -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeSectionHeaderName/source/task2.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | 3 | * Task * -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeSectionHeaderName/source/tests.robot: -------------------------------------------------------------------------------- 1 | ** settings *** 2 | 3 | *** test cASE *** 4 | 5 | *KEYWORDs data driven columns for col names 6 | 7 | *** coMment *** 8 | -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeSectionHeaderName/source/translated.robot: -------------------------------------------------------------------------------- 1 | language: pl 2 | I am free comment 3 | *** UstawieniA *** 4 | *** zmienne *** 5 | *** Słowa kluczowe *** 6 | -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeSeparators/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarketSquare/robotframework-tidy/a4940bdc61b5afb8af1e0036d1658b2d0a550ab6/tests/atest/transformers/NormalizeSeparators/__init__.py -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeSeparators/expected/comments_skip_block_comments.robot: -------------------------------------------------------------------------------- 1 | # standalone comment 2 | 3 | *** Settings *** 4 | Library Collections # comment 5 | 6 | # standalone 7 | 8 | *** Keywords *** 9 | # standalone 10 | 11 | Keyword # with comment 12 | # with comment and spaces 13 | Keyword Call # with comment 14 | FOR ${var} IN RANGE 10 # with comment 15 | # with comment 16 | Log ${var} 17 | END # with comment 18 | 19 | # standalone with some spacing 20 | # # 21 | -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeSeparators/expected/comments_skip_comments.robot: -------------------------------------------------------------------------------- 1 | # standalone comment 2 | 3 | *** Settings *** 4 | Library Collections # comment 5 | 6 | # standalone 7 | 8 | *** Keywords *** 9 | # standalone 10 | 11 | Keyword # with comment 12 | # with comment and spaces 13 | Keyword Call # with comment 14 | FOR ${var} IN RANGE 10 # with comment 15 | # with comment 16 | Log ${var} 17 | END # with comment 18 | 19 | # standalone with some spacing 20 | # # 21 | -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeSeparators/expected/inline_if_2indent_2spaces.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | Simple IF 3 | IF $condition1 Keyword argument 4 | IF $condition1 RETURN 5 | IF $condition1 CONTINUE 6 | IF $condition BREAK 7 | 8 | Nested IF 9 | FOR ${var} IN RANGE 10 10 | IF $condition1 Keyword argument # comment 11 | END 12 | 13 | ELSE IF 14 | IF ${condition} Keyword Call ELSE Keyword Call 2 15 | ${assign} IF ${{ inline eval }} Keyword Call ${arg} ELSE IF $flag Keyword Call 2 16 | -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeSeparators/expected/inline_if_2indent_4spaces.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | Simple IF 3 | IF $condition1 Keyword argument 4 | IF $condition1 RETURN 5 | IF $condition1 CONTINUE 6 | IF $condition BREAK 7 | 8 | Nested IF 9 | FOR ${var} IN RANGE 10 10 | IF $condition1 Keyword argument # comment 11 | END 12 | 13 | ELSE IF 14 | IF ${condition} Keyword Call ELSE Keyword Call 2 15 | ${assign} IF ${{ inline eval }} Keyword Call ${arg} ELSE IF $flag Keyword Call 2 16 | -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeSeparators/expected/inline_if_4indent_2spaces.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | Simple IF 3 | IF $condition1 Keyword argument 4 | IF $condition1 RETURN 5 | IF $condition1 CONTINUE 6 | IF $condition BREAK 7 | 8 | Nested IF 9 | FOR ${var} IN RANGE 10 10 | IF $condition1 Keyword argument # comment 11 | END 12 | 13 | ELSE IF 14 | IF ${condition} Keyword Call ELSE Keyword Call 2 15 | ${assign} IF ${{ inline eval }} Keyword Call ${arg} ELSE IF $flag Keyword Call 2 16 | -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeSeparators/expected/inline_if_4indent_4spaces.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | Simple IF 3 | IF $condition1 Keyword argument 4 | IF $condition1 RETURN 5 | IF $condition1 CONTINUE 6 | IF $condition BREAK 7 | 8 | Nested IF 9 | FOR ${var} IN RANGE 10 10 | IF $condition1 Keyword argument # comment 11 | END 12 | 13 | ELSE IF 14 | IF ${condition} Keyword Call ELSE Keyword Call 2 15 | ${assign} IF ${{ inline eval }} Keyword Call ${arg} ELSE IF $flag Keyword Call 2 16 | -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeSeparators/expected/inline_if_flatten.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | Simple IF 3 | IF $condition1 Keyword argument 4 | IF $condition1 RETURN 5 | IF $condition1 CONTINUE 6 | IF $condition BREAK 7 | 8 | Nested IF 9 | FOR ${var} IN RANGE 10 10 | IF $condition1 Keyword argument # comment 11 | END 12 | 13 | ELSE IF 14 | IF ${condition} Keyword Call ELSE Keyword Call 2 15 | ${assign} IF ${{ inline eval }} Keyword Call ${arg} ELSE IF $flag Keyword Call 2 16 | -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeSeparators/source/comments.robot: -------------------------------------------------------------------------------- 1 | # standalone comment 2 | 3 | *** Settings *** 4 | Library Collections # comment 5 | 6 | # standalone 7 | 8 | *** Keywords *** 9 | # standalone 10 | 11 | Keyword # with comment 12 | # with comment and spaces 13 | Keyword Call # with comment 14 | FOR ${var} IN RANGE 10 # with comment 15 | # with comment 16 | Log ${var} 17 | END # with comment 18 | 19 | # standalone with some spacing 20 | # # 21 | -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeSeparators/source/disablers2.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation Disablers with NormalizeTags acceptance tests 3 | 4 | Test Tags # robotidy: off 5 | ... UPPERCASE_TAG 6 | ... tag2 7 | ... tag3 8 | ... tag4 9 | ... tag5 10 | ... tag6 11 | ... tag7 12 | ... tag8 13 | ... tag9 14 | ... tag10 15 | ... tag11 16 | ... tag12 17 | ... tag13 18 | -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeSeparators/source/disablers3.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation Disablers with NormalizeTags acceptance tests 3 | 4 | # robotidy: off 5 | Test Tags 6 | ... UPPERCASE_TAG 7 | ... tag2 8 | ... tag3 9 | ... tag4 10 | ... tag5 11 | ... tag6 12 | ... tag7 13 | ... tag8 14 | ... tag9 15 | ... tag10 16 | ... tag11 17 | ... tag12 18 | ... tag13 19 | -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeSeparators/source/disablers4.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation Disablers with NormalizeTags acceptance tests 3 | 4 | Test Tags UPPERCASE_TAG tag2 tag3 tag4 tag5 tag6 tag7 tag8 tag9 tag10 tag11 tag12 tag13 # robotidy: off 5 | -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeSeparators/source/inline_if.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | Simple IF 3 | IF $condition1 Keyword argument 4 | IF $condition1 RETURN 5 | IF $condition1 CONTINUE 6 | IF $condition BREAK 7 | 8 | Nested IF 9 | FOR ${var} IN RANGE 10 10 | IF $condition1 Keyword argument # comment 11 | END 12 | 13 | ELSE IF 14 | IF ${condition} Keyword Call ELSE Keyword Call 2 15 | ${assign} IF ${{ inline eval }} Keyword Call ${arg} ELSE IF $flag Keyword Call 2 16 | -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeSettingName/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarketSquare/robotframework-tidy/a4940bdc61b5afb8af1e0036d1658b2d0a550ab6/tests/atest/transformers/NormalizeSettingName/__init__.py -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeSettingName/expected/rf6.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Test Tags tag 3 | -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeSettingName/expected/selected.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | library 3 | documentation This is example documentation 4 | ... which is also multiline 5 | FORCE TAGS tag1 tag2 6 | test Template Keyword 7 | 8 | 9 | *** Test Cases *** 10 | Test 11 | [setup] Keyword2 12 | No Operation 13 | [Teardown] 14 | 15 | 16 | *** Keywords *** 17 | Keyword 18 | [arguments] ${arg} 19 | Pass 20 | -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeSettingName/expected/tests.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Library 3 | Documentation This is example documentation 4 | ... which is also multiline 5 | Force Tags tag1 tag2 6 | Test Template Keyword 7 | 8 | 9 | *** Test Cases *** 10 | Test 11 | [Setup] Keyword2 12 | No Operation 13 | [Teardown] 14 | 15 | 16 | *** Keywords *** 17 | Keyword 18 | [Arguments] ${arg} 19 | Pass 20 | -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeSettingName/source/disablers.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | library # robotidy: off 3 | documentation This is example documentation 4 | ... which is also multiline # robotidy: off 5 | # robotidy: off 6 | FORCE TAGS tag1 tag2 7 | test Template Keyword 8 | 9 | 10 | *** Test Cases *** 11 | Test 12 | [setup] Keyword2 # robotidy: off 13 | No Operation 14 | [ TEARDOWN ] # robotidy: off 15 | 16 | 17 | *** Keywords *** # robotidy: off 18 | Keyword 19 | [arguments] ${arg} 20 | Pass 21 | -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeSettingName/source/rf6.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Test tags tag 3 | -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeSettingName/source/tests.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | library 3 | documentation This is example documentation 4 | ... which is also multiline 5 | FORCE TAGS tag1 tag2 6 | test Template Keyword 7 | 8 | 9 | *** Test Cases *** 10 | Test 11 | [setup] Keyword2 12 | No Operation 13 | [ TEARDOWN ] 14 | 15 | 16 | *** Keywords *** 17 | Keyword 18 | [arguments] ${arg} 19 | Pass 20 | -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeTags/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarketSquare/robotframework-tidy/a4940bdc61b5afb8af1e0036d1658b2d0a550ab6/tests/atest/transformers/NormalizeTags/__init__.py -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeTags/expected/preserve_format_default.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Default Tags tag1 tag2 tag4 tag5 # comment 3 | 4 | 5 | *** Keywords *** 6 | Keyword 7 | [Tags] tag2 tag3 tag4 tag5 # comment1 # comment2 8 | 9 | 10 | *** Test Cases *** 11 | Test 12 | [Tags] neednormalization_now also_need_normalization tag # Tell some # interesting story # about those tags 13 | -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeTags/expected/preserve_format_enabled.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Default Tags tag1 tag2 tag1 tag4 tag4 tag5 tag5 # comment 3 | 4 | 5 | *** Keywords *** 6 | Keyword 7 | [Tags] 8 | ... tag2 9 | ... tag3 # comment1 10 | ... tag4 11 | ... tag4 12 | ... tag5 # comment2 13 | ... tag5 14 | 15 | 16 | *** Test Cases *** 17 | Test 18 | [Tags] neednormalization_now # Tell some 19 | ... also_need_normalization # interesting story 20 | ... tag # about those tags 21 | -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeTags/expected/spacing_2indent_2spaces.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | Keyword 3 | [Tags] a b c 4 | -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeTags/expected/spacing_2indent_4spaces.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | Keyword 3 | [Tags] a b c 4 | -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeTags/expected/spacing_4indent_2spaces.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | Keyword 3 | [Tags] a b c 4 | -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeTags/expected/spacing_4indent_4spaces.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | Keyword 3 | [Tags] a b c 4 | -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeTags/expected/variables_in_tags_lowercase.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Test Tags simple with ${VAR} 3 | Default Tags simple with ${VAR lower} 4 | 5 | 6 | *** Test Cases *** 7 | No tags 8 | Keyword no tags 9 | 10 | Tags 11 | [Tags] simple with ${VAR} ${tag} ${tag} after 12 | One Tag Keyword 13 | -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeTags/expected/variables_in_tags_titlecase.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Test Tags Simple With ${VAR} 3 | Default Tags Simple With ${VAR lower} 4 | 5 | 6 | *** Test Cases *** 7 | No tags 8 | Keyword no tags 9 | 10 | Tags 11 | [Tags] Simple With ${VAR} ${tag} ${tag} After 12 | One Tag Keyword 13 | -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeTags/expected/variables_in_tags_uppercase.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Test Tags SIMPLE WITH ${VAR} 3 | Default Tags SIMPLE WITH ${VAR lower} 4 | 5 | 6 | *** Test Cases *** 7 | No tags 8 | Keyword no tags 9 | 10 | Tags 11 | [Tags] SIMPLE WITH ${VAR} ${tag} ${tag} AFTER 12 | One Tag Keyword 13 | -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeTags/source/disablers2.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation Disablers with NormalizeTags acceptance tests 3 | 4 | Test Tags # robotidy: off 5 | ... UPPERCASE_TAG 6 | ... tag2 7 | ... tag3 8 | ... tag4 9 | ... tag5 10 | ... tag6 11 | ... tag7 12 | ... tag8 13 | ... tag9 14 | ... tag10 15 | ... tag11 16 | ... tag12 17 | ... tag13 18 | -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeTags/source/disablers3.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation Disablers with NormalizeTags acceptance tests 3 | 4 | # robotidy: off 5 | Test Tags 6 | ... UPPERCASE_TAG 7 | ... tag2 8 | ... tag3 9 | ... tag4 10 | ... tag5 11 | ... tag6 12 | ... tag7 13 | ... tag8 14 | ... tag9 15 | ... tag10 16 | ... tag11 17 | ... tag12 18 | ... tag13 19 | -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeTags/source/disablers4.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation Disablers with NormalizeTags acceptance tests 3 | 4 | Test Tags UPPERCASE_TAG tag2 tag3 tag4 tag5 tag6 tag7 tag8 tag9 tag10 tag11 tag12 tag13 # robotidy: off 5 | -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeTags/source/preserve_format.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Default Tags tag1 Tag2 TAG1 tag4 tag4 tag5 TAG5 # comment 3 | 4 | 5 | *** Keywords *** 6 | Keyword 7 | [Tags] 8 | ... Tag2 9 | ... TAG3 # comment1 10 | ... tag4 11 | ... tag4 12 | ... tag5 # comment2 13 | ... TAG5 14 | 15 | 16 | *** Test Cases *** 17 | Test 18 | [Tags] NeedNormalization_Now # Tell some 19 | ... also_need_Normalization # interesting story 20 | ... TAG # about those tags 21 | -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeTags/source/rf6.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Test tags tag 3 | -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeTags/source/spacing.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | Keyword 3 | [Tags] A B C 4 | -------------------------------------------------------------------------------- /tests/atest/transformers/NormalizeTags/source/variables_in_tags.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Test Tags simple WITH ${VAR} 3 | Default Tags SIMPLE with ${VAR lower} 4 | 5 | 6 | *** Test Cases *** 7 | No tags 8 | Keyword no tags 9 | 10 | Tags 11 | [Tags] SIMPLE with ${VAR} ${tag} 12 | ... ${tag} after 13 | One Tag Keyword 14 | -------------------------------------------------------------------------------- /tests/atest/transformers/OrderSettings/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarketSquare/robotframework-tidy/a4940bdc61b5afb8af1e0036d1658b2d0a550ab6/tests/atest/transformers/OrderSettings/__init__.py -------------------------------------------------------------------------------- /tests/atest/transformers/OrderSettings/expected/stick_comments.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | Comment between settings 3 | # comment 3 4 | [Documentation] doc 5 | # comment 1 6 | [Arguments] ${arg} 7 | # comment 2 8 | Step 9 | # comment 4 10 | [Return] ${arg} 11 | -------------------------------------------------------------------------------- /tests/atest/transformers/OrderSettings/source/stick_comments.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | Comment between settings 3 | # comment 1 4 | [Arguments] ${arg} 5 | # comment 2 6 | Step 7 | # comment 4 8 | [Return] ${arg} 9 | # comment 3 10 | [Documentation] doc 11 | -------------------------------------------------------------------------------- /tests/atest/transformers/OrderSettingsSection/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarketSquare/robotframework-tidy/a4940bdc61b5afb8af1e0036d1658b2d0a550ab6/tests/atest/transformers/OrderSettingsSection/__init__.py -------------------------------------------------------------------------------- /tests/atest/transformers/OrderSettingsSection/expected/last_section.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Resource resource.robot 3 | Library library.py 4 | -------------------------------------------------------------------------------- /tests/atest/transformers/OrderSettingsSection/expected/missing_group.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation doc # this is comment 3 | ... another line 4 | Metadata value param 5 | 6 | Suite Setup Keyword 7 | # We all 8 | # are commenting Suite Teardown 9 | Suite Teardown Keyword2 10 | # i want to be keep together with Test Setup 11 | Test Setup Keyword 12 | Test Timeout 1min 13 | 14 | *** Keywords *** -------------------------------------------------------------------------------- /tests/atest/transformers/OrderSettingsSection/expected/parsing_error.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Library library.py 3 | 4 | Resources resource.robot 5 | -------------------------------------------------------------------------------- /tests/atest/transformers/OrderSettingsSection/expected/remote_library.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Library Collections 3 | Library DateTime 4 | Library Dialogs 5 | Library OperatingSystem 6 | Library String 7 | Library XML 8 | Library Browser 9 | Library RequestsLibrary 10 | Library Keywords/MyUtilities.py 11 | Library Remote http://localhost:9050/ WITH NAME JDBCDB2 # DB2 12 | Resource keywords.robot 13 | Resource other_stuff.robot 14 | -------------------------------------------------------------------------------- /tests/atest/transformers/OrderSettingsSection/expected/test.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation doc # this is comment 3 | ... another line 4 | Metadata value param 5 | 6 | Variables variables.py 7 | Library Stuff 8 | Library Collections 9 | Resource robot.resource 10 | Library stuff.py WITH NAME alias 11 | 12 | Suite Setup Keyword 13 | # We all 14 | # are commenting Suite Teardown 15 | Suite Teardown Keyword2 16 | # i want to be keep together with Test Setup 17 | Test Setup Keyword 18 | Test Timeout 1min 19 | 20 | Force Tags tag 21 | ... tag 22 | Default Tags 1 23 | 24 | *** Keywords *** -------------------------------------------------------------------------------- /tests/atest/transformers/OrderSettingsSection/expected/test_0_newline.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation doc # this is comment 3 | ... another line 4 | Metadata value param 5 | Variables variables.py 6 | Library Stuff 7 | Library Collections 8 | Resource robot.resource 9 | Library stuff.py WITH NAME alias 10 | Suite Setup Keyword 11 | # We all 12 | # are commenting Suite Teardown 13 | Suite Teardown Keyword2 14 | # i want to be keep together with Test Setup 15 | Test Setup Keyword 16 | Test Timeout 1min 17 | Force Tags tag 18 | ... tag 19 | Default Tags 1 20 | 21 | *** Keywords *** -------------------------------------------------------------------------------- /tests/atest/transformers/OrderSettingsSection/expected/test_2_newline.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation doc # this is comment 3 | ... another line 4 | Metadata value param 5 | 6 | 7 | Variables variables.py 8 | Library Stuff 9 | Library Collections 10 | Resource robot.resource 11 | Library stuff.py WITH NAME alias 12 | 13 | 14 | Suite Setup Keyword 15 | # We all 16 | # are commenting Suite Teardown 17 | Suite Teardown Keyword2 18 | # i want to be keep together with Test Setup 19 | Test Setup Keyword 20 | Test Timeout 1min 21 | 22 | 23 | Force Tags tag 24 | ... tag 25 | Default Tags 1 26 | 27 | *** Keywords *** -------------------------------------------------------------------------------- /tests/atest/transformers/OrderSettingsSection/expected/test_empty_group_order.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | 3 | *** Keywords *** -------------------------------------------------------------------------------- /tests/atest/transformers/OrderSettingsSection/expected/test_group_order.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Force Tags tag 3 | ... tag 4 | Default Tags 1 5 | 6 | Documentation doc # this is comment 7 | ... another line 8 | Metadata value param 9 | 10 | Variables variables.py 11 | Library Stuff 12 | Library Collections 13 | Resource robot.resource 14 | Library stuff.py WITH NAME alias 15 | 16 | Suite Setup Keyword 17 | # We all 18 | # are commenting Suite Teardown 19 | Suite Teardown Keyword2 20 | # i want to be keep together with Test Setup 21 | Test Setup Keyword 22 | Test Timeout 1min 23 | 24 | *** Keywords *** -------------------------------------------------------------------------------- /tests/atest/transformers/OrderSettingsSection/expected/test_group_order_import_ordered.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Force Tags tag 3 | ... tag 4 | Default Tags 1 5 | 6 | Documentation doc # this is comment 7 | ... another line 8 | Metadata value param 9 | 10 | Library Collections 11 | Library Stuff 12 | Library stuff.py WITH NAME alias 13 | Resource robot.resource 14 | Variables variables.py 15 | 16 | Suite Setup Keyword 17 | # We all 18 | # are commenting Suite Teardown 19 | Suite Teardown Keyword2 20 | # i want to be keep together with Test Setup 21 | Test Setup Keyword 22 | Test Timeout 1min 23 | 24 | *** Keywords *** -------------------------------------------------------------------------------- /tests/atest/transformers/OrderSettingsSection/expected/test_missing_group_from_param.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation doc # this is comment 3 | ... another line 4 | Metadata value param 5 | 6 | Variables variables.py 7 | Library Stuff 8 | Library Collections 9 | Resource robot.resource 10 | Library stuff.py WITH NAME alias 11 | 12 | Suite Setup Keyword 13 | # We all 14 | # are commenting Suite Teardown 15 | Suite Teardown Keyword2 16 | # i want to be keep together with Test Setup 17 | Test Setup Keyword 18 | Test Timeout 1min 19 | 20 | *** Keywords *** -------------------------------------------------------------------------------- /tests/atest/transformers/OrderSettingsSection/expected/test_resource_metadata_first.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Metadata value param 3 | Documentation doc # this is comment 4 | ... another line 5 | 6 | Resource robot.resource 7 | Library Collections 8 | Library Stuff 9 | Library stuff.py WITH NAME alias 10 | Variables variables.py 11 | 12 | Suite Setup Keyword 13 | # We all 14 | # are commenting Suite Teardown 15 | Suite Teardown Keyword2 16 | # i want to be keep together with Test Setup 17 | Test Setup Keyword 18 | Test Timeout 1min 19 | 20 | Force Tags tag 21 | ... tag 22 | Default Tags 1 23 | 24 | *** Keywords *** -------------------------------------------------------------------------------- /tests/atest/transformers/OrderSettingsSection/expected/test_tags.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Test Tags tag 3 | ... tag2 4 | Default Tags tag 5 | -------------------------------------------------------------------------------- /tests/atest/transformers/OrderSettingsSection/source/just_comment.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | # comment 3 | -------------------------------------------------------------------------------- /tests/atest/transformers/OrderSettingsSection/source/last_section.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Resource resource.robot 3 | Library library.py -------------------------------------------------------------------------------- /tests/atest/transformers/OrderSettingsSection/source/missing_group.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Metadata value param 3 | 4 | 5 | 6 | Documentation doc # this is comment 7 | ... another line 8 | Test Timeout 1min 9 | 10 | # i want to be keep together with Test Setup 11 | 12 | Test Setup Keyword 13 | 14 | 15 | Suite Setup Keyword 16 | 17 | # We all 18 | # are commenting Suite Teardown 19 | Suite Teardown Keyword2 20 | 21 | 22 | 23 | 24 | *** Keywords *** -------------------------------------------------------------------------------- /tests/atest/transformers/OrderSettingsSection/source/parsing_error.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Resources resource.robot 3 | Library library.py -------------------------------------------------------------------------------- /tests/atest/transformers/OrderSettingsSection/source/remote_library.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Library Collections 3 | Library DateTime 4 | Library Dialogs 5 | Library OperatingSystem 6 | Library String 7 | Library XML 8 | Library Browser 9 | Library RequestsLibrary 10 | Library Keywords/MyUtilities.py 11 | Resource keywords.robot 12 | Resource other_stuff.robot 13 | Library Remote http://localhost:9050/ WITH NAME JDBCDB2 # DB2 14 | -------------------------------------------------------------------------------- /tests/atest/transformers/OrderSettingsSection/source/test.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Metadata value param 3 | 4 | Force Tags tag 5 | ... tag 6 | 7 | Documentation doc # this is comment 8 | ... another line 9 | Test Timeout 1min 10 | 11 | # i want to be keep together with Test Setup 12 | 13 | Test Setup Keyword 14 | 15 | 16 | Suite Setup Keyword 17 | Default Tags 1 18 | # We all 19 | # are commenting Suite Teardown 20 | Suite Teardown Keyword2 21 | 22 | Variables variables.py 23 | Library Stuff 24 | Library Collections 25 | Resource robot.resource 26 | Library stuff.py WITH NAME alias 27 | 28 | 29 | *** Keywords *** -------------------------------------------------------------------------------- /tests/atest/transformers/OrderSettingsSection/source/test_tags.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Default Tags tag 3 | Test Tags tag 4 | ... tag2 5 | -------------------------------------------------------------------------------- /tests/atest/transformers/OrderTags/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarketSquare/robotframework-tidy/a4940bdc61b5afb8af1e0036d1658b2d0a550ab6/tests/atest/transformers/OrderTags/__init__.py -------------------------------------------------------------------------------- /tests/atest/transformers/OrderTags/expected/test_tags.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Test Tags one two 3 | -------------------------------------------------------------------------------- /tests/atest/transformers/OrderTags/source/test_tags.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Test Tags two one 3 | -------------------------------------------------------------------------------- /tests/atest/transformers/RemoveEmptySettings/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarketSquare/robotframework-tidy/a4940bdc61b5afb8af1e0036d1658b2d0a550ab6/tests/atest/transformers/RemoveEmptySettings/__init__.py -------------------------------------------------------------------------------- /tests/atest/transformers/RemoveEmptySettings/expected/empty_always_more_explicit.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Metadata doc=1 3 | 4 | 5 | *** Test Cases *** 6 | Test 7 | [Tags] tag 8 | Keyword 9 | 10 | Test 2 11 | [Setup] Keyword 12 | [Template] Keyword 13 | [Timeout] 1min 14 | Keyword 15 | 16 | Test 3 17 | Keyword 18 | 19 | 20 | 21 | *** Keywords *** 22 | Keyword 23 | [Arguments] ${arg} 24 | Keyword 25 | 26 | Keyword 2 27 | Keyword 28 | [Return] stuff 29 | -------------------------------------------------------------------------------- /tests/atest/transformers/RemoveEmptySettings/expected/empty_always_no_explicit.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Metadata doc=1 3 | 4 | 5 | *** Test Cases *** 6 | Test 7 | [Tags] tag 8 | Keyword 9 | 10 | Test 2 11 | [Setup] Keyword 12 | [Template] Keyword 13 | [Timeout] 1min 14 | Keyword 15 | 16 | Test 3 17 | Keyword 18 | 19 | 20 | 21 | *** Keywords *** 22 | Keyword 23 | [Arguments] ${arg} 24 | Keyword 25 | 26 | Keyword 2 27 | Keyword 28 | [Return] stuff 29 | -------------------------------------------------------------------------------- /tests/atest/transformers/RemoveEmptySettings/expected/empty_overwritten_ok_more_explicit.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Metadata doc=1 3 | 4 | 5 | *** Test Cases *** 6 | Test 7 | [Tags] tag 8 | Keyword 9 | 10 | Test 2 11 | [Setup] Keyword 12 | [Template] Keyword 13 | [Timeout] 1min 14 | Keyword 15 | 16 | Test 3 17 | Keyword 18 | 19 | 20 | 21 | *** Keywords *** 22 | Keyword 23 | [Arguments] ${arg} 24 | Keyword 25 | 26 | Keyword 2 27 | Keyword 28 | [Return] stuff 29 | -------------------------------------------------------------------------------- /tests/atest/transformers/RemoveEmptySettings/expected/empty_overwritten_ok_no_explicit.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Metadata doc=1 3 | 4 | 5 | *** Test Cases *** 6 | Test 7 | [Tags] tag 8 | Keyword 9 | 10 | Test 2 11 | [Setup] Keyword 12 | [Template] Keyword 13 | [Timeout] 1min 14 | Keyword 15 | 16 | Test 3 17 | Keyword 18 | 19 | 20 | 21 | *** Keywords *** 22 | Keyword 23 | [Arguments] ${arg} 24 | Keyword 25 | 26 | Keyword 2 27 | Keyword 28 | [Return] stuff 29 | -------------------------------------------------------------------------------- /tests/atest/transformers/RemoveEmptySettings/expected/overwritten_always_more_explicit.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Metadata doc=1 3 | Test Setup Keyword 4 | Test Teardown Keyword 5 | Test Timeout 1 min 6 | Default Tags tag 7 | 8 | 9 | *** Test Cases *** 10 | Test 11 | [Tags] tag 12 | Keyword 13 | 14 | Test 2 15 | [Setup] Keyword 16 | [Template] Keyword 17 | [Timeout] 1min 18 | Keyword 19 | 20 | Test 3 21 | Keyword 22 | 23 | 24 | 25 | *** Keywords *** 26 | Keyword 27 | [Arguments] ${arg} 28 | Keyword 29 | 30 | Keyword 2 31 | Keyword 32 | [Return] stuff 33 | -------------------------------------------------------------------------------- /tests/atest/transformers/RemoveEmptySettings/expected/overwritten_always_no_explicit.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Metadata doc=1 3 | Test Setup Keyword 4 | Test Teardown Keyword 5 | Test Timeout 1 min 6 | Default Tags tag 7 | 8 | 9 | *** Test Cases *** 10 | Test 11 | [Tags] tag 12 | Keyword 13 | 14 | Test 2 15 | [Setup] Keyword 16 | [Template] Keyword 17 | [Timeout] 1min 18 | Keyword 19 | 20 | Test 3 21 | Keyword 22 | 23 | 24 | 25 | *** Keywords *** 26 | Keyword 27 | [Arguments] ${arg} 28 | Keyword 29 | 30 | Keyword 2 31 | Keyword 32 | [Return] stuff 33 | -------------------------------------------------------------------------------- /tests/atest/transformers/RenameKeywords/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarketSquare/robotframework-tidy/a4940bdc61b5afb8af1e0036d1658b2d0a550ab6/tests/atest/transformers/RenameKeywords/__init__.py -------------------------------------------------------------------------------- /tests/atest/transformers/RenameKeywords/expected/bug537_538.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | Keyword With Problematic Space Underscore Combination 3 | Keyword With Problematic Space Underscore Combination 4 | 5 | Keyword With Many Underscores 6 | Keyword With Many Underscores 7 | 8 | Embedded ${variable} And Remove Underscores 9 | Embedded ${variable} And Remove Underscores 10 | -------------------------------------------------------------------------------- /tests/atest/transformers/RenameKeywords/expected/capitalize_first.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | Lower case stays 3 | No operation 4 | 5 | Upper Case stays 6 | No Operation 7 | 8 | Underscores will be removed 9 | No operation 10 | -------------------------------------------------------------------------------- /tests/atest/transformers/RenameKeywords/expected/library_embedded_var_pattern.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | Library And Embedded Variable And Pattern 3 | LibraryName.With.Dots.New Name ${keyword} And ${var} 4 | -------------------------------------------------------------------------------- /tests/atest/transformers/RenameKeywords/expected/no_title_case.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | lower case stays 3 | no operation 4 | 5 | Upper Case stays 6 | No Operation 7 | 8 | Underscores will be removed 9 | No operation 10 | -------------------------------------------------------------------------------- /tests/atest/transformers/RenameKeywords/expected/with_library_name.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | Library Name 3 | Process.Only Keyword Name 4 | RPA.Browser.playwright.Take Screenshot 5 | SeleniumLibrary.Open Browser 6 | SSHLibrary.Open Connection Host 7 | -------------------------------------------------------------------------------- /tests/atest/transformers/RenameKeywords/expected/with_library_name_transform.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | Library Name 3 | Process.Only Keyword Name 4 | RPA.Browser.Playwright.Take Screenshot 5 | SeleniumLibrary.Open Browser 6 | SSHLibrary.Open Connection Host 7 | -------------------------------------------------------------------------------- /tests/atest/transformers/RenameKeywords/source/bug537_538.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | Keyword _with_Problematic_Space_Underscore_Combination 3 | Keyword _with_Problematic_Space_Underscore_Combination 4 | 5 | Keyword With Many Underscores 6 | Keyword _With_ Many_Underscores 7 | 8 | Embedded ${variable}_And_Remove_Underscores 9 | Embedded ${variable}_And_Remove_Underscores 10 | -------------------------------------------------------------------------------- /tests/atest/transformers/RenameKeywords/source/library_embedded_var_pattern.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | Library And Embedded Variable And Pattern 3 | LibraryName.With.Dots.Rename with ${keyword} Variable 4 | -------------------------------------------------------------------------------- /tests/atest/transformers/RenameKeywords/source/no_title_case.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | lower case stays 3 | no operation 4 | 5 | Upper Case stays 6 | No Operation 7 | 8 | Underscores_will_be_removed 9 | No operation 10 | -------------------------------------------------------------------------------- /tests/atest/transformers/RenameKeywords/source/with_library_name.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | Library Name 3 | Process.only keyword name 4 | RPA.Browser.playwright.Take Screenshot 5 | SeleniumLibrary.Open Browser 6 | SSHLibrary.Open Connection host 7 | -------------------------------------------------------------------------------- /tests/atest/transformers/RenameTestCases/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarketSquare/robotframework-tidy/a4940bdc61b5afb8af1e0036d1658b2d0a550ab6/tests/atest/transformers/RenameTestCases/__init__.py -------------------------------------------------------------------------------- /tests/atest/transformers/RenameTestCases/expected/test.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | Starting with small case 3 | log 1 4 | 5 | Ending with dot 6 | No Operation 7 | 8 | Ending with dot and containing variables column name another column 9 | No Operation 10 | 11 | Containing replace pattern JIRA-1234 12 | [Tags] tag 13 | No Operation 14 | 15 | Remove special chars: ?$@ 16 | No Operation 17 | 18 | Capitalize words (after !special that's 19 | No operation 20 | 21 | Select 3rd Option 22 | No Operation 23 | 24 | With 1200x950 25 | No Operation 26 | 27 | Open 3-dot Menu 28 | No Operation 29 | -------------------------------------------------------------------------------- /tests/atest/transformers/RenameTestCases/source/disablers.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | starting with small case # robotidy: off 3 | log 1 4 | # robotidy: off 5 | Ending with dot. 6 | No Operation 7 | # robotidy: on 8 | Ending with dot and containing variables . column name another column # robotidy: off 9 | No Operation 10 | 11 | Containing replace pattern JIRA-1234 12 | [Tags] tag 13 | No Operation 14 | 15 | Remove special chars: ?$@ 16 | No Operation 17 | -------------------------------------------------------------------------------- /tests/atest/transformers/RenameTestCases/source/empty_test_name.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | 3 | # no test case name!!! 4 | Log To Console hello 5 | 6 | Proper test 7 | [documentation] doc 8 | [tags] sometag 9 | Pass 10 | Keyword 11 | One More 12 | -------------------------------------------------------------------------------- /tests/atest/transformers/RenameVariables/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarketSquare/robotframework-tidy/a4940bdc61b5afb8af1e0036d1658b2d0a550ab6/tests/atest/transformers/RenameVariables/__init__.py -------------------------------------------------------------------------------- /tests/atest/transformers/RenameVariables/expected/equal_sign_in_section.robot: -------------------------------------------------------------------------------- 1 | *** Variables *** 2 | ${RANDOM_SEED} = ${None} 3 | 4 | 5 | *** Keywords *** 6 | Keyword With Sign 7 | ${value} = Keyword Call ${RANDOM_SEED} 8 | -------------------------------------------------------------------------------- /tests/atest/transformers/RenameVariables/expected/groups.robot: -------------------------------------------------------------------------------- 1 | *** Variables *** 2 | ${GLOBAL} global 3 | 4 | 5 | *** Keywords *** 6 | Not named 7 | ${local} Keyword Call 8 | GROUP 9 | Keyword Call ${local} 10 | ${local_from_group} Keyword Call ${GLOBAL} 11 | END 12 | Keyword Call ${local_from_group} 13 | 14 | Named with variable 15 | GROUP Name with ${GLOBAL} 16 | Keyword Call 17 | END 18 | GROUP Nested 19 | VAR ${local} local 20 | GROUP Named with ${local} 21 | Keyword Call 22 | END 23 | END 24 | -------------------------------------------------------------------------------- /tests/atest/transformers/RenameVariables/expected/inline_if.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | Keyword With Inline IF 3 | Log ${GLOBAL} 4 | ${global} IF $condition Keyword 5 | Log ${global} 6 | -------------------------------------------------------------------------------- /tests/atest/transformers/RenameVariables/expected/math_operations.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | Simple math operations 3 | ${i} Set Variable ${0} 4 | Log ${i+1} 5 | 6 | Global Value 7 | Log ${I-1} 8 | 9 | Invalid syntax 10 | ${i} Set Variable ${0} 11 | ${y} Set Variable ${1} 12 | Log ${i+y+1} 13 | -------------------------------------------------------------------------------- /tests/atest/transformers/RenameVariables/expected/test_template.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Test Template ${GLOBAL_KEYWORD_NAME} 3 | 4 | 5 | *** Test Cases *** 6 | Template with for loop 7 | FOR ${item} IN @{ITE_MS} 8 | ${item} 2nd arg 9 | END 10 | FOR ${index} IN RANGE 42 11 | 1st arg ${index} ${GLOBAL} 12 | END 13 | 14 | Test Name ${ARG} ${ARG2} 15 | -------------------------------------------------------------------------------- /tests/atest/transformers/RenameVariables/expected/try_except.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | Keyword With Try 3 | ${local} = Keyword 4 | TRY 5 | Do Stuff ${local} ${GLOBAL} 6 | EXCEPT Error AS ${error} 7 | Log ${error} 8 | END 9 | -------------------------------------------------------------------------------- /tests/atest/transformers/RenameVariables/source/equal_sign_in_section.robot: -------------------------------------------------------------------------------- 1 | *** Variables *** 2 | ${random_seed} = ${None} 3 | 4 | 5 | *** Keywords *** 6 | Keyword With Sign 7 | ${value} = Keyword Call ${random_seed} 8 | -------------------------------------------------------------------------------- /tests/atest/transformers/RenameVariables/source/groups.robot: -------------------------------------------------------------------------------- 1 | *** Variables *** 2 | ${GLOBAL} global 3 | 4 | 5 | *** Keywords *** 6 | Not named 7 | ${local} Keyword Call 8 | GROUP 9 | Keyword Call ${LOCAL} 10 | ${local_from_group} Keyword Call ${global} 11 | END 12 | Keyword Call ${LOCAL_FROM_GROUP} 13 | 14 | Named with variable 15 | GROUP Name with ${global} 16 | Keyword Call 17 | END 18 | GROUP Nested 19 | VAR ${local} local 20 | GROUP Named with ${LOCAL} 21 | Keyword Call 22 | END 23 | END 24 | -------------------------------------------------------------------------------- /tests/atest/transformers/RenameVariables/source/inline_if.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | Keyword With Inline IF 3 | Log ${global} 4 | ${GLOBAL} IF $condition Keyword 5 | Log ${global} 6 | -------------------------------------------------------------------------------- /tests/atest/transformers/RenameVariables/source/math_operations.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | Simple math operations 3 | ${i} Set Variable ${0} 4 | Log ${i+1} 5 | 6 | Global Value 7 | Log ${i-1} 8 | 9 | Invalid syntax 10 | ${i} Set Variable ${0} 11 | ${y} Set Variable ${1} 12 | Log ${i+y+1} 13 | -------------------------------------------------------------------------------- /tests/atest/transformers/RenameVariables/source/test_template.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Test Template ${global keyword name} 3 | 4 | 5 | *** Test Cases *** 6 | Template with for loop 7 | FOR ${item} IN @{ITEMs} 8 | ${item} 2nd arg 9 | END 10 | FOR ${index} IN RANGE 42 11 | 1st arg ${index} ${global} 12 | END 13 | 14 | Test Name ${arg} ${arg2} 15 | -------------------------------------------------------------------------------- /tests/atest/transformers/RenameVariables/source/try_except.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | Keyword With Try 3 | ${local} = Keyword 4 | TRY 5 | Do Stuff ${local} ${global} 6 | EXCEPT Error AS ${ERROR} 7 | Log ${ERROR} 8 | END 9 | -------------------------------------------------------------------------------- /tests/atest/transformers/ReplaceBreakContinue/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarketSquare/robotframework-tidy/a4940bdc61b5afb8af1e0036d1658b2d0a550ab6/tests/atest/transformers/ReplaceBreakContinue/__init__.py -------------------------------------------------------------------------------- /tests/atest/transformers/ReplaceBreakContinue/source/errors.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | Missing condition 3 | FOR ${var} IN RANGE 2 4 | Continue For Loop If 5 | Exit For Loop If 6 | END 7 | 8 | *** Keywords *** 9 | Missing condition 10 | FOR ${var} IN RANGE 2 11 | Continue For Loop If 12 | Exit For Loop If 13 | END 14 | -------------------------------------------------------------------------------- /tests/atest/transformers/ReplaceBreakContinue/test_transformer.py: -------------------------------------------------------------------------------- 1 | from tests.atest import TransformerAcceptanceTest 2 | 3 | 4 | class TestReplaceBreakContinue(TransformerAcceptanceTest): 5 | TRANSFORMER_NAME = "ReplaceBreakContinue" 6 | 7 | def test_transformer(self): 8 | self.compare(source="test.robot") 9 | 10 | def test_with_errors(self): 11 | self.compare(source="errors.robot", not_modified=True) 12 | 13 | def test_disablers(self): 14 | self.compare(source="disablers.robot", not_modified=True) 15 | -------------------------------------------------------------------------------- /tests/atest/transformers/ReplaceEmptyValues/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarketSquare/robotframework-tidy/a4940bdc61b5afb8af1e0036d1658b2d0a550ab6/tests/atest/transformers/ReplaceEmptyValues/__init__.py -------------------------------------------------------------------------------- /tests/atest/transformers/ReplaceEmptyValues/source/test.robot: -------------------------------------------------------------------------------- 1 | *** Variables *** 2 | ${EMPTY_SCALAR} 3 | ${MULTILINE_SCALAR} 4 | ... 5 | ... value2 6 | ${EMPTY_SCALAR_WITH_COMMENT} # comment 7 | ${SCALAR} value 8 | @{EMPTY_LIST} 9 | @{MULTILINE_LIST} 10 | ... 11 | ... 12 | ... value2 13 | @{LIST_WITH_COMMENT} # comment 14 | ... # comment 15 | ... value # comment 16 | @{ONELINE_LIST} value1 value2 17 | &{EMPTY_DICT} 18 | &{MULTILINE_DICT} 19 | ... 20 | ... key=value 21 | &{DICT_WITH_COMMENT} # comment 22 | &{DICT} 23 | ... key=value 24 | ... key2=value 25 | -------------------------------------------------------------------------------- /tests/atest/transformers/ReplaceEmptyValues/test_transformer.py: -------------------------------------------------------------------------------- 1 | from tests.atest import TransformerAcceptanceTest 2 | 3 | 4 | class TestReplaceEmptyValues(TransformerAcceptanceTest): 5 | TRANSFORMER_NAME = "ReplaceEmptyValues" 6 | 7 | def test_transformer(self): 8 | self.compare(source="test.robot", expected="test.robot") 9 | 10 | def test_skip_section(self): 11 | self.compare(source="test.robot", config=" --skip-sections=variables", not_modified=True) 12 | -------------------------------------------------------------------------------- /tests/atest/transformers/ReplaceReturns/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarketSquare/robotframework-tidy/a4940bdc61b5afb8af1e0036d1658b2d0a550ab6/tests/atest/transformers/ReplaceReturns/__init__.py -------------------------------------------------------------------------------- /tests/atest/transformers/ReplaceReturns/expected/return_from_keyword.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | [Arguments] ${element} @{items} 3 | ${index} = Set Variable ${0} 4 | FOR ${item} IN @{items} 5 | ${index} = Set Variable ${index + 1} 6 | IF ${index} == ${5} 7 | RETURN ${index} 8 | END 9 | END 10 | RETURN ${-1} # Could also use [Return] 11 | -------------------------------------------------------------------------------- /tests/atest/transformers/ReplaceReturns/expected/return_from_keyword_if.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | First 3 | ${var} Set Variable 1 4 | IF ${var}==2 5 | RETURN ${var} 6 | END 7 | FOR ${variable} IN 1 2 8 | Log ${variable} 9 | END 10 | 11 | With IF 12 | ${var} Set Variable 1 13 | IF ${var}>0 14 | IF ${var}==2 15 | RETURN ${var} 16 | END 17 | END 18 | IF ${var}==2 19 | RETURN ${var} 20 | END 21 | 22 | Multiline Statements 23 | IF ${condition} 24 | RETURN ${var} # comment 25 | END 26 | -------------------------------------------------------------------------------- /tests/atest/transformers/ReplaceReturns/expected/test.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | Keyword with [Return] 3 | 4 | No Operation 5 | RETURN 1 # it can be first 6 | 7 | Keyword with Multiple [Return] 8 | Step 1 9 | Step 2 10 | RETURN 1 11 | 12 | 13 | 14 | Keyword with RETURN 15 | No Operation 16 | RETURN 1 17 | 18 | Keyword With Two RETURN 19 | IF ${GLOBAL} RETURN 20 | No Operation 21 | RETURN 22 | -------------------------------------------------------------------------------- /tests/atest/transformers/ReplaceReturns/expected/test_selected.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | Keyword with [Return] 3 | [Return] 1 # it can be first 4 | 5 | No Operation 6 | 7 | Keyword with Multiple [Return] 8 | [Return] 1 9 | Step 1 10 | Step 2 11 | 12 | 13 | 14 | Keyword with RETURN 15 | No Operation 16 | RETURN 1 17 | 18 | Keyword With Two RETURN 19 | IF ${GLOBAL} RETURN 20 | No Operation 21 | RETURN 22 | -------------------------------------------------------------------------------- /tests/atest/transformers/ReplaceReturns/source/errors.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | Return From Keyword 3 | Return From Keyword If 4 | Run Keyword And Return If $condition 5 | 6 | *** Keywords *** 7 | Return From Keyword 8 | Return From Keyword If 9 | Run Keyword And Return If $condition 10 | -------------------------------------------------------------------------------- /tests/atest/transformers/ReplaceReturns/source/return_from_keyword.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | [Arguments] ${element} @{items} 3 | ${index} = Set Variable ${0} 4 | FOR ${item} IN @{items} 5 | ${index} = Set Variable ${index + 1} 6 | IF ${index} == ${5} 7 | Return From Keyword ${index} 8 | END 9 | END 10 | Return From Keyword ${-1} # Could also use [Return] 11 | -------------------------------------------------------------------------------- /tests/atest/transformers/ReplaceReturns/source/return_from_keyword_if.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | First 3 | ${var} Set Variable 1 4 | Return From Keyword_If ${var}==2 ${var} 5 | FOR ${variable} IN 1 2 6 | Log ${variable} 7 | END 8 | 9 | With IF 10 | ${var} Set Variable 1 11 | IF ${var}>0 12 | Return From Keyword_If ${var}==2 ${var} 13 | END 14 | Return From Keyword If ${var}==2 15 | ... ${var} 16 | 17 | Multiline Statements 18 | Return From Keyword If # comment 19 | ... ${condition} ${var} 20 | -------------------------------------------------------------------------------- /tests/atest/transformers/ReplaceReturns/source/run_keyword_and_return.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | For and Ifs 3 | FOR ${var} IN 1 2 4 | IF $var == 2 5 | Run Keyword And Return Keyword ${arg} 6 | END 7 | END 8 | 9 | *** Keywords *** 10 | Testing 11 | Run Keyword And Return Keyword ${arg} 12 | ... ${arg2} 13 | -------------------------------------------------------------------------------- /tests/atest/transformers/ReplaceReturns/source/run_keyword_and_return_if.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | First 3 | ${var} Set Variable 1 4 | FOR ${variable} IN 1 2 5 | Run Keyword And Return If ${var}==2 Keyword 2 ${var} 6 | Log ${variable} 7 | END 8 | 9 | With IF 10 | ${var} Set Variable 1 11 | IF ${var}>0 12 | Run Keyword And Return If $var Some Keyword ${var} 13 | ... 1 14 | END 15 | -------------------------------------------------------------------------------- /tests/atest/transformers/ReplaceReturns/source/test.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | Keyword with [Return] 3 | [Return] 1 # it can be first 4 | 5 | No Operation 6 | 7 | Keyword with Multiple [Return] 8 | [Return] 1 9 | Step 1 10 | [Return] 2 11 | Step 2 12 | 13 | 14 | 15 | Keyword with RETURN 16 | No Operation 17 | RETURN 1 18 | 19 | Keyword With Two RETURN 20 | IF ${GLOBAL} RETURN 21 | No Operation 22 | RETURN 23 | -------------------------------------------------------------------------------- /tests/atest/transformers/ReplaceRunKeywordIf/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarketSquare/robotframework-tidy/a4940bdc61b5afb8af1e0036d1658b2d0a550ab6/tests/atest/transformers/ReplaceRunKeywordIf/__init__.py -------------------------------------------------------------------------------- /tests/atest/transformers/ReplaceRunKeywordIf/expected/configure_whitespace.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | Keyword 3 | IF ${b} - ${e} <= ${c} and ${b} > 10 4 | ${a} Evaluate ${d} + 2 + (10 - ${c}) 5 | ELSE 6 | ${a} Evaluate ${d} + 2 7 | END 8 | -------------------------------------------------------------------------------- /tests/atest/transformers/ReplaceRunKeywordIf/expected/keyword_name_in_var.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | Keyword with variable for keyword name 3 | [Documentation] Keyword documentation. 4 | [Arguments] ${kw} @{args} 5 | IF '${VARIABLE}'!='VALUE' and '${OTHER_VARIABLE}'!='VALUE' 6 | ${data} = Run Keyword ${kw} @{args} 7 | ELSE 8 | ${data} = Set Variable ${None} 9 | END 10 | -------------------------------------------------------------------------------- /tests/atest/transformers/ReplaceRunKeywordIf/source/configure_whitespace.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | Keyword 3 | ${a} Run Keyword If ${b} - ${e} <= ${c} and ${b} > 10 Evaluate ${d} + 2 + (10 - ${c}) ELSE Evaluate ${d} + 2 4 | -------------------------------------------------------------------------------- /tests/atest/transformers/ReplaceRunKeywordIf/source/keyword_name_in_var.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | Keyword with variable for keyword name 3 | [Documentation] Keyword documentation. 4 | [Arguments] ${kw} @{args} 5 | ${data} = Run Keyword If '${VARIABLE}'!='VALUE' and '${OTHER_VARIABLE}'!='VALUE' 6 | ... ${kw} @{args} 7 | -------------------------------------------------------------------------------- /tests/atest/transformers/ReplaceWithVAR/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarketSquare/robotframework-tidy/a4940bdc61b5afb8af1e0036d1658b2d0a550ab6/tests/atest/transformers/ReplaceWithVAR/__init__.py -------------------------------------------------------------------------------- /tests/atest/transformers/SmartSortKeywords/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarketSquare/robotframework-tidy/a4940bdc61b5afb8af1e0036d1658b2d0a550ab6/tests/atest/transformers/SmartSortKeywords/__init__.py -------------------------------------------------------------------------------- /tests/atest/transformers/SmartSortKeywords/expected/multiple_sections.robot: -------------------------------------------------------------------------------- 1 | *** Variables *** 2 | ${MY_VAR} 123 3 | 4 | *** Keywords *** 5 | 6 | my_another_cool_keyword 7 | 8 | 9 | my another keyword 10 | Log Many 123 11 | ... 12 | # Comment 13 | My Keyword 14 | Kw1 15 | Kw3 16 | one more kw 17 | 18 | _my_another_secrete_keyword 19 | Log 123 20 | 21 | _my secrete keyword 22 | Log 123 23 | 24 | 25 | 26 | *** Settings *** 27 | Library Collections -------------------------------------------------------------------------------- /tests/atest/transformers/SmartSortKeywords/expected/sort_.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | My Keyword 3 | Kw1 4 | Kw3 5 | one more kw 6 | 7 | 8 | _my secrete keyword 9 | Log 123 10 | _my_another_secrete_keyword 11 | Log 123 12 | 13 | my another keyword 14 | Log Many 123 15 | ... 16 | # Comment 17 | 18 | my_another_cool_keyword 19 | 20 | -------------------------------------------------------------------------------- /tests/atest/transformers/SmartSortKeywords/expected/sort_ci.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | my another keyword 3 | Log Many 123 4 | ... 5 | # Comment 6 | 7 | 8 | My Keyword 9 | Kw1 10 | Kw3 11 | one more kw 12 | my_another_cool_keyword 13 | 14 | _my secrete keyword 15 | Log 123 16 | 17 | _my_another_secrete_keyword 18 | Log 123 19 | 20 | -------------------------------------------------------------------------------- /tests/atest/transformers/SmartSortKeywords/expected/sort_ci_ilu.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | my another keyword 3 | Log Many 123 4 | ... 5 | # Comment 6 | 7 | 8 | My Keyword 9 | Kw1 10 | Kw3 11 | one more kw 12 | _my secrete keyword 13 | Log 123 14 | 15 | my_another_cool_keyword 16 | 17 | _my_another_secrete_keyword 18 | Log 123 19 | 20 | -------------------------------------------------------------------------------- /tests/atest/transformers/SmartSortKeywords/expected/sort_ci_ilu_iou.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | my_another_cool_keyword 3 | 4 | 5 | my another keyword 6 | Log Many 123 7 | ... 8 | # Comment 9 | _my_another_secrete_keyword 10 | Log 123 11 | 12 | My Keyword 13 | Kw1 14 | Kw3 15 | one more kw 16 | 17 | _my secrete keyword 18 | Log 123 19 | 20 | -------------------------------------------------------------------------------- /tests/atest/transformers/SmartSortKeywords/expected/sort_ci_iou.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | my_another_cool_keyword 3 | 4 | 5 | my another keyword 6 | Log Many 123 7 | ... 8 | # Comment 9 | My Keyword 10 | Kw1 11 | Kw3 12 | one more kw 13 | 14 | _my_another_secrete_keyword 15 | Log 123 16 | 17 | _my secrete keyword 18 | Log 123 19 | 20 | -------------------------------------------------------------------------------- /tests/atest/transformers/SmartSortKeywords/expected/sort_ilu.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | My Keyword 3 | Kw1 4 | Kw3 5 | one more kw 6 | 7 | 8 | my another keyword 9 | Log Many 123 10 | ... 11 | # Comment 12 | _my secrete keyword 13 | Log 123 14 | 15 | my_another_cool_keyword 16 | 17 | _my_another_secrete_keyword 18 | Log 123 19 | 20 | -------------------------------------------------------------------------------- /tests/atest/transformers/SmartSortKeywords/expected/sort_ilu_iou.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | My Keyword 3 | Kw1 4 | Kw3 5 | one more kw 6 | 7 | 8 | my_another_cool_keyword 9 | my another keyword 10 | Log Many 123 11 | ... 12 | # Comment 13 | 14 | _my_another_secrete_keyword 15 | Log 123 16 | 17 | _my secrete keyword 18 | Log 123 19 | 20 | -------------------------------------------------------------------------------- /tests/atest/transformers/SmartSortKeywords/expected/sort_iou.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | My Keyword 3 | Kw1 4 | Kw3 5 | one more kw 6 | 7 | 8 | _my_another_secrete_keyword 9 | Log 123 10 | _my secrete keyword 11 | Log 123 12 | 13 | my_another_cool_keyword 14 | 15 | my another keyword 16 | Log Many 123 17 | ... 18 | # Comment 19 | 20 | -------------------------------------------------------------------------------- /tests/atest/transformers/SmartSortKeywords/source/disablers.robot: -------------------------------------------------------------------------------- 1 | *** Variables *** 2 | ${MY_VAR} 123 3 | 4 | *** Keywords *** # robotidy: off 5 | 6 | My Keyword 7 | Kw1 8 | Kw3 9 | one more kw 10 | 11 | 12 | my another keyword 13 | Log Many 123 14 | ... 15 | # Comment 16 | my_another_cool_keyword 17 | 18 | _my secrete keyword 19 | Log 123 20 | 21 | _my_another_secrete_keyword 22 | Log 123 23 | 24 | 25 | 26 | *** Settings *** 27 | Library Collections -------------------------------------------------------------------------------- /tests/atest/transformers/SmartSortKeywords/source/empty_before_fist_keyword.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | 3 | # My Comment 4 | my_kw -------------------------------------------------------------------------------- /tests/atest/transformers/SmartSortKeywords/source/multiple_sections.robot: -------------------------------------------------------------------------------- 1 | *** Variables *** 2 | ${MY_VAR} 123 3 | 4 | *** Keywords *** 5 | 6 | My Keyword 7 | Kw1 8 | Kw3 9 | one more kw 10 | 11 | 12 | my another keyword 13 | Log Many 123 14 | ... 15 | # Comment 16 | my_another_cool_keyword 17 | 18 | _my secrete keyword 19 | Log 123 20 | 21 | _my_another_secrete_keyword 22 | Log 123 23 | 24 | 25 | 26 | *** Settings *** 27 | Library Collections -------------------------------------------------------------------------------- /tests/atest/transformers/SmartSortKeywords/source/sort_input.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | My Keyword 3 | Kw1 4 | Kw3 5 | one more kw 6 | 7 | 8 | my another keyword 9 | Log Many 123 10 | ... 11 | # Comment 12 | my_another_cool_keyword 13 | 14 | _my secrete keyword 15 | Log 123 16 | 17 | _my_another_secrete_keyword 18 | Log 123 19 | 20 | -------------------------------------------------------------------------------- /tests/atest/transformers/SplitTooLongLine/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarketSquare/robotframework-tidy/a4940bdc61b5afb8af1e0036d1658b2d0a550ab6/tests/atest/transformers/SplitTooLongLine/__init__.py -------------------------------------------------------------------------------- /tests/atest/transformers/SplitTooLongLine/source/multiple_assignments.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | Multiple Assignments 3 | ${first_assignment} ${second_assignment} My Keyword 4 | ${first_assignment} ${second_assignment} Some Lengthy Keyword So That This Line Is Too Long ${arg1} ${arg2} 5 | ${multiline_first} 6 | ... ${multiline_second}= Some Lengthy Keyword So That This Line Is Too Long 7 | ${first_assignment} ${second_assignment} ${third_assignment} Some Lengthy Keyword So That This Line Is Too Long And Bit Over ${arg1} ${arg2} 8 | -------------------------------------------------------------------------------- /tests/atest/transformers/Translate/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarketSquare/robotframework-tidy/a4940bdc61b5afb8af1e0036d1658b2d0a550ab6/tests/atest/transformers/Translate/__init__.py -------------------------------------------------------------------------------- /tests/atest/transformers/Translate/expected/add_lang_header/comment_section.robot: -------------------------------------------------------------------------------- 1 | language: pl 2 | 3 | *** Komentarze *** 4 | language: pl 5 | 6 | *** Przypadki Testowe *** 7 | Pierwszy test 8 | Krok 1 9 | -------------------------------------------------------------------------------- /tests/atest/transformers/Translate/expected/add_lang_header/diff_lang_header.robot: -------------------------------------------------------------------------------- 1 | language: pl 2 | 3 | *** Przypadki Testowe *** 4 | Pierwszy test 5 | Krok 1 6 | -------------------------------------------------------------------------------- /tests/atest/transformers/Translate/expected/add_lang_header/en_header.robot: -------------------------------------------------------------------------------- 1 | 2 | *** Test Cases *** 3 | Pierwszy test 4 | Krok 1 5 | -------------------------------------------------------------------------------- /tests/atest/transformers/Translate/expected/add_lang_header/no_lang_header.robot: -------------------------------------------------------------------------------- 1 | language: pl 2 | 3 | *** Przypadki Testowe *** 4 | Pierwszy test 5 | Krok 1 6 | -------------------------------------------------------------------------------- /tests/atest/transformers/Translate/expected/bdd/pl.robot: -------------------------------------------------------------------------------- 1 | *** Przypadki Testowe *** 2 | Pierwszy test 3 | Mając Strona Do Logowania Jest Otwarta 4 | Gdy Login I Hasło Są Wprowadzone 5 | I Nie Ma Błędów 6 | Wtedy Strona Główna Powinna Się Otworzyć 7 | 8 | Do not translate these 9 | Given 10 | Keyword 11 | Multiline 12 | ... keyword 13 | 14 | Arguments and return values 15 | ${arg} Gdy I Have Some ${arguments} 16 | ... ${more_arguments} 17 | -------------------------------------------------------------------------------- /tests/atest/transformers/Translate/expected/bdd/pl_alternative.robot: -------------------------------------------------------------------------------- 1 | *** Przypadki Testowe *** 2 | Pierwszy test 3 | Zakładając Strona Do Logowania Jest Otwarta 4 | Gdy Login I Hasło Są Wprowadzone 5 | I Nie Ma Błędów 6 | Wtedy Strona Główna Powinna Się Otworzyć 7 | 8 | Do not translate these 9 | Given 10 | Keyword 11 | Multiline 12 | ... keyword 13 | 14 | Arguments and return values 15 | ${arg} Gdy I Have Some ${arguments} 16 | ... ${more_arguments} 17 | -------------------------------------------------------------------------------- /tests/atest/transformers/Translate/expected/bdd/uk.robot: -------------------------------------------------------------------------------- 1 | *** Тест-Кейси *** 2 | Pierwszy test 3 | Дано Strona Do Logowania Jest Otwarta 4 | Коли Login I Hasło Są Wprowadzone 5 | Та Nie Ma Błędów 6 | Тоді Strona Główna Powinna Się Otworzyć 7 | 8 | Do not translate these 9 | Given 10 | Keyword 11 | Multiline 12 | ... keyword 13 | 14 | Arguments and return values 15 | ${arg} Коли I Have Some ${arguments} 16 | ... ${more_arguments} 17 | -------------------------------------------------------------------------------- /tests/atest/transformers/Translate/expected/en.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Library python.py 3 | Documentation This is doc 4 | 5 | Suite Teardown Keyword 6 | 7 | Task Tags tag 8 | 9 | 10 | *** Variables *** 11 | ${VAR} ${TRUE} 12 | 13 | 14 | *** Test Cases *** 15 | Pierwszy test 16 | [Setup] 17 | [Tags] 18 | Słowo kluczowe 19 | 20 | Dokumentacja 21 | [Documentation] This is doc 22 | No Operation 23 | 24 | *** Keywords *** 25 | Keyword 26 | [Arguments] ${arg} 27 | IF $condition 28 | Log ${arg} 29 | ELSE 30 | BREAK 31 | END 32 | -------------------------------------------------------------------------------- /tests/atest/transformers/Translate/source/add_lang_header/comment_section.robot: -------------------------------------------------------------------------------- 1 | *** Comments *** 2 | language: pl 3 | 4 | *** Test Cases *** 5 | Pierwszy test 6 | Krok 1 7 | -------------------------------------------------------------------------------- /tests/atest/transformers/Translate/source/add_lang_header/diff_lang_header.robot: -------------------------------------------------------------------------------- 1 | language: uk 2 | 3 | *** Test Cases *** 4 | Pierwszy test 5 | Krok 1 6 | -------------------------------------------------------------------------------- /tests/atest/transformers/Translate/source/add_lang_header/empty.robot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarketSquare/robotframework-tidy/a4940bdc61b5afb8af1e0036d1658b2d0a550ab6/tests/atest/transformers/Translate/source/add_lang_header/empty.robot -------------------------------------------------------------------------------- /tests/atest/transformers/Translate/source/add_lang_header/en_header.robot: -------------------------------------------------------------------------------- 1 | language: en 2 | 3 | *** Test Cases *** 4 | Pierwszy test 5 | Krok 1 6 | -------------------------------------------------------------------------------- /tests/atest/transformers/Translate/source/add_lang_header/no_lang_header.robot: -------------------------------------------------------------------------------- 1 | 2 | *** Test Cases *** 3 | Pierwszy test 4 | Krok 1 5 | -------------------------------------------------------------------------------- /tests/atest/transformers/Translate/source/bdd/en_and_pl.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | Pierwszy test 3 | Given Strona Do Logowania Jest Otwarta 4 | When Login I Hasło Są Wprowadzone 5 | And Nie Ma Błędów 6 | Then Strona Główna Powinna Się Otworzyć 7 | 8 | Do not translate these 9 | Given 10 | Keyword 11 | Multiline 12 | ... keyword 13 | 14 | Arguments and return values 15 | ${arg} When I Have Some ${arguments} 16 | ... ${more_arguments} 17 | -------------------------------------------------------------------------------- /tests/atest/transformers/Translate/source/en.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Library python.py 3 | Documentation This is doc 4 | 5 | Suite Teardown Keyword 6 | 7 | Task Tags tag 8 | 9 | 10 | *** Variables *** 11 | ${VAR} ${TRUE} 12 | 13 | 14 | *** Test Cases *** 15 | Pierwszy test 16 | [Setup] 17 | [Tags] 18 | Słowo kluczowe 19 | 20 | Dokumentacja 21 | [Documentation] This is doc 22 | No Operation 23 | 24 | *** Keywords *** 25 | Keyword 26 | [Arguments] ${arg} 27 | IF $condition 28 | Log ${arg} 29 | ELSE 30 | BREAK 31 | END 32 | -------------------------------------------------------------------------------- /tests/atest/transformers/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarketSquare/robotframework-tidy/a4940bdc61b5afb8af1e0036d1658b2d0a550ab6/tests/atest/transformers/__init__.py -------------------------------------------------------------------------------- /tests/conftest.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | def pytest_addoption(parser): 5 | parser.addoption("--e2e", action="store_true", default=False, help="Run end to end tests") 6 | 7 | 8 | def pytest_configure(config): 9 | config.addinivalue_line("markers", "e2e: mark tests as end to end tests") 10 | 11 | 12 | def pytest_collection_modifyitems(config, items): 13 | if config.getoption("--e2e"): 14 | return 15 | skip_e2e = pytest.mark.skip(reason="Need --e2e option to run") 16 | for item in items: 17 | if "e2e" in item.keywords: 18 | item.add_marker(skip_e2e) 19 | -------------------------------------------------------------------------------- /tests/e2e/test_data/too_long_variable.robot: -------------------------------------------------------------------------------- 1 | *** Variables *** 2 | &{sync modules} 3 | ... over_the_top_of_reasonable_super_duper_really_Over_the_top_Really_Extra_ordinarily_long_key_1=value1 4 | ${thing2} 5 | ... over_the_top_of_reasonable_super_duper_really_Over_the_top_Really_Extra_ordinarily_long_string_no_I_mean_really_really_long 6 | -------------------------------------------------------------------------------- /tests/pytest.ini: -------------------------------------------------------------------------------- 1 | [pytest] 2 | addopts = -p no:warnings 3 | -------------------------------------------------------------------------------- /tests/rf_versions_matrix/rf4/requirements.txt: -------------------------------------------------------------------------------- 1 | robotframework==4.1.3 -------------------------------------------------------------------------------- /tests/rf_versions_matrix/rf5/requirements.txt: -------------------------------------------------------------------------------- 1 | robotframework==5.0.1 -------------------------------------------------------------------------------- /tests/rf_versions_matrix/rf6/requirements.txt: -------------------------------------------------------------------------------- 1 | robotframework==6.1.1 2 | -------------------------------------------------------------------------------- /tests/rf_versions_matrix/rf7/requirements.txt: -------------------------------------------------------------------------------- 1 | robotframework==7.2 -------------------------------------------------------------------------------- /tests/utest/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarketSquare/robotframework-tidy/a4940bdc61b5afb8af1e0036d1658b2d0a550ab6/tests/utest/__init__.py -------------------------------------------------------------------------------- /tests/utest/testdata/auto_line_sep/.gitattributes: -------------------------------------------------------------------------------- 1 | *.robot -text -------------------------------------------------------------------------------- /tests/utest/testdata/auto_line_sep/cr.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** Library stuff.py -------------------------------------------------------------------------------- /tests/utest/testdata/auto_line_sep/crlf.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Library stuff.py 3 | -------------------------------------------------------------------------------- /tests/utest/testdata/auto_line_sep/crlf_mixed.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Library stuff.py 3 | -------------------------------------------------------------------------------- /tests/utest/testdata/auto_line_sep/empty.robot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarketSquare/robotframework-tidy/a4940bdc61b5afb8af1e0036d1658b2d0a550ab6/tests/utest/testdata/auto_line_sep/empty.robot -------------------------------------------------------------------------------- /tests/utest/testdata/auto_line_sep/lf.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Library stuff.py 3 | -------------------------------------------------------------------------------- /tests/utest/testdata/check/golden.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Test Template Keyword -------------------------------------------------------------------------------- /tests/utest/testdata/check/not_golden.robot: -------------------------------------------------------------------------------- 1 | *** settings *** 2 | Test Template Keyword -------------------------------------------------------------------------------- /tests/utest/testdata/config.txt: -------------------------------------------------------------------------------- 1 | [main] 2 | overwrite = false 3 | diff = false 4 | spacecount = 4 5 | 6 | [transform] 7 | [transform.DiscardEmptySections] 8 | allow_only_comments = true 9 | -------------------------------------------------------------------------------- /tests/utest/testdata/config/robotidy.toml: -------------------------------------------------------------------------------- 1 | [tool.robotidy] 2 | overwrite = false 3 | diff = false 4 | spacecount = 4 5 | transform = [ 6 | "DiscardEmptySections:allow_only_comments=True", 7 | "ReplaceRunKeywordIf" 8 | ] -------------------------------------------------------------------------------- /tests/utest/testdata/config_with_custom_transformers/CustomTransformer.py: -------------------------------------------------------------------------------- 1 | class CustomTransformer: 2 | pass 3 | -------------------------------------------------------------------------------- /tests/utest/testdata/config_with_custom_transformers/custom_transformers.toml: -------------------------------------------------------------------------------- 1 | [tool.robotidy] 2 | custom_transformers = ["CustomTransformer.py"] 3 | -------------------------------------------------------------------------------- /tests/utest/testdata/config_with_custom_transformers/load_transformers.toml: -------------------------------------------------------------------------------- 1 | [tool.robotidy] 2 | load_transformers = ["CustomTransformer.py"] 3 | -------------------------------------------------------------------------------- /tests/utest/testdata/disablers/empty.robot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarketSquare/robotframework-tidy/a4940bdc61b5afb8af1e0036d1658b2d0a550ab6/tests/utest/testdata/disablers/empty.robot -------------------------------------------------------------------------------- /tests/utest/testdata/disablers/open_disabler_in_section.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Test Template Template 3 | Tags tag 4 | ... tag2 5 | # robotidy: off 6 | Suite Setup Keyword 7 | Documentation Suite documentation 8 | 9 | *** Test Cases *** 10 | Test 11 | No Operation 12 | 13 | # robotidy: off 14 | 15 | 16 | *** Keywords *** 17 | Keyword 18 | Other Keyword 19 | 20 | # robotidy: off 21 | 22 | Other Keyword ${embed} 23 | RETURN ${embed} 24 | -------------------------------------------------------------------------------- /tests/utest/testdata/empty_pyproject1/pyproject.toml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarketSquare/robotframework-tidy/a4940bdc61b5afb8af1e0036d1658b2d0a550ab6/tests/utest/testdata/empty_pyproject1/pyproject.toml -------------------------------------------------------------------------------- /tests/utest/testdata/empty_pyproject2/pyproject.toml: -------------------------------------------------------------------------------- 1 | [tool.robocop] -------------------------------------------------------------------------------- /tests/utest/testdata/gitignore/.gitignore: -------------------------------------------------------------------------------- 1 | test2.robot 2 | repo/ -------------------------------------------------------------------------------- /tests/utest/testdata/gitignore/nested/test.robot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarketSquare/robotframework-tidy/a4940bdc61b5afb8af1e0036d1658b2d0a550ab6/tests/utest/testdata/gitignore/nested/test.robot -------------------------------------------------------------------------------- /tests/utest/testdata/gitignore/nested/test2.robot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarketSquare/robotframework-tidy/a4940bdc61b5afb8af1e0036d1658b2d0a550ab6/tests/utest/testdata/gitignore/nested/test2.robot -------------------------------------------------------------------------------- /tests/utest/testdata/gitignore/test.resource: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarketSquare/robotframework-tidy/a4940bdc61b5afb8af1e0036d1658b2d0a550ab6/tests/utest/testdata/gitignore/test.resource -------------------------------------------------------------------------------- /tests/utest/testdata/gitignore/test.robot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarketSquare/robotframework-tidy/a4940bdc61b5afb8af1e0036d1658b2d0a550ab6/tests/utest/testdata/gitignore/test.robot -------------------------------------------------------------------------------- /tests/utest/testdata/gitignore/test.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarketSquare/robotframework-tidy/a4940bdc61b5afb8af1e0036d1658b2d0a550ab6/tests/utest/testdata/gitignore/test.txt -------------------------------------------------------------------------------- /tests/utest/testdata/gitignore/test2.robot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarketSquare/robotframework-tidy/a4940bdc61b5afb8af1e0036d1658b2d0a550ab6/tests/utest/testdata/gitignore/test2.robot -------------------------------------------------------------------------------- /tests/utest/testdata/invalid_options_config/pyproject_confgure.toml: -------------------------------------------------------------------------------- 1 | [tool.robotidy] 2 | overwrite = false 3 | diff = false 4 | startline = 10 5 | endline = 20 6 | transform = [ 7 | "DiscardEmptySections:allow_only_comments=True", 8 | "SplitTooLongLine" 9 | ] 10 | confgure = [ 11 | "DiscardEmptySections:allow_only_comments=False", 12 | "OrderSettings: keyword_before = documentation,tags,timeout,arguments" 13 | ] -------------------------------------------------------------------------------- /tests/utest/testdata/invalid_options_config/pyproject_idontexist.toml: -------------------------------------------------------------------------------- 1 | [tool.robotidy] 2 | idontexist = 10 3 | overwrite = false 4 | diff = false 5 | startline = 10 6 | endline = 20 7 | transform = [ 8 | "DiscardEmptySections:allow_only_comments=True", 9 | "SplitTooLongLine" 10 | ] 11 | configure = [ 12 | "DiscardEmptySections:allow_only_comments=False", 13 | "OrderSettings: keyword_before = documentation,tags,timeout,arguments" 14 | ] -------------------------------------------------------------------------------- /tests/utest/testdata/invalid_pyproject/pyproject.toml: -------------------------------------------------------------------------------- 1 | [tool.robotidy] 2 | overwrite = false 3 | diff = false 4 | spacecount = 4 5 | transform = [ 6 | "DiscardEmptySections:allow_only_comments=True", 7 | ReplaceRunKeywordIf 8 | ] -------------------------------------------------------------------------------- /tests/utest/testdata/line_sep/expected.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Library library.py 3 | 4 | Force Tags tag 5 | 6 | 7 | *** Keywords *** 8 | Keyword 9 | Log information 10 | No Operation 11 | -------------------------------------------------------------------------------- /tests/utest/testdata/line_sep/test.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Library library.py 3 | 4 | Force Tags tag 5 | 6 | *** Keywords *** 7 | Keyword 8 | Log information 9 | No Operation 10 | -------------------------------------------------------------------------------- /tests/utest/testdata/nested/nested/deeper/test.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | Test 3 | No Operation 4 | -------------------------------------------------------------------------------- /tests/utest/testdata/nested/robotidy.toml: -------------------------------------------------------------------------------- 1 | [tool.robotidy] 2 | overwrite = false 3 | diff = false 4 | spacecount = 4 5 | transform = [ 6 | "DiscardEmptySections:allow_only_comments=True", 7 | "ReplaceRunKeywordIf" 8 | ] -------------------------------------------------------------------------------- /tests/utest/testdata/only_pyproject/pyproject.toml: -------------------------------------------------------------------------------- 1 | [tool.robotidy] 2 | overwrite = false 3 | diff = false 4 | startline = 10 5 | endline = 20 6 | continuation-indent = 2 7 | exclude = "Regex\\s" 8 | transform = [ 9 | "DiscardEmptySections:allow_only_comments=True", 10 | "SplitTooLongLine" 11 | ] 12 | configure = [ 13 | "DiscardEmptySections:allow_only_comments=False", 14 | "OrderSettings: keyword_before = documentation,tags,timeout,arguments" 15 | ] -------------------------------------------------------------------------------- /tests/utest/testdata/pyproject_with_src/pyproject.toml: -------------------------------------------------------------------------------- 1 | [tool.robotidy] 2 | verbose = true 3 | src = [ 4 | 'test.robot', 5 | 'idontexist.robot', 6 | 'resources' 7 | ] 8 | startline = 10 9 | endline = 20 10 | transform = [ 11 | "DiscardEmptySections:allow_only_comments=True", 12 | "OrderSettings", 13 | "SplitTooLongLine" 14 | ] 15 | configure = [ 16 | "DiscardEmptySections:allow_only_comments=False", 17 | "OrderSettings: keyword_before = documentation,tags,timeout,arguments" 18 | ] -------------------------------------------------------------------------------- /tests/utest/testdata/pyproject_with_src/resources/test.robot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarketSquare/robotframework-tidy/a4940bdc61b5afb8af1e0036d1658b2d0a550ab6/tests/utest/testdata/pyproject_with_src/resources/test.robot -------------------------------------------------------------------------------- /tests/utest/testdata/pyproject_with_src/test.robot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarketSquare/robotframework-tidy/a4940bdc61b5afb8af1e0036d1658b2d0a550ab6/tests/utest/testdata/pyproject_with_src/test.robot -------------------------------------------------------------------------------- /tests/utest/testdata/pyproject_with_src/test3.robot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarketSquare/robotframework-tidy/a4940bdc61b5afb8af1e0036d1658b2d0a550ab6/tests/utest/testdata/pyproject_with_src/test3.robot -------------------------------------------------------------------------------- /tests/utest/testdata/read_only/test.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | 3 | 4 | 5 | 6 | 7 | 8 | *** Test Cases *** 9 | Test 10 | Test 11 | -------------------------------------------------------------------------------- /tests/utest/testdata/with_git_dir/project_a/test.robot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarketSquare/robotframework-tidy/a4940bdc61b5afb8af1e0036d1658b2d0a550ab6/tests/utest/testdata/with_git_dir/project_a/test.robot -------------------------------------------------------------------------------- /tests/utest/testdata/with_git_dir/pyproject.toml: -------------------------------------------------------------------------------- 1 | [tool.robotidy] 2 | overwrite = false -------------------------------------------------------------------------------- /utils/new_transformer_templates/docs.template: -------------------------------------------------------------------------------- 1 | .. _{{ transformer_name }}: 2 | 3 | {{ transformer_name }} 4 | ================================ 5 | Short description. 6 | 7 | {% if disabled %} 8 | .. |TRANSFORMERNAME| replace:: {{ transformer_name }} 9 | .. include:: disabled_hint.txt 10 | 11 | {% else %} 12 | .. |TRANSFORMERNAME| replace:: {{ transformer_name }} 13 | .. include:: enabled_hint.txt 14 | {% endif %} 15 | 16 | Long description with code examples. 17 | -------------------------------------------------------------------------------- /utils/new_transformer_templates/test_transformer.template: -------------------------------------------------------------------------------- 1 | from tests.atest import TransformerAcceptanceTest 2 | 3 | 4 | class Test{{ transformer_name }}(TransformerAcceptanceTest): 5 | TRANSFORMER_NAME = "{{ transformer_name }}" 6 | 7 | def test_transformer(self): 8 | self.compare(source="test.robot", expected="test.robot") 9 | -------------------------------------------------------------------------------- /utils/new_transformer_templates/transformer.template: -------------------------------------------------------------------------------- 1 | from robot.api.parsing import ModelTransformer 2 | 3 | 4 | class {{ transformer_name }}(ModelTransformer): 5 | """ 6 | Short description in one line. 7 | 8 | Long description with short example before/after. 9 | """ 10 | {% if disabled -%} 11 | ENABLED = False 12 | {% endif %} 13 | def visit_File(self, node): # noqa 14 | return node 15 | 16 | -------------------------------------------------------------------------------- /utils/release_docs_templates/new_release.template: -------------------------------------------------------------------------------- 1 | Robotidy {{ version }} 2 | ========================================= 3 | 4 | 5 | You can install the latest available version by running:: 6 | 7 | pip install --upgrade robotframework-tidy 8 | 9 | or to install exactly this version:: 10 | 11 | pip install robotframework-tidy=={{ version }} 12 | 13 | --------------------------------------------------------------------------------