-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Apparently, scripts/validate-c is not working in CI (or maybe maintainers ignored the failures from it) -- current C code gets some changes if we run indent on it. This commit fixes this, simplifying things along the way. In particular: 1. Remove "validate" make target, add "cfmt" target that just runs indent on all *.c files in the repository (NOTE that *.h files are not included, as before). This may help a contributor to fix their code -- they just need to run "make cfmt" now instead of running "make validate" and copy-pasting the indent command and options from the hint. 2. Split GHA validate/misc into validate/release and validate/cfmt. The latter checks that the sources are not changed after "make cfmt". 3. Adds a few more options to indent. This was mostly motivated by trying to save the existing formatting, minimizing the amount of changes indent produces. The new options are: * -il0: sets the offset for goto labels to 0 (currently all labels but one are not indented -- let's keep it that way); * -ppi2: sets the indentation for nested preprocessor directives to 2 spaces (same as it is done in "SYS_memfd_create" defines); * -cp1: sets the indentation between #else / #endif and the following comment to 1 space. 4. Reformat the code using the new indent options. 5. Remove the now-unused script/{.validate,validate-c}. Signed-off-by: Kir Kolyshkin <[email protected]>
- Loading branch information
Showing
6 changed files
with
70 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.