mirror of
https://github.com/ansible/awx.git
synced 2026-10-29 22:03:20 -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>
49 lines
815 B
INI
49 lines
815 B
INI
[tox]
|
|
distshare = {homedir}/.tox/distshare
|
|
envlist =
|
|
lint,
|
|
test
|
|
skip_missing_interpreters = true
|
|
# recreate = true
|
|
# skipsdist = true
|
|
|
|
[testenv]
|
|
basepython = python3.12
|
|
setenv =
|
|
PYTHONPATH = {toxinidir}:{env:PYTHONPATH:}:.
|
|
deps =
|
|
websocket-client
|
|
coverage
|
|
mock
|
|
pytest
|
|
pytest-mock
|
|
|
|
commands =
|
|
coverage run --parallel --source awxkit -m pytest -c pytest.ini test --doctest-glob='*.md' --junit-xml=report.xml {posargs}
|
|
coverage combine
|
|
coverage xml
|
|
|
|
[testenv:lint]
|
|
deps =
|
|
{[testenv]deps}
|
|
ruff
|
|
commands =
|
|
ruff check awxkit
|
|
- coverage erase
|
|
|
|
[testenv:coveralls]
|
|
commands=
|
|
- coverage combine
|
|
- coverage report -m
|
|
- coveralls
|
|
|
|
[pytest]
|
|
addopts = -v --tb=native
|
|
testpaths = test
|
|
python_files = test_*.py
|
|
|
|
filterwarnings =
|
|
error
|
|
|
|
junit_family=xunit2
|