NormalizeNewLines¶
Normalize new lines.
Disabling the formatter
NormalizeNewLines is included in the default formatters, but it can be also run separately with:
You can also disable it:
Ensure that there is exactly:
-
section_lines = 2empty lines between sections, -
test_case_lines = 1empty lines between test cases, -
keyword_lines = test_case_linesempty lines between keywords.
Removes empty lines after section (and before any data) and appends 1 empty line at the end of file.
This data is ignored at runtime but should be preserved by Tidy.
*** Variables ***
# standalone comment
${VALID} Value
# standalone
*** Test Cases ***
Test
[Documentation] This is a documentation
... in two lines
Some Lines
No Operation
[Teardown] 1 minute args
Test Without Arg
Mid Test
My Step 1 args args 2 args 3 args 4 args 5 args 6
... args 7 args 8 args 9 # step 1 comment
*** Keywords ***
Keyword
No Operation
Other Keyword
Another Keyword
There
Are
More
*** Settings ***
Library library.py
This data is ignored at runtime but should be preserved by Tidy.
*** Variables ***
# standalone comment
${VALID} Value
# standalone
*** Test Cases ***
Test
[Documentation] This is a documentation
... in two lines
Some Lines
No Operation
[Teardown] 1 minute args
Test Without Arg
Mid Test
My Step 1 args args 2 args 3 args 4 args 5 args 6
... args 7 args 8 args 9 # step 1 comment
*** Keywords ***
Keyword
No Operation
Other Keyword
Another Keyword
There
Are
More
*** Settings ***
Library library.py
Parameters section_lines, test_case_lines and keyword_lines can be configured to other values:
will result in:
Consecutive empty lines inside settings, variables, keywords and test cases are also removed
(configurable via consecutive_lines = 1).
If set to 0 all empty lines will be removed:
will result in:
If the suite contains Test Template tests will not be separated by empty lines unless separate_templated_tests
is set to True.
Language header¶
Files that begin with the language marker are handled differently.
If the section contains only language marker and no more empty lines than the value of section_lines,
it will be not formatted.
The following examples will not be formatted since the number of empty lines is lower or equal to default value of section_lines:
Section will be formatted if it contains more empty lines than section_lines or has statements other than
language marker:
With extra comments:
Skip formatting¶
It is possible to use the following arguments to skip formatting of the code:
It is also possible to use disablers but skip option makes it easier to skip all instances of a given type
of the code.