Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
waves
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
Pour rappel, le service sera inaccessible ce lundi 05/05/25 midi pour raison de mise à jour.
Show more breadcrumbs
Aerospace and Mechanical Engineering
waves
Commits
af4f15d2
Commit
af4f15d2
authored
4 years ago
by
Boman Romain
Browse files
Options
Downloads
Patches
Plain Diff
use relpath in skip
parent
b013a8be
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!58
Improve Continuous Integration
Pipeline
#1574
failed
4 years ago
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/format_code.py
+2
-6
2 additions, 6 deletions
scripts/format_code.py
with
2 additions
and
6 deletions
scripts/format_code.py
+
2
−
6
View file @
af4f15d2
...
...
@@ -15,23 +15,20 @@ def all_files(root,
skips
=
'
*.git*;*build*
'
,
single_level
=
False
,
yield_folders
=
False
):
print
(
'
all_files
'
)
# self.checkPath(root)
patterns
=
patterns
.
split
(
'
;
'
)
skips
=
skips
.
split
(
'
;
'
)
for
path
,
subdirs
,
files
in
os
.
walk
(
root
):
print
(
'
processing folder
'
,
path
)
if
yield_folders
:
files
.
extend
(
subdirs
)
files
.
sort
()
for
name
in
files
:
for
pattern
in
patterns
:
print
(
f
'
match
{
name
}
/
{
pattern
}
/
{
fnmatch
.
fnmatch
(
name
,
pattern
)
}
'
)
if
fnmatch
.
fnmatch
(
name
,
pattern
):
fullname
=
os
.
path
.
join
(
path
,
name
)
ok
=
True
for
skip
in
skips
:
if
fnmatch
.
fnmatch
(
fullname
,
skip
):
if
fnmatch
.
fnmatch
(
os
.
path
.
relpath
(
fullname
,
start
=
root
)
,
skip
):
ok
=
False
if
ok
:
yield
fullname
...
...
@@ -44,8 +41,7 @@ def main():
# loop over all files and format them
encs
=
{}
for
f
in
all_files
(
os
.
getcwd
(),
patterns
=
'
*.cpp;*.c;*.h;*.hpp
'
,
skips
=
'
*.git*;*build*
'
):
for
f
in
all_files
(
os
.
getcwd
(),
patterns
=
'
*.cpp;*.c;*.h;*.hpp
'
):
print
(
f
)
cmd
=
[
'
clang-format
'
,
"
-style=file
"
,
"
-i
"
,
f
]
retcode
=
subprocess
.
call
(
cmd
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment