Configuration¶
SDETKit works without configuration: gate fast reads the policy your repository already declares (its ruff, mypy and pytest settings, its pre-commit hooks, its tox.ini) and runs it in the project's own environment. Configuration is for the cases where you want something different. Everything lives in pyproject.toml under [tool.sdetkit.*], and command-line flags override it.
[tool.sdetkit.gate]: what gate fast runs¶
[tool.sdetkit.gate]
pytest_args = ["-q", "tests/unit"]
mypy_args = ["src"]
ruff_paths = ["src", "tests"]
doctor_args = ["--dev", "--deps", "--clean-tree"]
ci_templates = false
| Key | Type | Default | Effect |
|---|---|---|---|
pytest_args |
list of strings | ["-q"] when tests are detected |
Arguments for the pytest step. |
mypy_args |
list of strings | see how mypy targets are chosen | Arguments for the mypy step. |
ruff_paths |
list of strings | src and tests (whichever exist), else . |
Paths for ruff check and ruff format --check. |
doctor_args |
list of strings | ["--dev", "--deps", "--clean-tree"] |
Arguments for the doctor step. |
ci_templates |
boolean | false |
Run SDETKit's CI template validation (ci_templates step). |
An invalid value (for example a string where a list is expected) stops the gate with an error that names the key.
How gate fast chooses what to check¶
For each tool, the first source that applies wins:
mypy
--mypy-argson the command linemypy_argsin[tool.sdetkit.gate]filesin your mypy configuration ([tool.mypy],mypy.ini,.mypy.iniorsetup.cfg): the gate runs plainmypy- your pre-commit mypy hook: its arguments as they are with
pass_filenames: false, otherwise its arguments plus the files it selects - each
mypy ...command intox.ini, run in order mypy src(ormypy .without asrcdirectory)
The step is skipped when mypy is not configured at all.
ruff
ruff_pathsin[tool.sdetkit.gate]- the files your pre-commit
ruff/ruff-checkandruff-formathooks would check, when the hook or the config's top level setsfilesorexclude srcandtests, or.
The step is skipped when ruff is not configured ([tool.ruff], ruff.toml, .ruff.toml or a pre-commit ruff hook).
pytest
--pytest-argson the command line, or--full-pytestfor plainpytest -qpytest_argsin[tool.sdetkit.gate]pytest -qwhen the repository has tests (tests/,test/, aconftest.py, or pytest configuration)
Each step records where its targets came from in targets_from when the repository's pre-commit or tox configuration supplied them.
Which Python runs the checks¶
ruff, mypy and pytest run in the project's own environment, the first of:
--python <interpreter>.venvorvenvin the repository- Poetry's or Pipenv's environment, when the repository has
poetry.lockorPipfile.lock - an activated virtualenv (
VIRTUAL_ENV) - the interpreter SDETKit itself runs in
The environment field of the gate's JSON names the interpreter and where it came from. See which Python runs your checks for how failures that come from the environment are reported.
[tool.sdetkit.doctor]¶
[tool.sdetkit.doctor]
release_tag_check_script = "scripts/check_release_tag_version.py"
| Key | Type | Effect |
|---|---|---|
release_tag_check_script |
string | doctor --release requires .github/workflows/release.yml to run this script, which checks that the release tag matches the package version. Without it, the release workflow check is not required. |
Other sections¶
| Section | Used by | Reference |
|---|---|---|
[tool.sdetkit.repo_audit] |
repo audit |
profile, fail_on, baseline_path, exclude_paths, disable_rules, severity_overrides, org_packs, lint_expiry_max_days: see policy and baselines |
[tool.sdetkit.projects] |
monorepo commands | project roots and autodiscover: see monorepo projects |
Command-line flags for gate fast¶
| Flag | Effect |
|---|---|
--only ruff,pytest / --skip mypy |
Run only, or skip, the listed steps. python -m sdetkit gate fast --list-steps lists them. |
--no-doctor, --no-ruff, --no-mypy, --no-pytest, --no-tests |
Leave out one step. |
--python <interpreter> |
Run the repository's checks with this interpreter. |
--profile adoption |
Run only doctor: prove SDETKit installs and emits evidence before enforcing the repository's policy. |
--strict |
Run doctor with --fail-on medium instead of high. |
--fix / --fix-only |
Apply ruff check --fix and ruff format first (--fix-only stops there). These are the only options that change your files. |
--format json --stable-json --out build/gate-fast.json |
Write the machine-readable result; --stable-json leaves out timings and machine-specific paths. |
The CLI reference covers every command.