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
Leverage shfmt as the standard formatter for shell scripts in this repo.
- add `.editorconfig` with formatting rules and apply shfmt in
.ci/check-format.sh. The formatting rules are as follows:
* Use spaces for indentation
* Indent with 4 spaces
* Use Unix-style line endings (LF)
* Remove trailing whitespace at the end of lines
* Ensure the file ends with a newline
* Place the opening brace of a function on the next line
* Indent case statements within switch blocks
* Add spaces around redirection operators (e.g., >, >>)
* Place binary operators (e.g., &&, |) on the next line when breaking
lines
- update CONTRIBUTING.md with usage instructions (all contributors
should use it to ensure consistent shell script style).
The early exit behavior (set -e) in .ci/check-format.sh has been removed
to allow collecting all formatting mismatches in a single run. The
script’s exit code is now the sum of the line-level mismatch count from
clang-format-18 and the file-level mismatch count from shfmt, which
should be 0 if all files are properly formatted.
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+9-7Lines changed: 9 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -44,10 +44,12 @@ However, participation requires adherence to fundamental ground rules:
44
44
This variant should be considered the standard for all documentation efforts.
45
45
For instance, opt for "initialize" over "initialise" and "color" rather than "colour".
46
46
47
-
Software requirement: [clang-format](https://clang.llvm.org/docs/ClangFormat.html) version 18 or later.
47
+
Software requirement:
48
+
*[clang-format](https://clang.llvm.org/docs/ClangFormat.html) version 18 or later.
49
+
*[shfmt](https://github.com/mvdan/sh).
48
50
49
-
This repository consistently contains an up-to-date `.clang-format` file with rules that match the explained ones.
50
-
For maintaining a uniform coding style, execute the command `clang-format -i *.{c,h}`.
51
+
This repository consistently contains an up-to-date `.clang-format` file with rules that match the explained ones and uses shell script formatting supported by `shfmt`.
52
+
For maintaining a uniform coding style, execute the command `clang-format -i *.{c,h}` and `shfmt -w $(find . -type f -name "*.sh")`.
51
53
52
54
## Coding Style for Modern C
53
55
@@ -877,22 +879,22 @@ Author: Jim Huang <jserv@ccns.ncku.edu.tw>
877
879
Date: Mon Feb 24 13:08:32 2025 +0800
878
880
879
881
Introduce CPU architecture filtering in scheduler
880
-
882
+
881
883
In environments with mixed CPU architectures, it is crucial to ensure
882
884
that an instance runs only on a host with a compatible CPU
883
885
type—preventing, for example, a RISC-V instance from being scheduled on
884
886
an Arm host.
885
-
887
+
886
888
This new scheduler filter enforces that requirement by comparing an
887
889
instance's architecture against the host's allowed architectures. For
888
890
the libvirt driver, the host's guest capabilities are queried, and the
889
891
permitted architectures are recorded in the permitted_instances_types
890
892
list within the host's cpu_info dictionary.
891
-
893
+
892
894
The filter systematically excludes hosts that do not support the
893
895
instance's CPU architecture. Additionally, RISC-V has been added to the
894
896
set of acceptable architectures for scheduling.
895
-
897
+
896
898
Note that the CPU architecture filter is disabled by default.
0 commit comments