diff options
author | 2017-11-10 15:43:17 -0500 | |
---|---|---|
committer | 2017-11-13 13:25:05 -0500 | |
commit | 53b2a73c375abcb20c0c8ec404720513555c5365 (patch) | |
tree | 137a22ad3ce569fb8b48c8090202c98d021b6cd7 /tools/apilint | |
parent | ae5eb83a32a2005bd2c872bdf7b0621190ddb062 (diff) |
Add api lint to upload checks
Currently will never block upload, only considered a warning, but
will print out any lint issues discovered.
Test: do an upload
Bug: 69115822
Change-Id: I69b8e5a3f92ac28ee3c954408e88a1056c33af65
Diffstat (limited to 'tools/apilint')
-rw-r--r-- | tools/apilint/apilint.py | 10 | ||||
-rwxr-xr-x | tools/apilint/apilint_sha.sh | 4 |
2 files changed, 10 insertions, 4 deletions
diff --git a/tools/apilint/apilint.py b/tools/apilint/apilint.py index 2eab22e8ec14..c9f3199ef616 100644 --- a/tools/apilint/apilint.py +++ b/tools/apilint/apilint.py @@ -1371,7 +1371,9 @@ if __name__ == "__main__": print """ - print "%s API style issues %s\n" % ((format(fg=WHITE, bg=BLUE, bold=True), format(reset=True))) - for f in sorted(cur_fail): - print cur_fail[f] - print + if len(cur_fail) != 0: + print "%s API style issues %s\n" % ((format(fg=WHITE, bg=BLUE, bold=True), format(reset=True))) + for f in sorted(cur_fail): + print cur_fail[f] + print + sys.exit(77) diff --git a/tools/apilint/apilint_sha.sh b/tools/apilint/apilint_sha.sh new file mode 100755 index 000000000000..2a45b10392d7 --- /dev/null +++ b/tools/apilint/apilint_sha.sh @@ -0,0 +1,4 @@ +#!/bin/bash +if git show --name-only --pretty=format: $1 | grep api/ > /dev/null; then + python tools/apilint/apilint.py <(git show $1:api/current.txt) <(git show $1^:api/current.txt) +fi |