FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
cppcheck/runformat at main · cppcheck-opensource/cppcheck · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
cppcheck-opensource
/
cppcheck
Public
Notifications
You must be signed in to change notification settings
Fork
1.6k
Star
6.7k
Code
Pull requests
201
Actions
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Security and quality
Insights
Expand file tree
Breadcrumbs
cppcheck
/
runformat
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
56 lines (48 loc) · 1.8 KB
Breadcrumbs
cppcheck
/
runformat
Copy path
File metadata and controls
executable file
·
56 lines (48 loc) · 1.8 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!
/bin/bash
#
#
uncrustify-0.80.1 is used to format cppcheck source code.
#
#
1. Download source code: https://github.com/uncrustify/uncrustify/archive/refs/tags/uncrustify-0.80.1.zip
#
It's important that all Cppcheck developers use the exact same version so we don't get a "format battle".
#
2. Building:
#
- Linux: mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release .. && make
#
- Windows: mkdir build && cd build && cmake -G"NMake Makefiles" -DCMAKE_BUILD_TYPE=Release .. && nmake
#
3. Ensure that the binary "uncrustify" is found by runformat. Either:
#
- you can put uncrustify in your PATH
#
- you can create an environment variable UNCRUSTIFY that has the full path of the binary
UNCRUSTIFY_VERSION=
"
0.80.1
"
UNCRUSTIFY=
"
${UNCRUSTIFY-uncrustify}
"
DETECTED_VERSION=
$(
"
$UNCRUSTIFY
"
--version
2>&1
|
grep -o -E
'
[0-9.]+
'
)
if
[
"
$DETECTED_VERSION
"
!=
"
${UNCRUSTIFY_VERSION}
"
]
;
then
echo
"
You should use version:
${UNCRUSTIFY_VERSION}
"
echo
"
Detected version:
${DETECTED_VERSION}
"
exit
1
fi
#
OS variables
[
$(
uname -s
)
=
"
Darwin
"
]
&&
export
OSX=1
&&
export
UNIX=1
[
$(
uname -s
)
=
"
Linux
"
]
&&
export
LINUX=1
&&
export
UNIX=1
uname -s
|
grep -q
"
_NT-
"
&&
export
WINDOWS=1
if
[
$OSX
]
then
export
CPUCOUNT=
$(
sysctl -n hw.ncpu
)
elif
[
$LINUX
]
then
export
CPUCOUNT=
$(
nproc
)
else
export
CPUCOUNT=
"
1
"
fi
function
formatCplusplus
{
find
$1
-iname
'
*.h
'
\
-o -iname
'
*.c
'
\
-o -iname
'
*.cpp
'
\
|
xargs -n 1 -P
$CPUCOUNT
-I{} -t
$UNCRUSTIFY
-c .uncrustify.cfg --no-backup {}
}
ls
*
/
*
.cpp
*
/
*
.h
|
xargs -n 1 -P
$CPUCOUNT
-I{} -t
$UNCRUSTIFY
-c .uncrustify.cfg -l CPP --no-backup --replace {}
#
formatCplusplus cli/
#
formatCplusplus democlient/
#
formatCplusplus gui/
#
formatCplusplus lib/
#
formatCplusplus oss-fuzz/
#
formatCplusplus test/
#
formatCplusplus tools/
#
formatCplusplus samples/
Back
|
FazBrowse Home
|
New Git URL