Skip to content

Commit

Permalink
Remove leading newlines from test examples (#1179)
Browse files Browse the repository at this point in the history
Needed-By: #955
  • Loading branch information
ssbarnea committed Dec 30, 2020
1 parent 87741a4 commit d257716
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
26 changes: 13 additions & 13 deletions test/TestNestedJinjaRule.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@

from ansiblelint.file_utils import Lintable

FAIL_TASK_1LN = Lintable('playbook.yml', '''
FAIL_TASK_1LN = Lintable('playbook.yml', '''\
- hosts: all
tasks:
- name: one-level nesting
set_fact:
var_one: "2*(1+2) is {{ 2 * {{ 1 + 2 }} }}"
''')

FAIL_TASK_1LN_M = Lintable('playbook.yml', '''
FAIL_TASK_1LN_M = Lintable('playbook.yml', '''\
- hosts: all
tasks:
- name: one-level multiline nesting
Expand All @@ -43,15 +43,15 @@
}}
''')

FAIL_TASK_2LN = Lintable('playbook.yml', '''
FAIL_TASK_2LN = Lintable('playbook.yml', '''\
- hosts: all
tasks:
- name: two-level nesting
set_fact:
var_two: "2*(1+(3-1)) is {{ 2 * {{ 1 + {{ 3 - 1 }} }} }}"
''')

FAIL_TASK_2LN_M = Lintable('playbook.yml', '''
FAIL_TASK_2LN_M = Lintable('playbook.yml', '''\
- hosts: all
tasks:
- name: two-level multiline nesting
Expand All @@ -63,15 +63,15 @@
}} }}
''')

FAIL_TASK_W_5LN = Lintable('playbook.yml', '''
FAIL_TASK_W_5LN = Lintable('playbook.yml', '''\
- hosts: all
tasks:
- name: five-level wild nesting
set_fact:
var_three_wld: "{{ {{ {{ {{ {{ 234 }} }} }} }} }}"
''')

FAIL_TASK_W_5LN_M = Lintable('playbook.yml', '''
FAIL_TASK_W_5LN_M = Lintable('playbook.yml', '''\
- hosts: all
tasks:
- name: five-level wild multiline nesting
Expand All @@ -88,15 +88,15 @@
}}
''')

SUCCESS_TASK_P = Lintable('playbook.yml', '''
SUCCESS_TASK_P = Lintable('playbook.yml', '''\
- hosts: all
tasks:
- name: non-nested example
set_fact:
var_one: "number for 'one' is {{ 2 * 1 }}"
''')

SUCCESS_TASK_P_M = Lintable('playbook.yml', '''
SUCCESS_TASK_P_M = Lintable('playbook.yml', '''\
- hosts: all
tasks:
- name: multiline non-nested example
Expand All @@ -106,15 +106,15 @@
2 * 1 }}
''')

SUCCESS_TASK_2P = Lintable('playbook.yml', '''
SUCCESS_TASK_2P = Lintable('playbook.yml', '''\
- hosts: all
tasks:
- name: nesting far from each other
set_fact:
var_two: "number for 'two' is {{ 2 * 1 }} and number for 'three' is {{ 4 - 1 }}"
''')

SUCCESS_TASK_2P_M = Lintable('playbook.yml', '''
SUCCESS_TASK_2P_M = Lintable('playbook.yml', '''\
- hosts: all
tasks:
- name: multiline nesting far from each other
Expand All @@ -125,15 +125,15 @@
4 - 1 }}
''')

SUCCESS_TASK_C_2P = Lintable('playbook.yml', '''
SUCCESS_TASK_C_2P = Lintable('playbook.yml', '''\
- hosts: all
tasks:
- name: nesting close to each other
set_fact:
var_three: "number for 'ten' is {{ 2 - 1 }}{{ 3 - 3 }}"
''')

SUCCESS_TASK_C_2P_M = Lintable('playbook.yml', '''
SUCCESS_TASK_C_2P_M = Lintable('playbook.yml', '''\
- hosts: all
tasks:
- name: multiline nesting close to each other
Expand All @@ -144,7 +144,7 @@
}}{{ 3 - 3 }}
''')

SUCCESS_TASK_PRINT = Lintable('playbook.yml', '''
SUCCESS_TASK_PRINT = Lintable('playbook.yml', '''\
- hosts: all
tasks:
- name: print curly braces
Expand Down
4 changes: 2 additions & 2 deletions test/TestSkipImportPlaybook.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

from ansiblelint.runner import Runner

IMPORTED_PLAYBOOK = '''
IMPORTED_PLAYBOOK = '''\
- hosts: all
tasks:
- name: success
fail: msg="fail"
when: false
'''

MAIN_PLAYBOOK = '''
MAIN_PLAYBOOK = '''\
- hosts: all
tasks:
Expand Down
10 changes: 5 additions & 5 deletions test/TestSkipInsideYaml.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import pytest

ROLE_TASKS = '''
ROLE_TASKS = '''\
---
- name: test 303
command: git log
Expand All @@ -10,7 +10,7 @@
changed_when: false
'''

ROLE_TASKS_WITH_BLOCK = '''
ROLE_TASKS_WITH_BLOCK = '''\
---
- name: bad git 1 # noqa 401
action: git a=b c=d
Expand All @@ -34,7 +34,7 @@
action: git a=b c=d
'''

PLAYBOOK = '''
PLAYBOOK = '''\
- hosts: all
tasks:
- name: test 402
Expand Down Expand Up @@ -75,14 +75,14 @@
- skip_ansible_lint
'''

ROLE_META = '''
ROLE_META = '''\
galaxy_info: # noqa 701
author: your name # noqa 703
description: missing min_ansible_version and platforms. author default not changed
license: MIT
'''

ROLE_TASKS_WITH_BLOCK_BECOME = '''
ROLE_TASKS_WITH_BLOCK_BECOME = '''\
- hosts:
tasks:
- name: foo
Expand Down

0 comments on commit d257716

Please sign in to comment.