diff options
author | spreis <spreis@yandex-team.com> | 2024-03-08 11:04:37 +0300 |
---|---|---|
committer | spreis <spreis@yandex-team.com> | 2024-03-08 11:18:05 +0300 |
commit | e8116f70daae60dcbf13132581dba893802ce3fe (patch) | |
tree | 9613fa886e710fdd8991e0dda5115c741cdd34a9 /build/plugins/macros_with_error.py | |
parent | ffdf61ee8c757756f6215215dbb7f8504afacad1 (diff) | |
download | ydb-e8116f70daae60dcbf13132581dba893802ce3fe.tar.gz |
Add DECLARE_IN_DIRS macro
aaac7e22ec66cd83845962458e8aefb7a9fa58dd
Diffstat (limited to 'build/plugins/macros_with_error.py')
-rw-r--r-- | build/plugins/macros_with_error.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/build/plugins/macros_with_error.py b/build/plugins/macros_with_error.py index 81cd709678..003f4a8bf3 100644 --- a/build/plugins/macros_with_error.py +++ b/build/plugins/macros_with_error.py @@ -30,3 +30,31 @@ def onassert(unit, *args): if val and val.lower() == "no": msg = ' '.join(args[1:]) ymake.report_configure_error(msg) + + +def onvalidate_in_dirs(unit, *args): + files_var = args[0] + pattern = args[1] + no_srcdir = args[2] == '--' + srcdir = '' if no_srcdir else args[2] + dirs = args[3:] if no_srcdir else args[4:] + pfx = '[[imp]]DECLARE_IN_DIRS[[rst]]: ' + + if '**' in pattern: + ymake.report_configure_error(f"{pfx}'**' in files mask is prohibited. Seen [[unimp]]{pattern}[[rst]]") + unit.set([files_var, ""]) + + for pat in ('*', '?'): + if pat in srcdir: + ymake.report_configure_error( + f"{pfx}'{pat}' in [[imp]]SRCDIR[[rst]] argument is prohibited. Seen [[unimp]]{srcdir}[[rst]]" + ) + unit.set([files_var, ""]) + + for dir in dirs: + for pat in ('*', '?', '$', '..'): + if pat in dir: + ymake.report_configure_error( + f"{pfx}'{pat}' in [[imp]]DIRS[[rst]] argument is prohibited. Seen [[unimp]]{dir}[[rst]]" + ) + unit.set([files_var, ""]) |