Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libmtime
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
icon-libraries
libmtime
Commits
486ccc7a
Commit
486ccc7a
authored
3 months ago
by
Sergey Kosukhin
Browse files
Options
Downloads
Patches
Plain Diff
ci: dump the style patch to the log
parent
7655e66d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!61
Add pre-commit hooks
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+1
-25
1 addition, 25 deletions
.gitlab-ci.yml
with
1 addition
and
25 deletions
.gitlab-ci.yml
+
1
−
25
View file @
486ccc7a
...
...
@@ -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
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment