Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Grpc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tci-gateway-module
Grpc
Commits
ad62c291
Commit
ad62c291
authored
8 years ago
by
Nathaniel Manista
Committed by
GitHub
8 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #9965 from nathanielmanistaatgoogle/yapf
Add test behavior to yapf_code.sh.
parents
5dc79eb5
9f1e5ab3
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitignore
+1
-1
1 addition, 1 deletion
.gitignore
tools/distrib/yapf_code.sh
+38
-21
38 additions, 21 deletions
tools/distrib/yapf_code.sh
with
39 additions
and
22 deletions
.gitignore
+
1
−
1
View file @
ad62c291
...
@@ -8,7 +8,7 @@ objs
...
@@ -8,7 +8,7 @@ objs
# Python items
# Python items
cython_debug/
cython_debug/
python_build/
python_build/
python_format_v
en
v
/
yapf_virtual_environm
en
t
/
python_pylint_venv/
python_pylint_venv/
.coverage*
.coverage*
.eggs
.eggs
...
...
This diff is collapsed.
Click to expand it.
tools/distrib/yapf_code.sh
+
38
−
21
View file @
ad62c291
...
@@ -31,31 +31,48 @@
...
@@ -31,31 +31,48 @@
set
-ex
set
-ex
# change to root directory
# change to root directory
cd
$(
dirname
$0
)
/../..
cd
"
$(
dirname
"
${
0
}
"
)
/../..
"
DIRS
=
src/python
DIRS
=(
EXCLUSIONS
=
'src/python/grpcio/grpc_*.py src/python/grpcio_health_checking/grpc_*.py src/python/grpcio_reflection/grpc_*.py src/python/grpcio_tests/grpc_*.py'
'src/python'
)
EXCLUSIONS
=(
'grpcio/grpc_*.py'
'grpcio_health_checking/grpc_*.py'
'grpcio_reflection/grpc_*.py'
'grpcio_tests/grpc_*.py'
)
VIRTUALENV
=
python_format_v
en
v
VIRTUALENV
=
yapf_virtual_environm
en
t
virtualenv
$VIRTUALENV
virtualenv
$VIRTUALENV
PYTHON
=
`
realpath
$VIRTUALENV
/bin/python
`
PYTHON
=
$(
realpath
"
${
VIRTUALENV
}
/bin/python"
)
$PYTHON
-m
pip
install
futures
$PYTHON
-m
pip
install
--upgrade
pip
$PYTHON
-m
pip
install
--upgrade
futures
$PYTHON
-m
pip
install
yapf
==
0.16.0
$PYTHON
-m
pip
install
yapf
==
0.16.0
exclusion_args
=
""
yapf
()
{
for
exclusion
in
$EXCLUSIONS
;
do
local
exclusion
exclusion_args
=()
exclusion_args
=
"
$exclusion_args
--exclude
$exclusion
"
for
exclusion
in
"
${
EXCLUSIONS
[@]
}
"
;
do
done
exclusion_args+
=(
"--exclude"
"
$1
/
${
exclusion
}
"
)
done
$PYTHON
-m
yapf
-i
-r
--style
=
setup.cfg
-p
"
${
exclusion_args
[@]
}
"
"
${
1
}
"
}
script_result
=
0
if
[[
-z
"
${
TEST
}
"
]]
;
then
for
dir
in
$DIRS
;
do
for
dir
in
"
${
DIRS
[@]
}
"
;
do
tempdir
=
`
mktemp
-d
`
yapf
"
${
dir
}
"
cp
-RT
$dir
$tempdir
done
$PYTHON
-m
yapf
-i
-r
-p
$exclusion_args
$dir
else
if
!
diff
-r
$dir
$tempdir
;
then
ok
=
yes
script_result
=
1
for
dir
in
"
${
DIRS
[@]
}
"
;
do
fi
tempdir
=
$(
mktemp
-d
)
rm
-rf
$tempdir
cp
-RT
"
${
dir
}
"
"
${
tempdir
}
"
done
yapf
"
${
tempdir
}
"
exit
$script_result
diff
-ru
"
${
dir
}
"
"
${
tempdir
}
"
||
ok
=
no
rm
-rf
"
${
tempdir
}
"
done
if
[[
${
ok
}
==
no
]]
;
then
false
fi
fi
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