blob: ca163927cbb2b78fe94ab86e0bcfced648fae6ee [file] [log] [blame]
Patrick Williams215c1c32022-01-06 20:26:26 -06001#!/usr/bin/python3
2import re
3
4
5def project(name: str) -> bool:
6 reject_regex = [
7 ".*-oem",
8 "openbmc/ibm-.*",
9 "openbmc/intel-.*",
Patrick Williams215c1c32022-01-06 20:26:26 -060010 "openbmc/google-.*",
11 "openbmc/meta-.*",
12 ]
13
14 reject_repo = [
15 "openbmc/s2600wf-misc",
16 ]
17
18 for r in reject_repo:
19 if r == name:
20 return False
21
22 for r in reject_regex:
23 if re.match(r, name):
24 return False
25
26 return True
27
28
29def file(proj: str, filename: str) -> bool:
30 reject_regex = {
31 "all": [
Patrick Williamsb0ce01d2022-01-07 10:12:33 -060032 ".*/create_pel.*",
Patrick Williams215c1c32022-01-06 20:26:26 -060033 ".*/google/",
34 ".*/ibm/",
35 ".*/intel/",
36 "MAINTAINERS",
37 "OWNERS",
38 "ibm-.*",
39 "ibm_.*",
40 ],
41 "openbmc/entity-manager": ["configurations/.*"],
42 "openbmc/libmctp": ["docs/bindings/vendor-.*"],
43 "openbmc/openbmc": ["meta-(?!phosphor).*", "poky/.*"],
44 "openbmc/openbmc-test-automation": ["oem/.*", "openpower/.*"],
Patrick Williamsb0ce01d2022-01-07 10:12:33 -060045 "openbmc/openpower-libhei": [
46 "test/simulator/sample_data/.*",
47 "test/simulator/test_*cases/.*",
48 "xml/.*",
49 ],
50 "openbmc/openpower-hw-diags": [
51 ".*/pel/.*",
52 ".*/ras-data/.*",
53 ],
Patrick Williams215c1c32022-01-06 20:26:26 -060054 "openbmc/phosphor-debug-collector": [
55 "dump-extensions/.*",
56 "tools/dreport.d/ibm.d/.*",
57 ],
58 "openbmc/phosphor-fan-presence": [".*/config_files/.*"],
59 "openbmc/phosphor-power": [".*/config_files/.*"],
60 "openbmc/phosphor-led-manager": ["configs/.*"],
61 "openbmc/phosphor-logging": [".*/openpower-pels/.*"],
62 "openbmc/webui-vue": [
63 "src/env/.*",
64 ],
65 }
66
Patrick Williamsd0269de2022-01-06 21:04:25 -060067 reject_files = ["/COMMIT_MSG", "/PATCHSET_LEVEL"]
Patrick Williams215c1c32022-01-06 20:26:26 -060068
69 for r in reject_files:
70 if r == filename:
71 return False
72
73 for r in reject_regex.get(proj, []) + reject_regex.get("all", []):
74 if re.match(r, filename):
75 return False
76
77 return True