File tree Expand file tree Collapse file tree 5 files changed +29
-2
lines changed Expand file tree Collapse file tree 5 files changed +29
-2
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ class AlignVariablesSection(ModelTransformer):
3535 def visit_VariableSection (self , node ): # noqa
3636 statements = []
3737 for child in node .body :
38- if child .type == ' EOL' :
38+ if child .type in ( Token . EOL , Token . COMMENT ) :
3939 statements .append (child )
4040 else :
4141 statements .append (list (self .tokens_by_lines (child )))
Original file line number Diff line number Diff line change 1- __version__ = '1.1.0 '
1+ __version__ = '1.1.1 '
Original file line number Diff line number Diff line change 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 }
Original file line number Diff line number Diff line change 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 }
Original file line number Diff line number Diff line change @@ -296,3 +296,6 @@ def test_align_variables(self):
296296
297297 def test_align_with_optional_equal_signs (self ):
298298 run_tidy_and_compare (self .TRANSFORMER_NAME , sources = ['optional_equal_sign.robot' ])
299+
300+ def test_align_with_long_comment (self ):
301+ run_tidy_and_compare (self .TRANSFORMER_NAME , sources = ['long_comment.robot' ])
You can’t perform that action at this time.
0 commit comments