Skip to content

Commit da63a52

Browse files
committed
chore(docs): update Ruff rules section in AGENTS.md
Added details about frequently failing Ruff rules, including import sorting, type-checking guards, docstring spacing, and ternary suggestions. This update aims to improve code quality and adherence to the project's linting standards.
1 parent a05b9bc commit da63a52

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

AGENTS.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ This repository contains Python bindings for Rust's DataFusion.
1818
- Python linting/formatting via Ruff
1919
- Rust formatting via `cargo fmt`
2020
- Rust linting via `cargo clippy`
21+
- Ruff rules that frequently fail in this repo:
22+
- **Import sorting (`I001`)**: Keep import blocks sorted/grouped. Running `ruff check --select I --fix <files>` will repair order.
23+
- **Type-checking guards (`TCH001`)**: Place imports that are only needed for typing (e.g., `AggregateUDF`, `ScalarUDF`, `TableFunction`, `WindowUDF`, `NullTreatment`, `DataFrame`) inside a `if TYPE_CHECKING:` block.
24+
- **Docstring spacing (`D202`, `D205`)**: The summary line must be separated from the body with exactly one blank line, and there must be no blank line immediately after the closing triple quotes.
25+
- **Ternary suggestions (`SIM108`)**: Prefer single-line ternary expressions when Ruff requests them over multi-line `if`/`else` assignments.
2126

2227
## Notes
2328
- The repository mixes Python and Rust; ensure changes build for both languages.

0 commit comments

Comments
 (0)