Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

## 2.3.1

Fix for ``SplitTooLongLine`` transformer breaking keywords with veeery long names ([#314](https://github.com/MarketSquare/robotframework-tidy/issues/314))

### Extra ``--indent`` option

Robotidy normalizes all whitespaces using the same fixed amount of spaces (configurable via ``--spacecount``).
Expand Down
4 changes: 2 additions & 2 deletions robotidy/transformers/SplitTooLongLine.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ def is_inline(node):
def visit_KeywordCall(self, node): # noqa
if all(line[-1].end_col_offset < self.line_length for line in node.lines):
return node
if not len(node.data_tokens) > 1: # nothing to split anyway
return node
if self.disablers.is_node_disabled(node, full_match=False):
return node
return self.split_keyword_call(node)
Expand All @@ -113,11 +115,9 @@ def split_keyword_call(self, node):
separator = Token(Token.SEPARATOR, self.formatting_config.separator)
indent = node.tokens[0]

split_every_arg = self.split_on_every_arg
keyword = node.get_token(Token.KEYWORD)
line = [indent, *self.join_on_separator(node.get_tokens(Token.ASSIGN), separator), keyword]
if not self.col_fit_in_line(line):
split_every_arg
head = [
*self.split_to_multiple_lines(node.get_tokens(Token.ASSIGN), indent=indent, separator=separator),
indent,
Expand Down
2 changes: 1 addition & 1 deletion robotidy/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "2.4"
__version__ = "2.4.1"
Original file line number Diff line number Diff line change
Expand Up @@ -153,3 +153,13 @@ If - else if - else clause

Too long inline IF # shall be handled by InlineIf transformer
${var} ${var2} IF $condition != $condition2 Longer Keyword Name ${argument} values ELSE IF $condition2 Short Keyword ${arg} # comment

Keyword name over the limit
Enter "${VNFname}" in the field with XPath "//label[contains(text(), 'Product Name')]/../mat-form-field/div/div/div/textarea"

${assign}
... Enter "${VNFname}" in the field with XPath "//label[contains(text(), 'Product Name')]/../mat-form-field/div/div/div/textarea"

${assign}
... ${assign}
... Enter "${VNFname}" in the field with XPath "//label[contains(text(), 'Product Name')]/../mat-form-field/div/div/div/textarea"
Original file line number Diff line number Diff line change
Expand Up @@ -156,3 +156,13 @@ Too long inline IF # shall be handled by InlineIf transformer
${var} ${var2} IF $condition != $condition2 Longer Keyword Name
... ${argument} values ELSE IF $condition2 Short Keyword
... ${arg}

Keyword name over the limit
Enter "${VNFname}" in the field with XPath "//label[contains(text(), 'Product Name')]/../mat-form-field/div/div/div/textarea"

${assign}
... Enter "${VNFname}" in the field with XPath "//label[contains(text(), 'Product Name')]/../mat-form-field/div/div/div/textarea"

${assign}
... ${assign}
... Enter "${VNFname}" in the field with XPath "//label[contains(text(), 'Product Name')]/../mat-form-field/div/div/div/textarea"
Original file line number Diff line number Diff line change
Expand Up @@ -324,3 +324,13 @@ If - else if - else clause

Too long inline IF # shall be handled by InlineIf transformer
${var} ${var2} IF $condition != $condition2 Longer Keyword Name ${argument} values ELSE IF $condition2 Short Keyword ${arg} # comment

Keyword name over the limit
Enter "${VNFname}" in the field with XPath "//label[contains(text(), 'Product Name')]/../mat-form-field/div/div/div/textarea"

${assign}
... Enter "${VNFname}" in the field with XPath "//label[contains(text(), 'Product Name')]/../mat-form-field/div/div/div/textarea"

${assign}
... ${assign}
... Enter "${VNFname}" in the field with XPath "//label[contains(text(), 'Product Name')]/../mat-form-field/div/div/div/textarea"
Original file line number Diff line number Diff line change
Expand Up @@ -333,3 +333,13 @@ Too long inline IF # shall be handled by InlineIf transformer
... $condition2
... Short Keyword
... ${arg}

Keyword name over the limit
Enter "${VNFname}" in the field with XPath "//label[contains(text(), 'Product Name')]/../mat-form-field/div/div/div/textarea"

${assign}
... Enter "${VNFname}" in the field with XPath "//label[contains(text(), 'Product Name')]/../mat-form-field/div/div/div/textarea"

${assign}
... ${assign}
... Enter "${VNFname}" in the field with XPath "//label[contains(text(), 'Product Name')]/../mat-form-field/div/div/div/textarea"
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,10 @@ If - else if - else clause

Too long inline IF # shall be handled by InlineIf transformer
${var} ${var2} IF $condition != $condition2 Longer Keyword Name ${argument} values ELSE IF $condition2 Short Keyword ${arg} # comment

Keyword name over the limit
Enter "${VNFname}" in the field with XPath "//label[contains(text(), 'Product Name')]/../mat-form-field/div/div/div/textarea"

${assign} Enter "${VNFname}" in the field with XPath "//label[contains(text(), 'Product Name')]/../mat-form-field/div/div/div/textarea"

${assign} ${assign} Enter "${VNFname}" in the field with XPath "//label[contains(text(), 'Product Name')]/../mat-form-field/div/div/div/textarea"