| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2015 The Chromium Authors. All rights reserved. | 2 # Copyright 2015 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 """CQ config validation library.""" | 6 """CQ config validation library.""" |
| 7 | 7 |
| 8 import argparse | 8 import argparse |
| 9 # The 'from google import protobuf' below was replaced to fix an issue where | 9 from google import protobuf |
| 10 # some users may have built-in google package installed on their system, which | |
| 11 # is incompatible with cq_pb2 below. This hack can be removed after | |
| 12 # http://crbug.com/503067 is resolved. | |
| 13 import protobuf26 as protobuf | |
| 14 import logging | 10 import logging |
| 15 import re | 11 import re |
| 16 import sys | 12 import sys |
| 17 | 13 |
| 18 from cq_client import cq_pb2 | 14 from cq_client import cq_pb2 |
| 19 | 15 |
| 20 | 16 |
| 21 REQUIRED_FIELDS = [ | 17 REQUIRED_FIELDS = [ |
| 22 'version', | 18 'version', |
| 23 'rietveld', | 19 'rietveld', |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 try: | 99 try: |
| 104 re.compile(base) | 100 re.compile(base) |
| 105 except re.error: | 101 except re.error: |
| 106 logging.error('failed to parse "%s" in project_bases as a regexp', base) | 102 logging.error('failed to parse "%s" in project_bases as a regexp', base) |
| 107 return False | 103 return False |
| 108 | 104 |
| 109 # TODO(sergiyb): For each field, check valid values depending on its | 105 # TODO(sergiyb): For each field, check valid values depending on its |
| 110 # semantics, e.g. email addresses, regular expressions etc. | 106 # semantics, e.g. email addresses, regular expressions etc. |
| 111 | 107 |
| 112 return True | 108 return True |
| OLD | NEW |