pre-upload: check_manifests: improve check significantly

A number of improvements:
- Read the Manifest from the commit, not from the filesystem
- Allow comments/blank lines in the middle
- Make sure there is always a newline at the end of the file
- Disallow blank lines at the start/end of the file

BUG=None
TEST=unittests pass

Change-Id: I91d4d7b283ac08410e83d653dacb981a07524fca
Reviewed-on: https://chromium-review.googlesource.com/849136
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
2 files changed