# Catch an undefined name before a Python function runs

The clean function doubles its parameter, `number`. The regressed function reads `nummber` instead. That one-character typo would raise a NameError when the function runs.

## Repeat the check

With Python 3 and pip installed, download the [fixture runner](../lint-pair.py) into an empty directory and run:

```sh
python3 -m venv .venv
.venv/bin/python -m pip install ruff==0.14.0
python3 lint-pair.py ruff --bin "$PWD/.venv/bin/ruff"
```

On Windows, use the virtual environment's Scripts directory for the interpreter and Ruff executable. The runner checks the installed version and invokes `ruff check --isolated --no-cache --select F821 example.py` in a temporary directory. It expects a clean exit for the valid function, then requires exit 1 and a diagnostic containing both F821 and the misspelled name for the regressed function.

## Recorded result

On 28 November 2026 the clean function returned 0 with all checks passing. The typo returned 1, with F821 at line 2, column 12. This case exercises undefined-name detection independently of any repository configuration.

[Recorded command and output](./observed.json) · [Ruff F821 rule](https://docs.astral.sh/ruff/rules/undefined-name/)
