From fa80182396cdc0d66d9ce19b1fd5fad6ee18663d Mon Sep 17 00:00:00 2001 From: Fredy P Date: Tue, 19 Mar 2019 14:42:09 -0400 Subject: [PATCH] keyword: add tags function This commit copy-pastes the `tags` function from testcase.py --- rflint/parser/rfkeyword.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/rflint/parser/rfkeyword.py b/rflint/parser/rfkeyword.py index e41682d..fd5fd05 100644 --- a/rflint/parser/rfkeyword.py +++ b/rflint/parser/rfkeyword.py @@ -20,3 +20,12 @@ def __repr__(self): # should this return the fully qualified name? return "" % self.name + # this is great, except that we don't return the line number + # or character position of each tag. The linter needs that. :-( + @property + def tags(self): + tags = [] + for statement in self.statements: + if len(statement) > 2 and statement[1].lower() == "[tags]": + tags = tags + statement[2:] + return tags