File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 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 ` .
2423
@@ -36,6 +35,18 @@ If installation is blocked by a proxy, see the [offline installation guide](http
3635 - ` ./ci/scripts/rust_clippy.sh `
3736 - ` ./ci/scripts/rust_toml_fmt.sh `
3837
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+
3950## Code Organization
4051- Keep functions focused and under about 50 lines.
4152- Break complex tasks into well-named helper functions and reuse existing
You can’t perform that action at this time.
0 commit comments