You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update guidelines and CI scripts for Python formatting
- Added guidelines for formatting Python scripts in CONTRIBUTING.md.
- Updated `.ci/check-format.sh` to streamline the check for Python file formatting.
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+8-3Lines changed: 8 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,6 +39,7 @@ However, participation requires adherence to fundamental ground rules:
39
39
While there is some flexibility in basic style, it is crucial to stick to the current coding standards.
40
40
Complex algorithmic constructs without proper comments will not be accepted.
41
41
* Shell scripts must be formatted before submission. Use consistent flags across the project to ensure uniform formatting.
42
+
* Python scripts must be formatted before submission. Use consistent flags across the project to ensure uniform formatting.
42
43
* External pull requests should include thorough documentation in the pull request comments for consideration.
43
44
* When composing documentation, code comments, and other materials in English,
44
45
please adhere to the American English (`en_US`) dialect.
@@ -48,10 +49,14 @@ However, participation requires adherence to fundamental ground rules:
48
49
Software requirement:
49
50
*[clang-format](https://clang.llvm.org/docs/ClangFormat.html) version 18 or later.
50
51
*[shfmt](https://github.com/mvdan/sh).
51
-
*[black](https://github.com/psf/black) for Python code formatting.
52
+
*[black](https://github.com/psf/black).
53
+
54
+
To maintain a uniform style across languages, run:
55
+
56
+
*`clang-format -i *.{c,h}` to apply the project’s C/C++ formatting rules from the up-to-date .clang-format file.
57
+
*`shfmt -w $(find . -type f -name "*.sh")` to clean and standardize all shell scripts.
58
+
*`black .` to enforce a consistent, idiomatic layout for Python code.
52
59
53
-
This repository consistently contains an up-to-date `.clang-format` file with rules that match the explained ones, uses shell script formatting supported by `shfmt`, and Python code formatting with `black`.
54
-
For maintaining a uniform coding style, execute the command `clang-format -i *.{c,h}`, `shfmt -w $(find . -type f -name "*.sh")`, and `black .` for Python files.
0 commit comments