diff --git a/.github/workflows/ack.yml b/.github/workflows/ack.yml index 60853af3..1a559ab3 100644 --- a/.github/workflows/ack.yml +++ b/.github/workflows/ack.yml @@ -1,10 +1,15 @@ --- # See https://github.com/ansible/devtools/blob/main/.github/workflows/ack.yml name: ack -"on": +on: pull_request_target: types: [opened, labeled, unlabeled, synchronize] +permissions: + checks: write + contents: write # needed to update release + pull-requests: write # pr approval and merge + jobs: ack: uses: ansible/team-devtools/.github/workflows/ack.yml@main diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9c7761fe..c64f8437 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,15 +6,20 @@ ci: exclude: "^.*\\.md$" repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.3.0 + rev: v4.6.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer language_version: python3 - repo: https://github.com/streetsidesoftware/cspell-cli - rev: v8.13.0 + rev: v8.13.1 hooks: - id: cspell + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: "v0.5.6" + hooks: + - id: ruff + args: [--fix, --exit-non-zero-on-fix] - repo: local hooks: - id: ansible-test-sanity diff --git a/lint_requirements.txt b/lint_requirements.txt index 699844e3..b87cf3cf 100644 --- a/lint_requirements.txt +++ b/lint_requirements.txt @@ -1,2 +1 @@ -ruff==0.0.285 pylint==2.17.5 diff --git a/tox.ini b/tox.ini index 4bd47735..2183a2d8 100644 --- a/tox.ini +++ b/tox.ini @@ -3,25 +3,20 @@ # {posargs} in this case would be the path to collection root relative from the .github/workflows dir (`../..`) [tox] -# envlist = ruff, darglint, pylint-event-source, pylint-event-filter -envlist = lint, ruff, pylint-event-source, pylint-event-filter, isort, black +envlist = lint, pylint-event-source, pylint-event-filter, isort, black requires = lint - ruff darglint pylint [testenv] basepython = python3.9, python3.10 + [testenv:lint] deps = pre-commit -desc = Run linters +description = Run linters commands = pre-commit run -a -[testenv:ruff] -deps = -r{toxinidir}/lint_requirements.txt -commands = ruff check --select ALL --ignore INP001,RUF100,FA102,PLR0913 -q extensions/eda/plugins - [testenv:darglint] deps = darglint commands = darglint -s numpy -z full extensions/eda/plugins