diff --git a/docs/releasenotes/unreleased/rules.2.rst b/docs/releasenotes/unreleased/rules.2.rst new file mode 100644 index 00000000..2ea31a3a --- /dev/null +++ b/docs/releasenotes/unreleased/rules.2.rst @@ -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 diff --git a/robocop/checkers/spacing.py b/robocop/checkers/spacing.py index e23074b0..a25e1fd5 100644 --- a/robocop/checkers/spacing.py +++ b/robocop/checkers/spacing.py @@ -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",