-#!/usr/bin/env python
+#!/usr/bin/env python3
#
# Copyright (c) 2019 Inria
# All rights reserved
import os
import re
import sys
+from maint.lib import maintainers
from style.repo import GitRepo
print("""
The first line of a commit must contain one or more gem5 tags separated by
-commas (see MAINTAINERS for the possible tags), followed by a colon and a
-commit title. There must be no leading nor trailing whitespaces.
+commas (see MAINTAINERS.yaml for the possible tags), followed by a colon and
+a commit title. There must be no leading nor trailing whitespaces.
This header line must then be followed by an empty line. A detailed message,
although highly recommended, is not mandatory and can follow that empty line.
"""
# List of valid tags
- # @todo this is error prone, and should be extracted automatically from
- # a file
-
- valid_tags = ["arch", "arch-arm", "arch-gcn3",
- "arch-mips", "arch-power", "arch-riscv", "arch-sparc", "arch-x86",
- "base", "configs", "cpu", "cpu-kvm", "cpu-minor", "cpu-o3",
- "cpu-simple", "dev", "dev-arm", "dev-hsa", "dev-virtio", "ext",
- "fastmodel", "gpu-compute", "learning-gem5", "mem", "mem-cache",
- "mem-garnet", "mem-ruby", "misc", "python", "scons", "sim", "sim-se",
- "sim-power", "stats", "system", "system-arm", "systemc", "tests",
- "util", "RFC", "WIP"]
+ maintainer_dict = maintainers.Maintainers.from_file()
+ valid_tags = [tag for tag, _ in maintainer_dict]
+
+ # Remove non-tag 'pmc' and add special tags not in MAINTAINERS.yaml
+ valid_tags.remove('pmc')
+ valid_tags.extend(['RFC', 'WIP'])
tags = ''.join(commit_header.split(':')[0].split()).split(',')
if (any(tag not in valid_tags for tag in tags)):