fix: remove with_items from CheckDeprecatedBareVars rule (#593)

This commit is contained in:
Robert Kaussow 2023-04-27 09:22:07 +02:00 committed by GitHub
parent 58cf4cb09e
commit 9dad9cdb5f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 3 deletions

View File

@ -29,7 +29,7 @@ class CheckDeprecatedBareVars(StandardBase):
sid = "ANSIBLE0027" sid = "ANSIBLE0027"
description = "Deprecated bare variables in loops must not be used" description = "Deprecated bare variables in loops must not be used"
helptext = ( helptext = (
"bare var '{barevar}' in '{loop_type}' must use full var syntax ('{{{{ {barevar} }}}}') " "bare var '{barevar}' in '{loop_type}' must use full var syntax '{{{{ {barevar} }}}}' "
"or be converted to a list" "or be converted to a list"
) )
version = "0.3" version = "0.3"
@ -46,7 +46,6 @@ class CheckDeprecatedBareVars(StandardBase):
continue continue
if loop_type in [ if loop_type in [
"with_items",
"with_nested", "with_nested",
"with_together", "with_together",
"with_flattened", "with_flattened",
@ -85,6 +84,6 @@ class CheckDeprecatedBareVars(StandardBase):
self.errors.append( self.errors.append(
self.Error( self.Error(
task["__line__"], task["__line__"],
self.helptext.format(barevar=task[loop_type], loop_type=loop_type) self.helptext.format(barevar=varstring, loop_type=loop_type)
) )
) )