aboutsummaryrefslogtreecommitdiffstats
path: root/build/plugins/credits.py
diff options
context:
space:
mode:
authorDevtools Arcadia <arcadia-devtools@yandex-team.ru>2022-02-07 18:08:42 +0300
committerDevtools Arcadia <arcadia-devtools@mous.vla.yp-c.yandex.net>2022-02-07 18:08:42 +0300
commit1110808a9d39d4b808aef724c861a2e1a38d2a69 (patch)
treee26c9fed0de5d9873cce7e00bc214573dc2195b7 /build/plugins/credits.py
downloadydb-1110808a9d39d4b808aef724c861a2e1a38d2a69.tar.gz
intermediate changes
ref:cde9a383711a11544ce7e107a78147fb96cc4029
Diffstat (limited to 'build/plugins/credits.py')
-rw-r--r--build/plugins/credits.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/build/plugins/credits.py b/build/plugins/credits.py
new file mode 100644
index 0000000000..0ce1659326
--- /dev/null
+++ b/build/plugins/credits.py
@@ -0,0 +1,22 @@
+from _common import rootrel_arc_src
+
+
+def oncredits_disclaimer(unit, *args):
+ if unit.get('WITH_CREDITS'):
+ unit.message(["warn", "CREDITS WARNING: {}".format(' '.join(args))])
+
+def oncheck_contrib_credits(unit, *args):
+ module_path = rootrel_arc_src(unit.path(), unit)
+ excepts = set()
+ if 'EXCEPT' in args:
+ args = list(args)
+ except_pos = args.index('EXCEPT')
+ excepts = set(args[except_pos + 1:])
+ args = args[:except_pos]
+ for arg in args:
+ if module_path.startswith(arg) and not unit.get('CREDITS_TEXTS_FILE') and not unit.get('NO_CREDITS_TEXTS_FILE'):
+ for ex in excepts:
+ if module_path.startswith(ex):
+ break
+ else:
+ unit.message(["error", "License texts not found. See https://st.yandex-team.ru/DTCC-324"])