mirror of
https://github.com/ansible/awx.git
synced 2026-10-30 06:13:24 -02:30
Migrate Python linting and formatting toolchain from Black (formatter) and Flake8 (linter) to Ruff, which provides both in a single tool. - pyproject.toml: remove [tool.black], add [tool.ruff] config sections - tox.ini: replace black+flake8 deps/commands with ruff in linters env - awxkit/tox.ini: replace flake8 with ruff in lint env - Makefile: replace `black` target with `format` + `lint`, keep `black` as legacy alias, update `check` and `api-lint` - pre-commit.sh: use `ruff format --check`, honor AWX_IGNORE_RUFF - requirements_dev.txt: swap black/flake8 for ruff - Dockerfile.j2: install ruff instead of black - CONTRIBUTING.md: update tool references - Fix noqa comments to use # separator instead of ; (ruff requirement) - Add noqa: F841 for false positive in awxkit/cli/__init__.py Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
36 lines
983 B
INI
36 lines
983 B
INI
[tox]
|
|
isolated_build = True
|
|
|
|
[testenv:linters]
|
|
deps =
|
|
ruff
|
|
yamllint
|
|
allowlist_externals = make
|
|
setenv =
|
|
PYTHON = python3
|
|
commands =
|
|
# awx_collection is excluded: ansible-test sanity runs its own linters which conflict with ruff
|
|
ruff format --check awx awxkit
|
|
ruff check awx awxkit
|
|
yamllint -s .
|
|
|
|
[testenv:pip-compile-docs]
|
|
description = Compile docs build lockfiles
|
|
deps =
|
|
# pip-tools config file support was introduced in v7
|
|
pip-tools >= 7
|
|
commands =
|
|
{envpython} -m piptools compile \
|
|
--output-file=docs/docsite/requirements.txt \
|
|
docs/docsite/requirements.in \
|
|
{posargs:--upgrade}
|
|
|
|
[testenv:docs]
|
|
description = Build documentation
|
|
deps =
|
|
-r{toxinidir}/docs/docsite/requirements.in
|
|
-c{toxinidir}/docs/docsite/requirements.txt
|
|
commands =
|
|
python {toxinidir}/docs/docsite/download-json.py
|
|
sphinx-build -T -E -W -n --keep-going {tty:--color} -j auto -c docs/docsite -d docs/docsite/build/doctrees -b html docs/docsite/rst docs/docsite/build/html
|