diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index b6bdad37..e0e8d662 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -4,41 +4,7 @@ on: - push - pull_request jobs: - check_docs_29: - name: Check Ansible Documentation with Ansible 2.9. - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3.1.0 - with: - fetch-depth: 0 - - uses: actions/setup-python@v4.3.0 - with: - python-version: '3.x' - - name: Install Ansible 2.9 - run: | - python -m pip install "ansible < 2.10" - - name: Run ansible-doc-test - run: | - ANSIBLE_LIBRARY="." ANSIBLE_DOC_FRAGMENT_PLUGINS="." python utils/ansible-doc-test -v roles plugins - - check_docs_2_11: - name: Check Ansible Documentation with ansible-core 2.11. - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3.1.0 - with: - fetch-depth: 0 - - uses: actions/setup-python@v4.3.0 - with: - python-version: '3.x' - - name: Install Ansible 2.11 - run: | - python -m pip install "ansible-core >=2.11,<2.12" - - name: Run ansible-doc-test - run: | - ANSIBLE_LIBRARY="." ANSIBLE_DOC_FRAGMENT_PLUGINS="." python utils/ansible-doc-test -v roles plugins - - check_docs_2_12: + check_docs_oldest_supported: name: Check Ansible Documentation with ansible-core 2.12. runs-on: ubuntu-latest steps: @@ -53,10 +19,43 @@ jobs: python -m pip install "ansible-core >=2.12,<2.13" - name: Run ansible-doc-test run: | - python -m pip install "ansible-core >=2.12,<2.13" ANSIBLE_LIBRARY="." ANSIBLE_DOC_FRAGMENT_PLUGINS="." python utils/ansible-doc-test -v roles plugins - check_docs_latest: + check_docs_previous: + name: Check Ansible Documentation with ansible-core 2.13. + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3.1.0 + with: + fetch-depth: 0 + - uses: actions/setup-python@v4.3.0 + with: + python-version: '3.x' + - name: Install Ansible 2.13 + run: | + python -m pip install "ansible-core >=2.13,<2.14" + - name: Run ansible-doc-test + run: | + ANSIBLE_LIBRARY="." ANSIBLE_DOC_FRAGMENT_PLUGINS="." python utils/ansible-doc-test -v roles plugins + + check_docs_current: + name: Check Ansible Documentation with ansible-core 2.14. + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3.1.0 + with: + fetch-depth: 0 + - uses: actions/setup-python@v4.3.0 + with: + python-version: '3.x' + - name: Install Ansible 2.14 + run: | + python -m pip install "ansible-core >=2.14,<2.15" + - name: Run ansible-doc-test + run: | + ANSIBLE_LIBRARY="." ANSIBLE_DOC_FRAGMENT_PLUGINS="." python utils/ansible-doc-test -v roles plugins + + check_docs_ansible_latest: name: Check Ansible Documentation with latest Ansible version. runs-on: ubuntu-latest steps: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 303b7419..08d94083 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -16,7 +16,7 @@ jobs: python-version: "3.x" - name: Run ansible-lint run: | - pip install ansible-core==2.11.6 ansible-lint + pip install "ansible-core >=2.14,<2.15" ansible-lint find playbooks roles tests -name '*.yml' ! -name "env_*" ! -name "tasks_*" -exec ansible-lint --force-color {} \+ env: ANSIBLE_MODULE_UTILS: plugins/module_utils @@ -34,7 +34,7 @@ jobs: with: python-version: "3.x" - name: Run yaml-lint - uses: ibiqlik/action-yamllint@v1 + uses: ibiqlik/action-yamllint@v3.1.1 pydocstyle: name: Verify pydocstyle @@ -63,7 +63,7 @@ jobs: python-version: "3.x" - name: Run flake8 run: | - pip install flake8 + pip install flake8 flake8-bugbear flake8 pylint: @@ -78,7 +78,7 @@ jobs: python-version: "3.x" - name: Run pylint run: | - pip install pylint==2.13.7 wrapt==1.14.0 + pip install pylint==2.14.4 wrapt==1.14.0 pylint plugins roles --disable=import-error shellcheck: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index da62f85f..3c1417ae 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ --- repos: - repo: https://github.com/ansible/ansible-lint.git - rev: v5.3.2 + rev: v6.6.1 hooks: - id: ansible-lint always_run: false @@ -11,20 +11,20 @@ repos: entry: | env ANSIBLE_LIBRARY=./plugins/modules ANSIBLE_MODULE_UTILS=./plugins/module_utils ANSIBLE_DOC_FRAGMENT_PLUGINS=./plugins/doc_fragments ansible-lint - repo: https://github.com/adrienverge/yamllint.git - rev: v1.26.1 + rev: v1.28.0 hooks: - id: yamllint files: \.(yaml|yml)$ - repo: https://github.com/pycqa/flake8 - rev: 3.9.2 + rev: 5.0.3 hooks: - id: flake8 - repo: https://github.com/pycqa/pydocstyle - rev: 6.1.1 + rev: 6.0.0 hooks: - id: pydocstyle - repo: https://github.com/pycqa/pylint - rev: v2.12.2 + rev: v2.14.4 hooks: - id: pylint args: diff --git a/plugins/module_utils/ansible_freeipa_module.py b/plugins/module_utils/ansible_freeipa_module.py index b71c78c9..ff7b06dc 100644 --- a/plugins/module_utils/ansible_freeipa_module.py +++ b/plugins/module_utils/ansible_freeipa_module.py @@ -1125,8 +1125,8 @@ class IPAAnsibleModule(AnsibleModule): def ipa_get_domain(self): """Retrieve IPA API domain.""" if not hasattr(self, "__ipa_api_domain"): - setattr(self, "__ipa_api_domain", api_get_domain()) - return getattr(self, "__ipa_api_domain") + setattr(self, "__ipa_api_domain", api_get_domain()) # noqa: B010 + return getattr(self, "__ipa_api_domain") # noqa: B009 @staticmethod def ipa_get_realm(): diff --git a/plugins/modules/ipaautomountmap.py b/plugins/modules/ipaautomountmap.py index 14d06dd1..1590ebb6 100644 --- a/plugins/modules/ipaautomountmap.py +++ b/plugins/modules/ipaautomountmap.py @@ -126,7 +126,7 @@ class AutomountMap(IPAAnsibleModule): self.params_fail_used_invalid(invalid, state) - def get_args(self, mapname, desc): # pylint: disable=no-self-use + def get_args(self, mapname, desc): # automountmapname is required for all automountmap operations. if not mapname: self.fail_json(msg="automountmapname cannot be None or empty.") diff --git a/plugins/modules/ipadnszone.py b/plugins/modules/ipadnszone.py index 0c340033..a44e8cfb 100644 --- a/plugins/modules/ipadnszone.py +++ b/plugins/modules/ipadnszone.py @@ -280,7 +280,8 @@ class DNSZoneModule(IPAAnsibleModule): if any(invalid_ips): self.fail_json(msg=error_msg % invalid_ips) - def is_valid_nsec3param_rec(self, nsec3param_rec): # pylint: disable=R0201 + @staticmethod + def is_valid_nsec3param_rec(nsec3param_rec): try: part1, part2, part3, part4 = nsec3param_rec.split(" ") except ValueError: diff --git a/requirements-dev.txt b/requirements-dev.txt index 0915965a..f7fa4419 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,10 +1,10 @@ -r requirements-tests.txt ipdb==0.13.4 -pre-commit -flake8==4.0.1 +pre-commit==2.20.0 +flake8==5.0.3 flake8-bugbear==22.10.27 -pylint==2.13.7 -wrapt >= 1.14.0 +pylint==2.14.4 +wrapt == 1.14.0 pydocstyle==6.0.0 -yamllint==1.26.3 -ansible-lint==5.3.2 +yamllint==1.28.0 +ansible-lint==6.6.1 diff --git a/requirements-tests.txt b/requirements-tests.txt index 292e81c6..e6f74d64 100644 --- a/requirements-tests.txt +++ b/requirements-tests.txt @@ -1,7 +1,8 @@ -r requirements.txt -pytest>=2.7 -pytest-sourceorder>=0.5 +pytest==7.1.3 +pytest-sourceorder==0.6.0 pytest-split>=0.8.0 pytest-custom_exit_code>=0.3.0 -pytest-testinfra>=5.0 +pytest-testinfra==6.8.0 +pytest-randomly==3.12.0 pyyaml>=3 diff --git a/utils/get_test_modules.py b/utils/get_test_modules.py index 1e7518c5..cb20e0d6 100644 --- a/utils/get_test_modules.py +++ b/utils/get_test_modules.py @@ -84,7 +84,7 @@ def get_plugins_from_playbook(playbook): def import_mock(name, *args): """Intercept 'import' calls and store module name.""" if not hasattr(import_mock, "call_list"): - setattr(import_mock, "call_list", set()) + setattr(import_mock, "call_list", set()) # noqa: B010 import_mock.call_list.add(name) # pylint: disable=no-member try: # print("NAME:", name)