Skip to content

Commit

Permalink
Run ruff part of pre-commit hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea committed Aug 3, 2024
1 parent d5a2040 commit 439acef
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 12 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/ack.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
9 changes: 7 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion lint_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
ruff==0.0.285
pylint==2.17.5
11 changes: 3 additions & 8 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 439acef

Please sign in to comment.