Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
BC
public
external
libvpx
Commits
2b6fd28d
Commit
2b6fd28d
authored
12 years ago
by
John Koleszar
Committed by
Gerrit Code Review
12 years ago
Browse files
Options
Download
Plain Diff
Merge "lint-hunks: support operating on arbirary revs" into experimental
parents
07c03b3f
b1cb0077
v1.14.0-linphone
1.4.X
experimental
feature/update_to_v1.9.0-linphone
feature/uwp_nuget
forest
frame_parallel
highbitdepth
indianrunnerduck
javanwhistlingduck
khakicampbell
linphone
linphone-android
linphone-old
longtailedduck
m29-baseline
m31-baseline
m49-2623
m52-2743
m54-2840
m56-2924
m66-3359
m68-3440
mandarinduck
mcw
mcw2
nextgen
nextgenv2
pcs-2013
playground
sandbox/Jingning/experimental
sandbox/Jingning/transcode
sandbox/Jingning/vpx
sandbox/aconverse@google.com/ansbench
sandbox/debargha/playground
sandbox/hkuang/frame_parallel
sandbox/hkuang@google.com/decode
sandbox/jimbankoski@google.com/proposed-aom
sandbox/jingning@google.com/decoder_test_suite
sandbox/jingning@google.com/experimental
sandbox/jzern@google.com/test
sandbox/wangch@google.com/vp9
sandbox/yaowu@google.com/mergeaom
stable-vp9-decoder
v1.12.0-linphone
v1.6.1_linphone
v1.7.0-linphone
v1.9.0-linphone
vp9-preview
v1.9.0
v1.9.0-rc1
v1.8.2
v1.8.1
v1.8.0
v1.7.0
v1.6.1
v1.6.0
v1.5.0
v1.4.0
v1.3.0
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tools/lint-hunks.py
+14
-3
tools/lint-hunks.py
with
14 additions
and
3 deletions
tools/lint-hunks.py
+
14
−
3
View file @
2b6fd28d
...
@@ -21,7 +21,8 @@ SHORT_OPTIONS = "h"
...
@@ -21,7 +21,8 @@ SHORT_OPTIONS = "h"
LONG_OPTIONS
=
[
"help"
]
LONG_OPTIONS
=
[
"help"
]
TOPLEVEL_CMD
=
[
"git"
,
"rev-parse"
,
"--show-toplevel"
]
TOPLEVEL_CMD
=
[
"git"
,
"rev-parse"
,
"--show-toplevel"
]
DIFF_CMD
=
[
"git"
,
"diff-index"
,
"-u"
,
"--cached"
,
"HEAD"
,
"--"
]
DIFF_CMD
=
[
"git"
,
"diff"
]
DIFF_INDEX_CMD
=
[
"git"
,
"diff-index"
,
"-u"
,
"--cached"
,
"HEAD"
,
"--"
]
SHOW_CMD
=
[
"git"
,
"show"
]
SHOW_CMD
=
[
"git"
,
"show"
]
CPPLINT_FILTERS
=
[
"-readability/casting"
,
"-runtime/int"
]
CPPLINT_FILTERS
=
[
"-readability/casting"
,
"-runtime/int"
]
...
@@ -61,7 +62,7 @@ def main(argv=None):
...
@@ -61,7 +62,7 @@ def main(argv=None):
argv
=
sys
.
argv
argv
=
sys
.
argv
try
:
try
:
try
:
try
:
opts
,
_
=
getopt
.
getopt
(
argv
[
1
:],
SHORT_OPTIONS
,
LONG_OPTIONS
)
opts
,
args
=
getopt
.
getopt
(
argv
[
1
:],
SHORT_OPTIONS
,
LONG_OPTIONS
)
except
getopt
.
error
,
msg
:
except
getopt
.
error
,
msg
:
raise
Usage
(
msg
)
raise
Usage
(
msg
)
...
@@ -71,10 +72,20 @@ def main(argv=None):
...
@@ -71,10 +72,20 @@ def main(argv=None):
print
__doc__
print
__doc__
sys
.
exit
(
0
)
sys
.
exit
(
0
)
if
args
and
len
(
args
)
>
1
:
print
__doc__
sys
.
exit
(
0
)
# Find the fully qualified path to the root of the tree
# Find the fully qualified path to the root of the tree
tl
=
Subprocess
(
TOPLEVEL_CMD
,
stdout
=
subprocess
.
PIPE
)
tl
=
Subprocess
(
TOPLEVEL_CMD
,
stdout
=
subprocess
.
PIPE
)
tl
=
tl
.
communicate
()[
0
].
strip
()
tl
=
tl
.
communicate
()[
0
].
strip
()
# See if we're working on the index or not.
if
args
:
diff_cmd
=
DIFF_CMD
+
[
args
[
0
]
+
"^!"
]
else
:
diff_cmd
=
DIFF_INDEX_CMD
# Build the command line to execute cpplint
# Build the command line to execute cpplint
cpplint_cmd
=
[
os
.
path
.
join
(
tl
,
"tools"
,
"cpplint.py"
),
cpplint_cmd
=
[
os
.
path
.
join
(
tl
,
"tools"
,
"cpplint.py"
),
"--filter="
+
","
.
join
(
CPPLINT_FILTERS
),
"--filter="
+
","
.
join
(
CPPLINT_FILTERS
),
...
@@ -82,7 +93,7 @@ def main(argv=None):
...
@@ -82,7 +93,7 @@ def main(argv=None):
# Get a list of all affected lines
# Get a list of all affected lines
file_affected_line_map
=
{}
file_affected_line_map
=
{}
p
=
Subprocess
(
DIFF_CMD
,
stdout
=
subprocess
.
PIPE
)
p
=
Subprocess
(
diff_cmd
,
stdout
=
subprocess
.
PIPE
)
stdout
=
p
.
communicate
()[
0
]
stdout
=
p
.
communicate
()[
0
]
for
hunk
in
diff
.
ParseDiffHunks
(
StringIO
.
StringIO
(
stdout
)):
for
hunk
in
diff
.
ParseDiffHunks
(
StringIO
.
StringIO
(
stdout
)):
filename
=
hunk
.
right
.
filename
[
2
:]
filename
=
hunk
.
right
.
filename
[
2
:]
...
...
This diff is collapsed.
Click to expand it.
Preview
Supports
Markdown
0%
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
Menu
Explore
Projects
Groups
Topics
Snippets