Skip to content

Commit 77f173a

Browse files
authored
CI: Address some certification comments (#6740)
1 parent 2120d7a commit 77f173a

24 files changed

Lines changed: 62 additions & 8129 deletions

File tree

.pre-commit-config.yaml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,13 +148,13 @@ repos:
148148
name: Check for Linting errors on Python files outside the Ansible collection.
149149
description: This hook runs pylint.
150150
types: [python]
151-
- id: pylint # Use pylintrc file in Ansible collection
151+
- id: pylint # Use pylintrc-ansible file for Ansible collection
152152
name: Check for Linting errors on Python files in the Ansible collection.
153153
description: This hook runs pylint.
154154
types: [python]
155155
files: ansible_collections/arista/avd/
156156
args:
157-
- --rcfile=ansible_collections/arista/avd/pylintrc
157+
- --rcfile=pylintrc-ansible
158158

159159
- repo: https://github.com/adrienverge/yamllint.git
160160
rev: "v1.38.0"
@@ -204,7 +204,13 @@ repos:
204204
hooks:
205205
- id: pdm-export
206206
name: Extract requirements from pyavd/pyproject.toml to requirements.txt
207-
entry: pdm export -p python-avd -o ansible_collections/arista/avd/requirements.txt --without-hashes -G ansible -G self --pyproject
207+
entry: pdm export -p python-avd -o ansible_collections/arista/avd/requirements.txt --without-hashes -G ansible-collection -G self --pyproject
208+
language: python
209+
files: python-avd/pyproject.toml
210+
pass_filenames: false
211+
- id: pdm-export
212+
name: Extract requirements from pyavd/pyproject.toml to docs/requirements.txt
213+
entry: pdm export -p python-avd -o docs/requirements.txt --without-hashes -G ansible -G self --pyproject
208214
language: python
209215
files: python-avd/pyproject.toml
210216
pass_filenames: false

ansible_collections/arista/avd/.yamllint

Lines changed: 30 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,45 +3,54 @@
33
extends: default
44

55
rules:
6-
braces:
7-
min-spaces-inside: 0
8-
max-spaces-inside: 1
6+
comments:
7+
# https://github.com/prettier/prettier/issues/6780
8+
min-spaces-from-content: 1
99
level: error
10-
brackets:
11-
max-spaces-inside: 1
10+
# https://github.com/adrienverge/yamllint/issues/384
11+
comments-indentation: false
12+
document-start: disable
13+
# We are adding an extra space inside braces as that's how prettier does it
14+
# and we are trying not to fight other linters.
15+
line-length:
16+
max: 160
17+
# TODO: See how we can fix this going forward
18+
ignore:
19+
- /extensions/molecule/**/intended/structured_configs/
20+
- /changelogs/fragments_backup/
21+
braces:
22+
min-spaces-inside: 0 # yamllint defaults to 0
23+
max-spaces-inside: 1 # yamllint defaults to 0
1224
level: error
25+
octal-values:
26+
forbid-implicit-octal: true # yamllint defaults to false
27+
forbid-explicit-octal: true # yamllint defaults to false
28+
#######################################################################
29+
# AVD Extra checks as compared to default ansible-lint configuration #
30+
# in most cases we are stricter so this is not conflicting except #
31+
# for the indentation rule where we are more flexible. #
32+
#######################################################################
1333
colons:
1434
max-spaces-after: -1
1535
level: error
1636
commas:
1737
max-spaces-after: -1
1838
level: error
19-
comments:
20-
# prettier compatibility
21-
min-spaces-from-content: 1
39+
brackets:
40+
max-spaces-inside: 1
2241
level: error
23-
comments-indentation: false
24-
document-start: disable
2542
empty-lines:
2643
max: 1
2744
level: error
2845
hyphens:
2946
level: error
3047
key-duplicates:
3148
forbid-duplicated-merge-keys: true
32-
line-length:
33-
max: 160
34-
ignore:
35-
- /extensions/molecule/**/intended/structured_configs/
36-
- /extensions/molecule/**/intended/structured_configs/cvp/
37-
- /examples/**/intended/structured_configs/cvp/
38-
- /changelogs/fragments_backup/
39-
- /tests/inventory/**/expected_output
4049
new-lines:
4150
type: unix
4251
indentation:
4352
level: error
53+
# NOTE: Here we diverge from the ansible-lint default configuration
54+
# and this is causing issues when running ansible-lint without
55+
# out custom configuration.
4456
indent-sequences: consistent
45-
octal-values:
46-
forbid-implicit-octal: true
47-
forbid-explicit-octal: true

ansible_collections/arista/avd/examples/single-dc-l3ls-ipv6/intended/structured_configs/cvp/cvp.yml

Lines changed: 0 additions & 45 deletions
This file was deleted.

0 commit comments

Comments
 (0)