Enabling and fixing CheckNewlineAtTheEndOfProtoFiles

This check has been skipped during the migration from src/webrtc to
src. It was also reporting false positives. Now it should be fixed.

NOTRY=True

Bug: chromium:611808
Change-Id: Id8567dd92099e75ac35351f053829deebf28a9d1
Reviewed-on: https://webrtc-review.googlesource.com/1580
Reviewed-by: Henrik Kjellander <kjellander@webrtc.org>
Reviewed-by: Henrik Kjellander <kjellander@google.com>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#19887}
This commit is contained in:
Mirko Bonadei
2017-09-18 11:33:13 +02:00
committed by Commit Bot
parent cb728ea83a
commit a730c1c5ae
3 changed files with 75 additions and 6 deletions

View File

@ -6,6 +6,9 @@
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
# This file is inspired to [1].
# [1] - https://cs.chromium.org/chromium/src/PRESUBMIT_test_mocks.py
class MockInputApi(object):
"""Mock class for the InputApi class.
@ -16,6 +19,11 @@ class MockInputApi(object):
def __init__(self):
self.change = MockChange([])
self.files = []
def AffectedSourceFiles(self, file_filter=None):
# pylint: disable=unused-argument
return self.files
class MockOutputApi(object):
@ -39,6 +47,7 @@ class MockOutputApi(object):
MockOutputApi.PresubmitResult.__init__(self, message, items, long_text)
self.type = 'error'
class MockChange(object):
"""Mock class for Change class.
@ -48,3 +57,17 @@ class MockChange(object):
def __init__(self, changed_files):
self._changed_files = changed_files
class MockFile(object):
"""Mock class for the File class.
This class can be used to form the mock list of changed files in
MockInputApi for presubmit unittests.
"""
def __init__(self, local_path):
self._local_path = local_path
def LocalPath(self):
return self._local_path