FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
ncnn/codeformat.sh at master · Tencent/ncnn · GitHub
Tencent
ncnn
Repository navigation
Code
Issues
1.1k
(1.1k)
Pull requests
177
(177)
Discussions
Actions
Projects
Wiki
Security and quality
2
(2)
Insights
Expand file tree
Breadcrumbs
ncnn
/
codeformat.sh
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
13 lines (10 loc) · 775 Bytes
Breadcrumbs
ncnn
/
codeformat.sh
Copy path
File metadata and controls
executable file
·
13 lines (10 loc) · 775 Bytes
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
#!
/usr/bin/env bash
#
we run clang-format and astyle twice to get stable format output
format_code
() {
find src/ tools/ tests/ examples/ benchmark/ python/ -type f -name
'
*.c
'
-o -name
'
*.cpp
'
-o -name
'
*.cc
'
-o -name
'
*.h
'
|
grep -v python/pybind11
|
grep -v stb_image
|
grep -v ruapu
|
xargs -i clang-format -i {}
astyle -n -r
"
benchmark/*.h,*.cpp,*.cc
"
"
tests/*.h,*.cpp,*.cc
"
"
tools/*.h,*.cpp,*.cc
"
"
examples/*.h,*.cpp,*.cc
"
astyle -n -r
"
src/*.h,*.cpp,*.cc
"
--exclude=src/stb_image.h --exclude=src/stb_image_write.h --exclude=src/ruapu.h
astyle -n -r
"
python/*.h,*.cpp,*.cc
"
--exclude=python/pybind11
}
format_code
||
{
echo
'
Formatting failed
'
;
exit
1
;
}
#
first time execute
format_code
||
{
echo
'
Formatting failed
'
;
exit
1
;
}
#
second time execute
Back
|
FazBrowse Home
|
New Git URL