Skip to content

Commit 47aee19

Browse files
committed
UNPICK added AGENTS.md
1 parent 112a69b commit 47aee19

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

AGENTS.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,36 @@
1717
- All modules, classes, and functions should include docstrings.
1818
- Tests must use descriptive function names, pytest style assertions, and be
1919
grouped in classes when appropriate.
20-
- Rust code must pass `cargo fmt`, `cargo clippy`, and `cargo tomlfmt` and
21-
should omit unnecessary parentheses around `if` conditions.
20+
- Rust code must pass `cargo fmt`, `cargo clippy`, and `cargo tomlfmt`.
2221
- Install the pre-commit hooks with `pre-commit install` and run them with
2322
`pre-commit run --files <file1> <file2>` or `pre-commit run --all-files`.
23+
24+
Install the required Rust components before running pre-commit:
25+
26+
```bash
27+
rustup component add rustfmt clippy
28+
```
29+
30+
If installation is blocked by a proxy, see the [offline installation guide](https://rust-lang.github.io/rustup/installation/other.html).
31+
2432
- The same checks can be run manually using the scripts in `ci/scripts`:
2533
- `./ci/scripts/python_lint.sh`
2634
- `./ci/scripts/rust_fmt.sh`
2735
- `./ci/scripts/rust_clippy.sh`
2836
- `./ci/scripts/rust_toml_fmt.sh`
2937

38+
## Rust Code Style
39+
40+
When generating Rust code for DataFusion, follow these guidelines:
41+
42+
1. Do not add unnecessary parentheses around `if` conditions:
43+
- Correct: `if some_condition`
44+
- Incorrect: `if (some_condition)`
45+
46+
2. Do not use `expect()` or `panic!()` except in tests - use proper error handling with `Result` types
47+
48+
3. Follow the standard Rust style conventions from rustfmt
49+
3050
## Code Organization
3151
- Keep functions focused and under about 50 lines.
3252
- Break complex tasks into well-named helper functions and reuse existing

0 commit comments

Comments
 (0)