Skip to content
Snippets Groups Projects
Commit 486ccc7a authored by Sergey Kosukhin's avatar Sergey Kosukhin
Browse files

ci: dump the style patch to the log

parent 7655e66d
No related branches found
No related tags found
1 merge request!61Add pre-commit hooks
......@@ -39,34 +39,10 @@ Check licenses:
interruptible: true
Check style:
extends: .colorized
variables:
STYLE_PATCH: ${CI_PROJECT_DIR}/style.patch
before_script:
- apk add git pre-commit
script:
- pre-commit run --color=always --all-files
- git -C "${CI_PROJECT_DIR}" diff --patch-with-raw > "${STYLE_PATCH}"
- |
# Test if patching is necessary
test -s "${STYLE_PATCH}" && {
printf "${RED}The source code does not meet the style requirements. \
Please, apply the patch (see artifacts).\nNote that the result of the \
formatting might depend on the versions of the formatting tools \
(clang-format and fprettify). In this project, whatever formatting this \
CI job produces is the correct one. If it expects you to re-format parts \
of the source code that you did not modify, do so in a separate commit, \
which must not be squashed, and list the commit in the \
'.git-blame-ignore-revs' file.\n${DEFAULT}"
exit 1
} || rm -rf "${STYLE_PATCH}"
artifacts:
paths:
- ${STYLE_PATCH}
expire_in: 60min
expose_as: 'Style Patch'
when: on_failure
- pre-commit run --show-diff-on-failure --color=always --all-files
tags:
- alpine
rules:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment