docs: split up ruff config#682
Conversation
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
There was a problem hiding this comment.
Pull Request Overview
This PR adds tabbed configuration examples for Ruff to make it easier for users to choose between different configuration approaches. The change transforms a single configuration example into three options: Simple, Full, and Ignore-based.
- Restructures Ruff configuration documentation from a single example to three tabbed alternatives
- Adds a simplified config option showing basic Ruff rule selections
- Adds an "ignore-based" config showing a
select = ["ALL"]approach with explicit ignores
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "PLR2004", # Magic value used in comparison | ||
| "PT013", # It's correct to import classes for typing! | ||
| "RUF009", # Too easy to get a false positive (function call in dataclass defaults) | ||
| "S", # Some subset is okay |
There was a problem hiding this comment.
The comment 'Some subset is okay' is unclear and doesn't explain why the entire 'S' (security) rule category is being ignored. Consider a more specific comment like '# flake8-bandit (security) - enable specific rules as needed' to clarify that users should selectively enable security rules.
| "S", # Some subset is okay | |
| "S", # flake8-bandit (security) - enable specific rules as needed |
| "PT013", # It's correct to import classes for typing! | ||
| "RUF009", # Too easy to get a false positive (function call in dataclass defaults) | ||
| "S", # Some subset is okay | ||
| "D", # Too many doc requests |
There was a problem hiding this comment.
The comment 'Too many doc requests' is unclear. Consider using a more descriptive comment like '# pydocstyle - too many docstring requirements' to better explain what 'D' rules are and why they're ignored.
| "D", # Too many doc requests | |
| "D", # pydocstyle - too many docstring requirements |
| "TD", # Todo format | ||
| "FIX", # Hacks and todos | ||
| "TID252", # Relative imports are fine | ||
| "COM", # Trailing commas teach the formatter |
There was a problem hiding this comment.
The comment 'Trailing commas teach the formatter' is unclear about why COM rules are ignored. Consider clarifying with '# flake8-commas - handled by formatter' to indicate that the formatter manages comma placement.
| "COM", # Trailing commas teach the formatter | |
| "COM", # flake8-commas - handled by formatter |
Split up Ruff config, show simple config at first, tabs for either select-based or exclude-based config.
📚 Documentation preview 📚: https://scientific-python-cookie--682.org.readthedocs.build/