# SPDX-FileCopyrightText: Peter Pentchev # SPDX-License-Identifier: BSD-2-Clause [tox] minversion = 4.1 envlist = ruff format mypy isolated_build = True [defs] pyfiles = scripts/ch-1.py \ scripts/ch-2.py [testenv:ruff] skip_install = True tags = check ruff quick deps = -r requirements/ruff.txt commands = ruff check -- {[defs]pyfiles} [testenv:format] skip_install = True tags = check quick deps = -r requirements/ruff.txt commands = ruff check --config ruff-base.toml --select=D,I --diff -- {[defs]pyfiles} ruff format --config ruff-base.toml --check --diff -- {[defs]pyfiles} [testenv:reformat] skip_install = True tags = format manual deps = -r requirements/ruff.txt commands = ruff check --config ruff-base.toml --select=D,I --fix -- {[defs]pyfiles} ruff format --config ruff-base.toml -- {[defs]pyfiles} [testenv:mypy] skip_install = True tags = check deps = mypy >= 1, < 2 setenv = MYPYPATH = {toxinidir}/stubs commands = mypy {[defs]pyfiles} [testenv:pyupgrade] skip_install = True tags = check manual deps = pyupgrade >= 3, < 4 allowlist_externals = sh commands = sh -c 'pyupgrade --py311-plus scripts/*.py'