Skip to content

Commit

Permalink
Update release docs (#1096)
Browse files Browse the repository at this point in the history
  • Loading branch information
bhirsz authored Jun 18, 2024
1 parent 3474768 commit e8066ae
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
9 changes: 9 additions & 0 deletions docs/releasenotes/unreleased/rules.2.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
New first-argument-in-new-line rule (#1001)
-------------------------------------------

New W1018 ``first-argument-in-new-line`` rule that checks if first argument is placed in the same line as
``[Argument]`` setting.

This rule covers Robot Framework Style Guide recommendation:

https://docs.robotframework.org/docs/style_guide#line-continuation-for-arguments-in-keyword-definition
4 changes: 2 additions & 2 deletions robocop/checkers/spacing.py
Original file line number Diff line number Diff line change
Expand Up @@ -970,13 +970,13 @@ def parse_error(self, node, error):
class ArgumentsChecker(VisitorChecker):
reports = ("first-argument-in-new-line",)

def visit_Arguments(self, node):
def visit_Arguments(self, node): # noqa
eol_already = None
for t in node.tokens:
if t.type == Token.EOL:
eol_already = t
continue
elif t.type == Token.ARGUMENT:
if t.type == Token.ARGUMENT:
if eol_already is not None:
self.report(
"first-argument-in-new-line",
Expand Down

0 comments on commit e8066ae

Please sign in to comment.