1 # SPDX-License-Identifier: EPL-1.0
2 ##############################################################################
3 # Copyright (c) 2018 The Linux Foundation and others.
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Eclipse Public License v1.0
7 # which accompanies this distribution, and is available at
8 # http://www.eclipse.org/legal/epl-v10.html
9 ##############################################################################
10 """Ensures that the prefix MUST be set to blank.
12 The production prefix MUST always be a blank string.
15 __author__ = "Thanh Ha"
23 def check_prefix(filename):
24 """Check if a prefix was checked into this repo."""
25 with open(filename, "r") as _file:
26 for num, line in enumerate(_file, 1):
27 if re.search(r"^\s+prefix:", line):
30 "ERROR: A non-blank prefix is defined in "
31 "jjb/defaults.yaml. The prefix MUST be set to blank "
37 if __name__ == "__main__":
38 check_prefix(os.path.join("jjb", "defaults.yaml"))