From f916965cd57ef5d373758e64bee07548e0d63be8 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Fri, 3 Jul 2020 18:43:16 +0200 Subject: problemmatchers: Write multiple files --- scripts/dev/ci/problemmatchers.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/scripts/dev/ci/problemmatchers.py b/scripts/dev/ci/problemmatchers.py index 876d00a90..0f8ce8d1f 100644 --- a/scripts/dev/ci/problemmatchers.py +++ b/scripts/dev/ci/problemmatchers.py @@ -168,13 +168,10 @@ MATCHERS = { } -def add_matcher(output_dir, testenv, data): - - for idx, sub_data in enumerate(data): - sub_data['owner'] = '{}-{}'.format(testenv, idx) - out_data = {'problemMatcher': data} - - output_file = output_dir / '{}.json'.format(testenv) +def add_matcher(output_dir, owner, data): + data['owner'] = owner + out_data = {'problemMatcher': [data]} + output_file = output_dir / '{}.json'.format(owner) with output_file.open('w', encoding='utf-8') as f: json.dump(out_data, f) @@ -191,9 +188,9 @@ def main(testenv, tempdir): output_dir = pathlib.Path(tempdir) - add_matcher(output_dir=output_dir, - testenv=testenv, - data=MATCHERS[testenv]) + for idx, data in enumerate(MATCHERS[testenv]): + owner = '{}-{}'.format(testenv, idx) + add_matcher(output_dir=output_dir, owner=owner, data=data) if __name__ == '__main__': -- cgit v1.2.3-54-g00ecf