diff options
author | Peter Krempa <pkrempa@redhat.com> | 2023-02-27 17:36:36 +0100 |
---|---|---|
committer | Peter Krempa <pkrempa@redhat.com> | 2023-02-27 17:37:46 +0100 |
commit | b2cb5dc4d56a96eaffd4772a20fc7fbdf95ce59f (patch) | |
tree | e35843ca783ef15e4f468f9a3432624832aceb94 | |
parent | 61a1dd5f68bff7edf68320055c050456aaa867fb (diff) | |
download | libvirt-ci-b2cb5dc4d56a96eaffd4772a20fc7fbdf95ce59f.zip libvirt-ci-b2cb5dc4d56a96eaffd4772a20fc7fbdf95ce59f.tar.gz libvirt-ci-b2cb5dc4d56a96eaffd4772a20fc7fbdf95ce59f.tar.bz2 |
gitlab: Always format 'variables:' using 'format_variables' helper
Convert few job templates that formatted variables inline to use the
common helper.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
-rw-r--r-- | lcitool/gitlab.py | 45 | ||||
-rw-r--r-- | tests/data/manifest/out/ci/gitlab/sanity-checks.yml | 10 |
2 files changed, 30 insertions, 25 deletions
diff --git a/lcitool/gitlab.py b/lcitool/gitlab.py index 85ffb42..3954fb1 100644 --- a/lcitool/gitlab.py +++ b/lcitool/gitlab.py @@ -446,58 +446,63 @@ def code_fmt_template(): def cargo_fmt_job(): + jobvars = { + "NAME": "cargo-fmt", + "EXT": "txt" + } return textwrap.dedent( """ cargo-fmt: extends: .code_format - variables: - NAME: cargo-fmt - EXT: txt - """) + """) + format_variables(jobvars) def go_fmt_job(): + jobvars = { + "NAME": "go-fmt", + "EXT": "patch" + } return textwrap.dedent( """ go-fmt: extends: .code_format - variables: - NAME: go-fmt - EXT: patch - """) + """) + format_variables(jobvars) def clang_format_job(): + jobvars = { + "NAME": "clang-format", + "EXT": "patch" + } return textwrap.dedent( """ clang-format: extends: .code_format - variables: - NAME: clang-format - EXT: patch - """) + """) + format_variables(jobvars) def black_job(): + jobvars = { + "NAME": "black", + "EXT": "txt" + } return textwrap.dedent( """ black: extends: .code_format - variables: - NAME: black - EXT: txt - """) + """) + format_variables(jobvars) def flake8_job(): + jobvars = { + "NAME": "flake8", + "EXT": "txt" + } return textwrap.dedent( """ flake8: extends: .code_format - variables: - NAME: flake8 - EXT: txt - """) + """) + format_variables(jobvars) def _container_job(target, arch, image, allow_failure, optional): diff --git a/tests/data/manifest/out/ci/gitlab/sanity-checks.yml b/tests/data/manifest/out/ci/gitlab/sanity-checks.yml index 07cc27e..c158176 100644 --- a/tests/data/manifest/out/ci/gitlab/sanity-checks.yml +++ b/tests/data/manifest/out/ci/gitlab/sanity-checks.yml @@ -52,33 +52,33 @@ check-dco: cargo-fmt: extends: .code_format variables: - NAME: cargo-fmt EXT: txt + NAME: cargo-fmt go-fmt: extends: .code_format variables: - NAME: go-fmt EXT: patch + NAME: go-fmt clang-format: extends: .code_format variables: - NAME: clang-format EXT: patch + NAME: clang-format black: extends: .code_format variables: - NAME: black EXT: txt + NAME: black flake8: extends: .code_format variables: - NAME: flake8 EXT: txt + NAME: flake8 |