Skip to content

Commit 3f05c58

Browse files
committed
Replace vera with clangformat
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik [email protected]
1 parent 846eb4f commit 3f05c58

File tree

394 files changed

+8296
-11462
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

394 files changed

+8296
-11462
lines changed

.clang-format

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
---
2+
Language: Cpp
3+
AlignAfterOpenBracket: Align
4+
AlignConsecutiveMacros: true
5+
AlignConsecutiveAssignments: false
6+
AlignConsecutiveDeclarations: false
7+
AlignEscapedNewlines: Left
8+
AlignOperands: true
9+
AlignTrailingComments: false
10+
AllowAllArgumentsOnNextLine: false
11+
AllowAllParametersOfDeclarationOnNextLine: false
12+
AllowShortBlocksOnASingleLine: Never
13+
AllowShortCaseLabelsOnASingleLine: false
14+
AllowShortFunctionsOnASingleLine: None
15+
AllowShortIfStatementsOnASingleLine: Never
16+
AllowShortLoopsOnASingleLine: false
17+
AlwaysBreakAfterReturnType: AllDefinitions
18+
AlwaysBreakBeforeMultilineStrings: false
19+
BinPackArguments: false
20+
BinPackParameters: false
21+
BraceWrapping:
22+
AfterCaseLabel: true
23+
AfterControlStatement: Always
24+
AfterEnum: true
25+
AfterFunction: true
26+
AfterStruct: true
27+
AfterUnion: true
28+
AfterExternBlock: false
29+
BeforeElse: true
30+
IndentBraces: false
31+
SplitEmptyFunction: true
32+
BreakBeforeBinaryOperators: NonAssignment
33+
BreakBeforeBraces: Custom
34+
BreakBeforeTernaryOperators: true
35+
BreakStringLiterals: true
36+
ColumnLimit: 120
37+
CommentPragmas: '^ IWYU pragma:'
38+
ContinuationIndentWidth: 2
39+
DeriveLineEnding: true
40+
DerivePointerAlignment: true
41+
DisableFormat: false
42+
ExperimentalAutoDetectBinPacking: true
43+
IncludeBlocks: Merge
44+
IndentCaseLabels: true
45+
IndentGotoLabels: true
46+
IndentPPDirectives: None
47+
IndentWidth: 2
48+
IndentWrappedFunctionNames: false
49+
KeepEmptyLinesAtTheStartOfBlocks: false
50+
MacroBlockBegin: ''
51+
MacroBlockEnd: ''
52+
MaxEmptyLinesToKeep: 1
53+
PenaltyBreakAssignment: 2
54+
PenaltyBreakBeforeFirstCallParameter: 19
55+
PenaltyBreakComment: 300
56+
PenaltyBreakFirstLessLess: 120
57+
PenaltyBreakString: 1000
58+
PenaltyBreakTemplateDeclaration: 10
59+
PenaltyExcessCharacter: 1000000
60+
PenaltyReturnTypeOnItsOwnLine: 60
61+
PointerAlignment: Right
62+
ReflowComments: true
63+
SortIncludes: true
64+
SpaceAfterCStyleCast: true
65+
SpaceAfterLogicalNot: false
66+
SpaceBeforeAssignmentOperators: true
67+
SpaceBeforeParens: Always
68+
SpaceInEmptyBlock: false
69+
SpaceInEmptyParentheses: false
70+
SpacesBeforeTrailingComments: 1
71+
SpacesInConditionalStatement: false
72+
SpacesInCStyleCastParentheses: false
73+
SpacesInParentheses: false
74+
SpacesInSquareBrackets: false
75+
SpaceBeforeSquareBrackets: false
76+
Standard: Auto
77+
StatementMacros:
78+
- JERRY_ASSERT
79+
- JERRY_UNREACHABLE
80+
TabWidth: 0
81+
UseCRLF: false
82+
UseTab: Never
83+
...
84+

.github/workflows/gh-actions.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ jobs:
1313
with:
1414
fetch-depth: 0
1515
- run: sudo apt update
16-
- run: sudo apt install doxygen vera++ cppcheck pylint python-serial
16+
- run: sudo apt install doxygen clang-format-10 cppcheck pylint python-serial
1717
- run: $RUNNER --check-signed-off=gh-actions
1818
- run: $RUNNER --check-doxygen
19-
- run: $RUNNER --check-vera
19+
- run: $RUNNER --check-format
2020
- run: $RUNNER --check-license
2121
- run: $RUNNER --check-magic-strings
2222
- run: $RUNNER --check-pylint

docs/00.GETTING-STARTED.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,10 @@ python tools/run-tests.py --check-signed-off
173173
python tools/run-tests.py --check-cppcheck
174174
```
175175

176-
**To run vera check**
176+
**To run format check**
177177

178178
```bash
179-
python tools/run-tests.py --check-vera
179+
python tools/run-tests.py --check-format
180180
```
181181

182182
**To get a list of all the available test options**

docs/08.CODING-STANDARDS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ review.
1212
* Tab characters are not allowed.
1313
* Maximum line length is 120 characters (excluding newline).
1414
* No trailing white space is allowed.
15-
* Run `tools/run-tests.py --check-vera` to check several
15+
* Run `tools/run-tests.py --check-format` to check several
1616
of the coding conventions automatically.
1717

1818
## Comments

jerry-core/api/jerry-debugger-transport.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,7 @@ jerry_debugger_transport_close (void)
137137
current_p->close (current_p);
138138

139139
current_p = next_p;
140-
}
141-
while (current_p != NULL);
140+
} while (current_p != NULL);
142141

143142
jerry_port_log (JERRY_LOG_LEVEL_DEBUG, "Debugger client connection closed.\n");
144143

@@ -164,8 +163,7 @@ jerry_debugger_transport_send (const uint8_t *message_p, /**< message to be sent
164163

165164
do
166165
{
167-
size_t fragment_length = (message_length <= max_send_size ? message_length
168-
: max_send_size);
166+
size_t fragment_length = (message_length <= max_send_size ? message_length : max_send_size);
169167

170168
memcpy (payload_p, message_p, fragment_length);
171169

@@ -176,8 +174,7 @@ jerry_debugger_transport_send (const uint8_t *message_p, /**< message to be sent
176174

177175
message_p += fragment_length;
178176
message_length -= fragment_length;
179-
}
180-
while (message_length > 0);
177+
} while (message_length > 0);
181178

182179
return true;
183180
} /* jerry_debugger_transport_send */

0 commit comments

Comments
 (0)