Skip to content

Commit 10327b0

Browse files
committed
Merge pull request #1824 from bettio/clang-format-insert-braces
.clang-format: enable `InsertBraces` option These changes are made under both the "Apache 2.0" and the "GNU Lesser General Public License 2.1 or later" license terms (dual license). SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later
2 parents 211fc3e + 2c644e1 commit 10327b0

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

.clang-format

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ IndentCaseLabels: true
7878
IndentPPDirectives: None
7979
IndentWidth: 4
8080
IndentWrappedFunctionNames: false
81+
InsertBraces: true
8182
JavaScriptQuotes: Leave
8283
JavaScriptWrapImports: true
8384
KeepEmptyLinesAtTheStartOfBlocks: true

C_CODING_STYLE.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2758,6 +2758,9 @@ BraceWrapping:
27582758
BeforeElse: false
27592759
BeforeWhile: false
27602760

2761+
# Use braces for single-statement blocks (rule: AVMCCS-F002)
2762+
InsertBraces: true
2763+
27612764
# Spacing (rules: AVMCCS-F004, AVMCCS-F015, AVMCCS-F016, AVMCCS-F018, AVMCCS-F020)
27622765
PointerAlignment: Right # AVMCCS-F004: * with variable
27632766
SpaceAfterCStyleCast: true # AVMCCS-F018: Space after cast

src/libAtomVM/posix_nifs.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -653,8 +653,9 @@ static term nif_atomvm_subprocess(Context *ctx, int argc, term argv[])
653653
closefrom(2);
654654
#else
655655
int maxfd = sysconf(_SC_OPEN_MAX);
656-
for (int fd = 3; fd < maxfd; fd++)
656+
for (int fd = 3; fd < maxfd; fd++) {
657657
close(fd);
658+
}
658659
#endif
659660
execve(path, args, envp);
660661
exit(1);

0 commit comments

Comments
 (0)