Skip to content

Commit

Permalink
Add additional test, use raw-string for regex
Browse files Browse the repository at this point in the history
  • Loading branch information
netzvieh committed Apr 2, 2019
1 parent 082a74a commit c74f5fd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ansiblelint/rules/VariableHasSpacesRule.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class VariableHasSpacesRule(AnsibleLintRule):
tags = ['formatting']
version_added = 'v4.0.0'

bracket_regex = re.compile("{{[^{' -]|[^ '}-]}}")
bracket_regex = re.compile(r"{{[^{' -]|[^ '}-]}}")

def match(self, file, line):
return self.bracket_regex.search(line)
1 change: 1 addition & 0 deletions test/TestVariableHasSpaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
msg: |
{{ good_format }}/
{{- good_format }}
{{- good_format -}}
- name: bad variable format
debug:
msg: "{{bad_format}}"
Expand Down

0 comments on commit c74f5fd

Please sign in to comment.