The National Archives global Ruff config
Project description
The National Archives Ruff config
Two Ruff configurations are available:
ruff.toml- a general purpose Ruff configurationruff-strict.toml- a configuration with a stricter set of rules
Standard configuration
The standard configuration ruff.toml includes the following rules:
| Rule | Purpose | Defined by |
|---|---|---|
E4, E7, E9 |
Subset of pycodestyle errors | Ruff default configuration |
F |
Pyflakes | Ruff default configuration |
W |
pycodestyle warnings | ruff.toml |
C901 |
mccabe "Function is too complex" | ruff.toml |
B |
flake8-bugbear | ruff.toml |
I |
isort | ruff.toml |
Ignores
Certain rules are ignored for __init__.py files:
E402(module-import-not-at-top-of-file) andPLC0415(import-outside-top-level) - some imports like in Django settings files are added later on in the file, sometimes under conditionalsF401(unused-import) - imports don't have to be used in module files which also helps with Django settings
Strict configuration
Extra rules are included in ruff-strict.toml. You can find more information on each of the rules in the Ruff rules documentation.
Using from PyPI
# Install with Poetry
poetry add tna-ruff-config
TNA_RUFF_CONFIG_DIRECTORY="$(poetry run python -c 'from sysconfig import get_path; print(get_path("platlib"))')/tna_ruff_config"
# ...or pip
pip install tna-ruff-config
TNA_RUFF_CONFIG_DIRECTORY="$(python -c 'from sysconfig import get_path; print(get_path("platlib"))')/tna_ruff_config"
# Run Ruff check using the standard config
ruff check /app --fix --config "$TNA_RUFF_CONFIG_DIRECTORY/ruff.toml"
# Run the Ruff formatter using the standard config
ruff format /app --config "$TNA_RUFF_CONFIG_DIRECTORY/ruff.toml"
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tna_ruff_config-0.1.1.tar.gz.
File metadata
- Download URL: tna_ruff_config-0.1.1.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
06b5a8379768d76e13db67f42a3ab1f9dad17cbc4f2de872b25556ce37663c79
|
|
| MD5 |
84bad1d7a2a744d602c6d829065886db
|
|
| BLAKE2b-256 |
49ed76d53f629e610f9a85afc371f3471348cf24c62ed57f1fefd2943c429068
|
Provenance
The following attestation bundles were made for tna_ruff_config-0.1.1.tar.gz:
Publisher:
publish.yml on nationalarchives/ruff-config
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tna_ruff_config-0.1.1.tar.gz -
Subject digest:
06b5a8379768d76e13db67f42a3ab1f9dad17cbc4f2de872b25556ce37663c79 - Sigstore transparency entry: 1704049621
- Sigstore integration time:
-
Permalink:
nationalarchives/ruff-config@96c295d0f98b9a7b65579b29a5dbcc539f1be4fc -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/nationalarchives
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@96c295d0f98b9a7b65579b29a5dbcc539f1be4fc -
Trigger Event:
release
-
Statement type:
File details
Details for the file tna_ruff_config-0.1.1-py3-none-any.whl.
File metadata
- Download URL: tna_ruff_config-0.1.1-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
02446c0e58b5a91f592d2b21eedbdc4ef2e45af1aff7e3a4b12c27311b861ce1
|
|
| MD5 |
bbdcb1998e84dc48b7a951c53f727e1e
|
|
| BLAKE2b-256 |
1877f6ad4f1692e66188627dba6017a023529c9cad4b9a7844cf38d21768d3d3
|
Provenance
The following attestation bundles were made for tna_ruff_config-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on nationalarchives/ruff-config
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tna_ruff_config-0.1.1-py3-none-any.whl -
Subject digest:
02446c0e58b5a91f592d2b21eedbdc4ef2e45af1aff7e3a4b12c27311b861ce1 - Sigstore transparency entry: 1704049645
- Sigstore integration time:
-
Permalink:
nationalarchives/ruff-config@96c295d0f98b9a7b65579b29a5dbcc539f1be4fc -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/nationalarchives
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@96c295d0f98b9a7b65579b29a5dbcc539f1be4fc -
Trigger Event:
release
-
Statement type: