Files
galaxy/tox.ini
T
Nicola Soranzo 7fee81607c Add linting with ruff
ruff (https://github.com/charliermarsh/ruff) is a new and extremely fast
Python linter, written in Rust.
Ruff can be used to replace Flake8 (plus a variety of plugins), isort,
pydocstyle, yesqa, eradicate, pyupgrade, and autoflake.
Here ruff is added to our current linters (flake8, flake8-bugbear and isort)
while we assess its reliability.
I've not enabled the isort rules because many of the options we use are not
implemented yet. I have instead enabled the pyupgrade rules (a tool which I
run manually every few months).

Also:
- Fix new linting errors reported by ruff.
2023-01-16 14:34:56 +00:00

66 lines
2.3 KiB
INI

[tox]
# envlist is the list of environments that are tested when `tox` is run without any option
# hyphens in an environment name are used to delimit factors
envlist = py37-first_startup, py37-lint, py37-lint_docstring_include_list, py37-mypy, py37-reports_startup, py37-unit, test_galaxy_packages, validate_test_tools
skipsdist = True
[testenv]
commands =
first_startup: bash .ci/first_startup.sh
lint: ruff .
# Once we are happy to replace flake8 with ruff, we can replace the next line with `black --check --diff`
# (since ruff delegates to black for checking/fixing many rules).
lint: bash .ci/flake8_wrapper.sh
lint_docstring: bash .ci/flake8_wrapper_docstrings.sh --exclude
lint_docstring_include_list: bash .ci/flake8_wrapper_docstrings.sh --include
reports_startup: bash .ci/first_startup.sh reports
mulled,unit: bash run_tests.sh -u
# start with test here but obviously someday all of it...
mypy: mypy test lib
test_galaxy_packages: make generate-cwl-conformance-tests
test_galaxy_packages: bash packages/test.sh
allowlist_externals =
bash
make
passenv =
CI
CONDA_EXE
GALAXY_CONFIG_OVERRIDE_DATABASE_CONNECTION
APP_WEBSERVER
TERM
setenv =
coverage: GALAXY_TEST_COVERAGE=1
first_startup: GALAXY_PYTHON=python
first_startup: GALAXY_CONFIG_DATABASE_AUTO_MIGRATE=true
py{36,37,38}-first_startup: GALAXY_VIRTUAL_ENV=.venv3
mulled: marker=external_dependency_management
mulled,unit: GALAXY_VIRTUAL_ENV={envdir}
unit: GALAXY_ENABLE_BETA_COMPRESSED_GENBANK_SNIFFING=1
unit: marker=not external_dependency_management
check_indexes: GALAXY_SKIP_CLIENT_BUILD=1
deps =
coverage: coverage
lint,lint_docstring,lint_docstring_include_list: -rlib/galaxy/dependencies/pinned-lint-requirements.txt
mypy: -rlib/galaxy/dependencies/pinned-typecheck-requirements.txt
mypy: -rlib/galaxy/dependencies/pinned-requirements.txt
test_galaxy_packages: pyyaml
unit: mock-ssh-server
[testenv:mako_count]
commands = bash .ci/check_mako.sh
[testenv:test_galaxy_release]
commands = bash test/release.sh
[testenv:validate_test_tools]
commands = bash .ci/validate_test_tools.sh
[testenv:web_controller_line_count]
commands = bash .ci/check_controller.sh
[testenv:check_indexes]
commands =
bash scripts/common_startup.sh
bash manage_db.sh init
bash check_model.sh