These are the official Ruff documentation saved as a CSV and JSON file.
Tip
You can also use ruff rule --output-format json --all to get the rules in
JSON format which might be more up-to-date.
Each file contains a list of all the Ruff linting rules, with the following columns:
- Code: The rule's identifier code (e.g.
RUF001). - Name: The name of the rule.
- Message: A brief description of what the rule checks for.
- Details: Additional details or autofix availability for the rule.
- ParentGroup: The parent category of the rule. (e.g.
RUFfor Ruff rules)
Use the raw link github to access the file directly. For example, to download the CSV file:
curl -s https://raw.githubusercontent.com/williambdean/ruff-rules/refs/heads/main/ruff_rules.csv
Or access the JSON file:
curl -s https://raw.githubusercontent.com/williambdean/ruff-rules/refs/heads/main/ruff_rules.json
Use jq to filter the JSON file by parent group. For example, to get all rules in the RUF parent group:
curl -s https://raw.githubusercontent.com/williambdean/ruff-rules/refs/heads/main/ruff_rules.json | jq 'map(select(.ParentGroup == "RUF"))'
The scrape_rules.py script scrapes the rules from the official Ruff documentation.
Run the script with its dependencies using uv:
# Run with Makefile
make
# Run script directly
uv run scrape_rules.py