YESTERDAY
binutils/pre-commit
Add 'tomli' dependency for codespell hook.
Ensures codespell pre-commit hook works on older Python versions by adding 'tomli' dependency.
The codespell pre-commit hook requires the tomllib module to parse pyproject.toml files. As tomllib is only available in Python 3.11+, this commit adds the tomli dependency to the hook configuration. This ensures that codespell functions correctly on Python versions 3.10 and older.
In Details
The codespell pre-commit hook uses tomllib (a standard library module in Python 3.11+) to parse TOML configuration files. To maintain compatibility with older Python versions (pre-3.11), this commit adds tomli (a backport of tomllib) to the additional_dependencies for the codespell hook in .pre-commit-config.yaml.
For Context
- pre-commit hook
- A script that runs automatically before a commit is made. It's used to enforce coding standards, check for errors, or perform other quality control tasks.
- codespell
- A spell checker that detects common misspellings in code and text.
- tomllib
- A Python standard library module (available in Python 3.11+) for parsing TOML (Tom's Obvious, Minimal Language) files.
- tomli
- A third-party Python package that provides a backport of the
tomllibmodule, allowing TOML parsing on Python versions prior to 3.11.