Factor out re-usable code from _check_license

This factors out the string parsing code from _check_license. This
enables us to easily add hooks for various licenses and other header
information which may apply to third_party projects that do not
follow the Chrome/Chromium OS convention.

Hooks which check for content in a file header will only need to do
two things:
1. Specify the content to find.
2. Specify a custom string to display in case of a mismatch.

BUG=none
TEST=tested by attempting to add a file with bad CrOS-style header

Change-Id: Ibf750863dfa8425ae8dd72a536e6e2e909df081c
Signed-off-by: David Hendricks <dhendrix@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/42594
Reviewed-by: David James <davidjames@chromium.org>
Reviewed-by: Doug Anderson <dianders@chromium.org>
1 file changed