---
name: ruff
description: "Use when adopting Ruff to assess this standard: Keep Python lint findings out of changes"
---

# Apply Ruff

Catch undefined names, unused imports and other selected errors across Python modules. Commit the rule selection in pyproject.toml so editors and CI agree.

## Procedure

1. Inspect the repository configuration and identify the files or targets covered by Ruff.
2. Use Ruff in this repository to meet this standard: Keep Python lint findings out of changes. Catch undefined names, unused imports and other selected errors across Python modules. Commit the rule selection in pyproject.toml so editors and CI agree. Inspect the repository configuration, record the baseline and exact reproduction steps, then add the smallest repeatable check that detects a regression.
3. Record the tool version, configuration, scope and findings. Explain any checks that could not run.
4. Use the same invocation after changes and compare the evidence against the baseline.

Refer to [the upstream documentation](https://docs.astral.sh/ruff/) for configuration and prerequisites.

## Worked check

For the tutorial module, run ruff check and inspect its F401 location. Remove the unused import or apply the safe fix, then rerun and confirm that this specific finding disappears.

[Evidence and example](https://docs.astral.sh/ruff/tutorial/)

## Tool invocation

```
ruff check .
```

## Optional Seikika installation

Package: [sarif (Seikika kit)](https://github.com/seikika/seikika/tree/89eb0a2fcd2ffe67151df43f2a062ebc8a1e497c/packages/sarif).

Add github:seikika/seikika/packages/sarif@89eb0a2fcd2ffe67151df43f2a062ebc8a1e497c to the include list in .seikika/seikika.yaml. Copy the Ruff include parameters from the SARIF package guide and set files to your Python source globs. Run seikika install .seikika from the checkout root.
