Skip to content

Commit 187f899

Browse files
authored
Run yamllint via nox. (#91)
1 parent dee82b0 commit 187f899

3 files changed

Lines changed: 36 additions & 44 deletions

File tree

.github/workflows/ansible-test.yml

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -165,24 +165,3 @@ jobs:
165165
env:
166166
ANSIBLE_COLLECTIONS_PATH: ../../../
167167
working-directory: ./ansible_collections/felixfontein/acme
168-
169-
yamllint:
170-
name: yamllint
171-
runs-on: ubuntu-latest
172-
steps:
173-
- name: Check out code
174-
uses: actions/checkout@v4
175-
with:
176-
persist-credentials: false
177-
178-
- name: Set up Python
179-
uses: actions/setup-python@v5
180-
with:
181-
python-version: '3.12'
182-
183-
- name: Install yamllint
184-
run: |
185-
pip install yamllint --disable-pip-version-check
186-
187-
- name: Run yamllint
188-
run: yamllint .

noxfile.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,16 @@
2323
IN_CI = "GITHUB_ACTIONS" in os.environ
2424

2525

26+
antsibull_nox.add_lint_sessions(
27+
run_isort=False,
28+
run_black=False,
29+
run_flake8=False,
30+
run_pylint=False,
31+
run_yamllint=True,
32+
yamllint_config=".yamllint",
33+
run_mypy=False,
34+
)
35+
2636
antsibull_nox.add_docs_check(
2737
validate_collection_refs="all",
2838
)

plugins/filter/_substitute_dns.py

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,31 @@
88
__metaclass__ = type
99

1010
DOCUMENTATION = '''
11-
name: _substitute_dns
12-
short_description: "[INTERNAL] Adjust DNS name according to a CNAME substitution map"
13-
version_added: 0.6.0
14-
author: Felix Fontein (@felixfontein)
15-
description:
16-
- B(This is an internal tool and must only be used from roles in this collection!)
17-
If you use it from outside this collection, be warned that its behavior can change
18-
and it can be removed at any time, even in bugfix releases!
19-
options:
20-
_input:
21-
description: A DNS name.
22-
type: string
23-
required: true
24-
substitution_map:
25-
description:
26-
- A map mapping DNS names to other DNS names.
27-
- You can use a single wildcard C(*) as the first component of a DNS name.
28-
- Trailing dots are ignored.
29-
type: dict
30-
required: true
11+
---
12+
name: _substitute_dns
13+
short_description: "[INTERNAL] Adjust DNS name according to a CNAME substitution map"
14+
version_added: 0.6.0
15+
author: Felix Fontein (@felixfontein)
16+
description:
17+
- B(This is an internal tool and must only be used from roles in this collection!)
18+
If you use it from outside this collection, be warned that its behavior can change
19+
and it can be removed at any time, even in bugfix releases!
20+
options:
21+
_input:
22+
description: A DNS name.
23+
type: string
24+
required: true
25+
substitution_map:
26+
description:
27+
- A map mapping DNS names to other DNS names.
28+
- You can use a single wildcard C(*) as the first component of a DNS name.
29+
- Trailing dots are ignored.
30+
type: dict
31+
required: true
3132
'''
3233

3334
EXAMPLES = '''
35+
---
3436
- name: Simple replace
3537
ansible.builtin.set_fact:
3638
name: "{{ 'www.example.com' | felixfontein.acme._substitute_dns({'www.example.com': 'www.com.example.org'}) }}"
@@ -48,9 +50,10 @@
4850
'''
4951

5052
RETURN = '''
51-
_value:
52-
description: The transformed input.
53-
type: string
53+
---
54+
_value:
55+
description: The transformed input.
56+
type: string
5457
'''
5558

5659
from ansible.errors import AnsibleFilterError, AnsibleFilterTypeError

0 commit comments

Comments
 (0)