Skip to content

Commit

Permalink
CI: Update pre-commit versions (#695)
Browse files Browse the repository at this point in the history
* CI: updating min python version to 3.11

* added pre-commit yaml file

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* added pylint ignore

* make CI pass again

* adding ignore for ansible-test sanity

* make CI happy again!

* hardcoding ansible-lint to keep CI happy

* downgraded python version in matrix

* pinning ansible-lint

* CI happy: removed comments

* CI happy: downgrade to 3.9

* downgrading pylint version to 3.1.1

* fixing pylint errors

* upgrade python version to 3.10 in ansible-lint

* partial ansible-lint commit

* partial2: ansible-lint fix

* partial2: ansible-lint fix

* partial3: ansible-lint fix

* partial4: ansible-lint fix

* partial5: ansible-lint fix

* moved yammlint inside the collection

* changed yamllint rules

* Run python unit tests only

* excluding molecule/ and examples/

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fixed roles/configlet_sync

* fix dhcp role

* ansible-lint fix

* Reverting to generic info in inventory

* fixing typos

* created new targets for running pytest

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
sugetha24 and pre-commit-ci[bot] authored Jul 10, 2024
1 parent 204509b commit 4dd13d5
Show file tree
Hide file tree
Showing 179 changed files with 1,697 additions and 1,498 deletions.
25 changes: 24 additions & 1 deletion .github/workflows/pull-request-management.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ jobs:
- name: 'Execute pytest validation'
run: |
cd tests/
make test
make unit-tests
- uses: actions/upload-artifact@v2
with:
name: pytest-report
Expand Down Expand Up @@ -270,3 +270,26 @@ jobs:
run: |
cd ansible_collections/arista/cvp/
ansible-test sanity -v --requirements --docker --python ${{ matrix.python_version }}
ansible_lint:
name: Run ansible-lint test case
runs-on: ubuntu-latest
needs: [ file-changes ]
steps:
- name: 'Set environment variables'
run: |
echo "PY_COLORS=1" >> $GITHUB_ENV
- uses: actions/checkout@v4
- name: Set up Python 3
uses: actions/setup-python@v5
with:
python-version: |
3.10
- name: 'Install Python & Ansible requirements'
run: |
pip install -r ansible_collections/arista/cvp/requirements.txt -r ansible_collections/arista/cvp/requirements-dev.txt --upgrade
ansible-galaxy collection install -r ansible_collections/arista/cvp/collections.yml
- name: 'Run ansible-test integration test cases'
run: |
cd ansible_collections/arista/cvp/
ansible-lint --force-color --strict -v
2 changes: 1 addition & 1 deletion .github/yamllintrc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ rules:
level: warning
indent-sequences: consistent
line-length:
max: 140
max: 350
level: warning
allow-non-breakable-inline-mappings: true
truthy: disable
18 changes: 5 additions & 13 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.4.0
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-added-large-files
- id: check-merge-conflict
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.4
rev: v1.5.5
hooks:
- name: Check and insert license on Python files
id: insert-license
Expand Down Expand Up @@ -62,7 +62,7 @@ repos:
- '<!--| ~| -->'

- repo: https://github.com/pycqa/pylint
rev: "v2.16.1"
rev: "v3.1.1"
hooks:
- id: pylint # Use pylintrc file in repository
name: Check for Linting errors on Python files
Expand All @@ -73,7 +73,7 @@ repos:
- -d duplicate-code

- repo: https://github.com/adrienverge/yamllint.git
rev: 'v1.23.0'
rev: 'v1.35.1'
hooks:
- id: yamllint
name: Check for Linting error on YAML files
Expand All @@ -83,16 +83,8 @@ repos:
types: [file, yaml]
args: [-c=.github/yamllintrc]

- repo: https://github.com/ansible/ansible-lint.git
rev: v4.2.0
hooks:
- id: ansible-lint
name: Check for ansible-lint errors
files: \.(yaml|yml)$
exclude: ansible_collections/arista/cvp/docs

- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.32.1
rev: v0.41.0
hooks:
- id: markdownlint
args:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2023 Arista Networks, Inc.
~ Copyright (c) 2023-2024 Arista Networks, Inc.
~ Use of this source code is governed by the Apache License 2.0
~ that can be found in the LICENSE file.
-->
Expand Down
14 changes: 14 additions & 0 deletions ansible_collections/arista/cvp/.ansible-lint
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
profile: production

skip_list:
- name[template] # Remove warnings on task names where Jinja template is not at the end
- run-once[task] # Remove warnings on using run_once with other strategies
- meta-no-info # Ansible-lint does not honor meta-schema with standalone: false
- var-naming[no-role-prefix]
- var-naming[pattern]
# kinds:
# - yaml: "**/molecule/**/inventory/host_vars/roles.yml"
exclude_paths:
- molecule/
- examples/
33 changes: 33 additions & 0 deletions ansible_collections/arista/cvp/.yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
# Based on ansible-lint config
extends: default

rules:
braces:
max-spaces-inside: 1
level: error
brackets:
max-spaces-inside: 1
level: error
colons:
max-spaces-after: -1
level: error
commas:
max-spaces-after: -1
level: error
comments: disable
comments-indentation: disable
document-start: disable
empty-lines:
max: 3
level: error
hyphens:
level: error
indentation: disable
key-duplicates: enable
line-length: disable
new-line-at-end-of-file: disable
new-lines:
type: unix
trailing-spaces: disable
truthy: disable
2 changes: 1 addition & 1 deletion ansible_collections/arista/cvp/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2023 Arista Networks, Inc.
~ Copyright (c) 2023-2024 Arista Networks, Inc.
~ Use of this source code is governed by the Apache License 2.0
~ that can be found in the LICENSE file.
-->
Expand Down
2 changes: 1 addition & 1 deletion ansible_collections/arista/cvp/docs/build-md/doc.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2023 Arista Networks, Inc.
# Copyright (c) 2023-2024 Arista Networks, Inc.
# Use of this source code is governed by the Apache License 2.0
# that can be found in the LICENSE file.
import os
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{#
Copyright (c) 2023 Arista Networks, Inc.
Copyright (c) 2023-2024 Arista Networks, Inc.
Use of this source code is governed by the Apache License 2.0
that can be found in the LICENSE file.
#}
Expand Down
2 changes: 1 addition & 1 deletion ansible_collections/arista/cvp/docs/contributing.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2023 Arista Networks, Inc.
~ Copyright (c) 2023-2024 Arista Networks, Inc.
~ Use of this source code is governed by the Apache License 2.0
~ that can be found in the LICENSE file.
-->
Expand Down
2 changes: 1 addition & 1 deletion ansible_collections/arista/cvp/docs/faq/containers.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2023 Arista Networks, Inc.
~ Copyright (c) 2023-2024 Arista Networks, Inc.
~ Use of this source code is governed by the Apache License 2.0
~ that can be found in the LICENSE file.
-->
Expand Down
2 changes: 1 addition & 1 deletion ansible_collections/arista/cvp/docs/faq/errors.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2023 Arista Networks, Inc.
~ Copyright (c) 2023-2024 Arista Networks, Inc.
~ Use of this source code is governed by the Apache License 2.0
~ that can be found in the LICENSE file.
-->
Expand Down
2 changes: 1 addition & 1 deletion ansible_collections/arista/cvp/docs/getting-started.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2023 Arista Networks, Inc.
~ Copyright (c) 2023-2024 Arista Networks, Inc.
~ Use of this source code is governed by the Apache License 2.0
~ that can be found in the LICENSE file.
-->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2023 Arista Networks, Inc.
~ Copyright (c) 2023-2024 Arista Networks, Inc.
~ Use of this source code is governed by the Apache License 2.0
~ that can be found in the LICENSE file.
-->
Expand Down
2 changes: 1 addition & 1 deletion ansible_collections/arista/cvp/docs/how-to/debug.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2023 Arista Networks, Inc.
~ Copyright (c) 2023-2024 Arista Networks, Inc.
~ Use of this source code is governed by the Apache License 2.0
~ that can be found in the LICENSE file.
-->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2023 Arista Networks, Inc.
~ Copyright (c) 2023-2024 Arista Networks, Inc.
~ Use of this source code is governed by the Apache License 2.0
~ that can be found in the LICENSE file.
-->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2023 Arista Networks, Inc.
~ Copyright (c) 2023-2024 Arista Networks, Inc.
~ Use of this source code is governed by the Apache License 2.0
~ that can be found in the LICENSE file.
-->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2023 Arista Networks, Inc.
~ Copyright (c) 2023-2024 Arista Networks, Inc.
~ Use of this source code is governed by the Apache License 2.0
~ that can be found in the LICENSE file.
-->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2023 Arista Networks, Inc.
~ Copyright (c) 2023-2024 Arista Networks, Inc.
~ Use of this source code is governed by the Apache License 2.0
~ that can be found in the LICENSE file.
-->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2023 Arista Networks, Inc.
~ Copyright (c) 2023-2024 Arista Networks, Inc.
~ Use of this source code is governed by the Apache License 2.0
~ that can be found in the LICENSE file.
-->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2023 Arista Networks, Inc.
~ Copyright (c) 2023-2024 Arista Networks, Inc.
~ Use of this source code is governed by the Apache License 2.0
~ that can be found in the LICENSE file.
-->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2023 Arista Networks, Inc.
~ Copyright (c) 2023-2024 Arista Networks, Inc.
~ Use of this source code is governed by the Apache License 2.0
~ that can be found in the LICENSE file.
-->
Expand Down
2 changes: 1 addition & 1 deletion ansible_collections/arista/cvp/docs/modules/cv_device.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2023 Arista Networks, Inc.
~ Copyright (c) 2023-2024 Arista Networks, Inc.
~ Use of this source code is governed by the Apache License 2.0
~ that can be found in the LICENSE file.
-->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2023 Arista Networks, Inc.
~ Copyright (c) 2023-2024 Arista Networks, Inc.
~ Use of this source code is governed by the Apache License 2.0
~ that can be found in the LICENSE file.
-->
Expand Down
2 changes: 1 addition & 1 deletion ansible_collections/arista/cvp/docs/modules/cv_facts.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2023 Arista Networks, Inc.
~ Copyright (c) 2023-2024 Arista Networks, Inc.
~ Use of this source code is governed by the Apache License 2.0
~ that can be found in the LICENSE file.
-->
Expand Down
2 changes: 1 addition & 1 deletion ansible_collections/arista/cvp/docs/modules/cv_facts_v3.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2023 Arista Networks, Inc.
~ Copyright (c) 2023-2024 Arista Networks, Inc.
~ Use of this source code is governed by the Apache License 2.0
~ that can be found in the LICENSE file.
-->
Expand Down
2 changes: 1 addition & 1 deletion ansible_collections/arista/cvp/docs/modules/cv_image_v3.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2023 Arista Networks, Inc.
~ Copyright (c) 2023-2024 Arista Networks, Inc.
~ Use of this source code is governed by the Apache License 2.0
~ that can be found in the LICENSE file.
-->
Expand Down
2 changes: 1 addition & 1 deletion ansible_collections/arista/cvp/docs/modules/cv_tag_v3.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2023 Arista Networks, Inc.
~ Copyright (c) 2023-2024 Arista Networks, Inc.
~ Use of this source code is governed by the Apache License 2.0
~ that can be found in the LICENSE file.
-->
Expand Down
2 changes: 1 addition & 1 deletion ansible_collections/arista/cvp/docs/modules/cv_task.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2023 Arista Networks, Inc.
~ Copyright (c) 2023-2024 Arista Networks, Inc.
~ Use of this source code is governed by the Apache License 2.0
~ that can be found in the LICENSE file.
-->
Expand Down
2 changes: 1 addition & 1 deletion ansible_collections/arista/cvp/docs/modules/cv_task_v3.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2023 Arista Networks, Inc.
~ Copyright (c) 2023-2024 Arista Networks, Inc.
~ Use of this source code is governed by the Apache License 2.0
~ that can be found in the LICENSE file.
-->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2023 Arista Networks, Inc.
~ Copyright (c) 2023-2024 Arista Networks, Inc.
~ Use of this source code is governed by the Apache License 2.0
~ that can be found in the LICENSE file.
-->
Expand Down
2 changes: 1 addition & 1 deletion ansible_collections/arista/cvp/docs/release-notes/v1.x.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2023 Arista Networks, Inc.
~ Copyright (c) 2023-2024 Arista Networks, Inc.
~ Use of this source code is governed by the Apache License 2.0
~ that can be found in the LICENSE file.
-->
Expand Down
2 changes: 1 addition & 1 deletion ansible_collections/arista/cvp/docs/release-notes/v2.x.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2023 Arista Networks, Inc.
~ Copyright (c) 2023-2024 Arista Networks, Inc.
~ Use of this source code is governed by the Apache License 2.0
~ that can be found in the LICENSE file.
-->
Expand Down
2 changes: 1 addition & 1 deletion ansible_collections/arista/cvp/docs/release-notes/v3.x.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2023 Arista Networks, Inc.
~ Copyright (c) 2023-2024 Arista Networks, Inc.
~ Use of this source code is governed by the Apache License 2.0
~ that can be found in the LICENSE file.
-->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2023 Arista Networks, Inc.
~ Copyright (c) 2023-2024 Arista Networks, Inc.
~ Use of this source code is governed by the Apache License 2.0
~ that can be found in the LICENSE file.
-->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2023 Arista Networks, Inc.
~ Copyright (c) 2023-2024 Arista Networks, Inc.
~ Use of this source code is governed by the Apache License 2.0
~ that can be found in the LICENSE file.
-->
Expand Down
2 changes: 1 addition & 1 deletion ansible_collections/arista/cvp/docs/schema/cv_device_v3.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2023 Arista Networks, Inc.
~ Copyright (c) 2023-2024 Arista Networks, Inc.
~ Use of this source code is governed by the Apache License 2.0
~ that can be found in the LICENSE file.
-->
Expand Down
2 changes: 1 addition & 1 deletion ansible_collections/arista/cvp/docs/schema/cv_tag_v3.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2023 Arista Networks, Inc.
~ Copyright (c) 2023-2024 Arista Networks, Inc.
~ Use of this source code is governed by the Apache License 2.0
~ that can be found in the LICENSE file.
-->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2023 Arista Networks, Inc.
~ Copyright (c) 2023-2024 Arista Networks, Inc.
~ Use of this source code is governed by the Apache License 2.0
~ that can be found in the LICENSE file.
-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@
parent: Leaf Upgrades

tasks:
- name: "Create a change control on {{inventory_hostname}}"
- name: "Create a change control on {{ inventory_hostname }}"
arista.cvp.cv_change_control_v3:
state: set
change: "{{ change }}"
register: cv_change_control_test

- name: "Approve and Execute a change control on {{inventory_hostname}} using change_id field"
- name: "Approve and Execute a change control using change_id field on {{ inventory_hostname }}"
arista.cvp.cv_change_control_v3:
state: approve_and_execute
change_id: ["{{ cv_change_control_test.data.id }}"]
Loading

0 comments on commit 4dd13d5

Please sign in to comment.