Skip to content

Commit 10717ab

Browse files
author
Robert Fancsik
committed
Replace vera++ with clang-format
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik [email protected]
1 parent bc091e1 commit 10717ab

File tree

545 files changed

+10204
-13884
lines changed

Some content is hidden

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

545 files changed

+10204
-13884
lines changed

.clang-format

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
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+
ContinuationIndentWidth: 2
38+
Cpp11BracedListStyle: false
39+
DeriveLineEnding: true
40+
DerivePointerAlignment: true
41+
DisableFormat: false
42+
ExperimentalAutoDetectBinPacking: true
43+
IncludeBlocks: Regroup
44+
IncludeCategories:
45+
- Regex: '<[-.a-z]*>'
46+
Priority: 1
47+
- Regex: '"jerryscript[-.a-z]*"'
48+
Priority: 2
49+
- Regex: '"ecma[-.a-z]*"'
50+
Priority: 3
51+
- Regex: '.*'
52+
Priority: 4
53+
IndentCaseLabels: true
54+
IndentGotoLabels: true
55+
IndentPPDirectives: None
56+
IndentWidth: 2
57+
IndentWrappedFunctionNames: false
58+
KeepEmptyLinesAtTheStartOfBlocks: false
59+
MacroBlockBegin: ''
60+
MacroBlockEnd: ''
61+
MaxEmptyLinesToKeep: 1
62+
PointerAlignment: Right
63+
ReflowComments: true
64+
SortIncludes: true
65+
SpaceAfterCStyleCast: true
66+
SpaceAfterLogicalNot: false
67+
SpaceBeforeAssignmentOperators: true
68+
SpaceBeforeParens: Always
69+
SpaceInEmptyBlock: false
70+
SpaceInEmptyParentheses: false
71+
SpacesBeforeTrailingComments: 1
72+
SpacesInConditionalStatement: false
73+
SpacesInCStyleCastParentheses: false
74+
SpacesInParentheses: false
75+
SpacesInSquareBrackets: false
76+
SpaceBeforeSquareBrackets: false
77+
Standard: Auto
78+
StatementMacros:
79+
- JERRY_ASSERT
80+
- JERRY_STATIC_ASSERT
81+
- JERRY_UNREACHABLE
82+
TabWidth: 0
83+
UseCRLF: false
84+
UseTab: Never
85+
...

.github/workflows/gh-actions.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,16 @@ jobs:
1212
- uses: actions/checkout@v2
1313
with:
1414
fetch-depth: 0
15+
- uses: actions/setup-python@v2
16+
with:
17+
python-version: '3.8'
1518
- run: sudo apt update
16-
- run: sudo apt install doxygen vera++ cppcheck pylint python-serial
19+
- run: sudo apt install doxygen clang-format-10 cppcheck pylint python-serial
1720
- run: $RUNNER --check-signed-off=gh-actions
1821
if: ${{ always() }}
1922
- run: $RUNNER --check-doxygen
2023
if: ${{ always() }}
21-
- run: $RUNNER --check-vera
24+
- run: $RUNNER --check-format
2225
if: ${{ always() }}
2326
- run: $RUNNER --check-license
2427
if: ${{ always() }}
@@ -145,7 +148,7 @@ jobs:
145148
- run: sudo apt update
146149
- run: sudo apt install gcc-multilib
147150
- run: $RUNNER -q --unittests
148-
# clang has bug in supporting lto
151+
# clang has bug in supporting lto
149152
- run: $RUNNER -q --buildoption-test --buildoptions=--lto=off
150153

151154
ASAN_Tests:

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/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ set(SOURCE_CORE_FILES
132132
api/jerry-debugger-transport.c
133133
api/jerry-debugger.c
134134
api/jerry-snapshot.c
135-
api/jerry.c
135+
api/jerryscript.c
136136
debugger/debugger.c
137137
ecma/base/ecma-alloc.c
138138
ecma/base/ecma-gc.c

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

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@
1313
* limitations under the License.
1414
*/
1515

16+
#include "jerryscript.h"
17+
1618
#include "debugger.h"
1719
#include "jcontext.h"
18-
#include "jerryscript.h"
1920

2021
#if JERRY_DEBUGGER
2122

@@ -137,8 +138,7 @@ jerry_debugger_transport_close (void)
137138
current_p->close (current_p);
138139

139140
current_p = next_p;
140-
}
141-
while (current_p != NULL);
141+
} while (current_p != NULL);
142142

143143
jerry_port_log (JERRY_LOG_LEVEL_DEBUG, "Debugger client connection closed.\n");
144144

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

165165
do
166166
{
167-
size_t fragment_length = (message_length <= max_send_size ? message_length
168-
: max_send_size);
167+
size_t fragment_length = (message_length <= max_send_size ? message_length : max_send_size);
169168

170169
memcpy (payload_p, message_p, fragment_length);
171170

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

177176
message_p += fragment_length;
178177
message_length -= fragment_length;
179-
}
180-
while (message_length > 0);
178+
} while (message_length > 0);
181179

182180
return true;
183181
} /* jerry_debugger_transport_send */

jerry-core/api/jerry-debugger.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@
1313
* limitations under the License.
1414
*/
1515

16+
#include "jerryscript.h"
17+
1618
#include "debugger.h"
1719
#include "jcontext.h"
18-
#include "jerryscript.h"
1920

2021
/**
2122
* Checks whether the debugger is connected.

0 commit comments

Comments
 (0)