Skip to content

Commit 69e407e

Browse files
authored
Separate sections by two empty lines (#276)
1 parent a35862a commit 69e407e

File tree

15 files changed

+62
-15
lines changed

15 files changed

+62
-15
lines changed

CHANGES.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,36 @@
11
# Change Log
22

3-
## Unreleased
3+
## 2.1
4+
5+
### Transformers
6+
- Updated `NormalizeNewLines` to separate sections by two empty lines (instead of one). It's effort of normalizing
7+
Robocop output (which suggest to use 2 empty lines) and Robotidy (which previously transformed with 1 empty line) ([#536](https://github.com/MarketSquare/robotframework-robocop/issues/536)).
8+
9+
Previously:
10+
```
11+
*** Settings ***
12+
Force Tags tag
13+
14+
*** Test Cases ***
15+
Test
16+
No Operation
17+
```
18+
19+
Now:
20+
```
21+
*** Settings ***
22+
Force Tags tag
23+
24+
25+
*** Test Cases ***
26+
Test
27+
No Operation
28+
```
29+
30+
### Other
31+
- Add missing packaging dependency ([#275](https://github.com/MarketSquare/robotframework-tidy/issues/275))
32+
33+
## 2.0.0
434

535
### Transformers
636
- New `ReplaceReturns` transformer that replaces return statements (such as `[Return]` setting or `Return From Keyword` keyword) with `RETURN` statement ([#231](https://github.com/MarketSquare/robotframework-tidy/issues/231))

robotidy/transformers/NormalizeNewLines.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def __init__(
2929
self,
3030
test_case_lines: int = 1,
3131
keyword_lines: Optional[int] = None,
32-
section_lines: int = 1,
32+
section_lines: int = 2,
3333
separate_templated_tests: bool = False,
3434
consecutive_lines: int = 1,
3535
):

robotidy/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "2.0"
1+
__version__ = "2.1"

tests/atest/transformers/MergeAndOrderSections/expected/inline_if.robot

Lines changed: 0 additions & 7 deletions
This file was deleted.

tests/atest/transformers/MergeAndOrderSections/test_transformer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,4 @@ def test_invalid_order_parameter(self, parameter):
6969
assert expected_output == result.output
7070

7171
def test_inline_if(self):
72-
self.compare("inline_if.robot")
72+
self.compare(source="inline_if.robot", not_modified=True)

tests/atest/transformers/NormalizeNewLines/expected/consecutive_empty_lines_0line.robot

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Resource resource.robot
33
Default Tags tag
44
Documentation doc
55
6+
67
*** Test Cases ***
78
Test Capitalized
89
Pass Execution
@@ -18,6 +19,7 @@ Test with first letter capitalized
1819
# no test case name
1920
Log To Console hello
2021

22+
2123
*** Keywords ***
2224
Keyword
2325
Empty Line Before

tests/atest/transformers/NormalizeNewLines/expected/consecutive_empty_lines_1line.robot

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Default Tags tag
55

66
Documentation doc
77
8+
89
*** Test Cases ***
910
Test Capitalized
1011
Pass Execution
@@ -21,6 +22,7 @@ Test with first letter capitalized
2122
# no test case name
2223
Log To Console hello
2324

25+
2426
*** Keywords ***
2527
Keyword
2628
Empty Line Before

tests/atest/transformers/NormalizeNewLines/expected/consecutive_empty_lines_2line.robot

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Default Tags tag
66

77
Documentation doc
88
9+
910
*** Test Cases ***
1011
Test Capitalized
1112
Pass Execution
@@ -23,6 +24,7 @@ Test with first letter capitalized
2324
# no test case name
2425
Log To Console hello
2526

27+
2628
*** Keywords ***
2729
Keyword
2830
Empty Line Before

tests/atest/transformers/NormalizeNewLines/expected/inline_if.robot

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
foo
33
No Operation
44

5+
56
*** Keywords ***
67
Bar
78
IF ${True} No Operation

tests/atest/transformers/NormalizeNewLines/expected/templated_tests.robot

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
This data is ignored at runtime but should be preserved by Tidy.
22

3+
34
*** Variables ***
45
# standalone comment
56
${VALID} Value
67
MyVar val1 val2 val3 val4 val5 val6 val7
78
... val8 val9 val10 # var comment
89
# standalone
910

11+
1012
*** Test Cases ***
1113
Test arg1 arg2
1214
Test Without Arg
1315
Mid Test
1416
My Step 1 args args 2 args 3
1517

18+
1619
*** Keywords ***
1720
Keyword
1821
No Operation
@@ -24,6 +27,7 @@ Another Keyword
2427
Are
2528
More
2629

30+
2731
*** Settings ***
2832
Library library.py
2933
Test Template Template For Tests In This Suite

0 commit comments

Comments
 (0)