Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
LHCb Conditions Database
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
LHCb CondDB
LHCb Conditions Database
Commits
50d6b091
Commit
50d6b091
authored
4 years ago
by
Marco Clemencic
Browse files
Options
Downloads
Patches
Plain Diff
Run pre-commit checks in Gitlab-CI
parent
d62492d8
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+18
-0
18 additions, 0 deletions
.gitlab-ci.yml
.pre-commit-config.yaml
+3
-0
3 additions, 0 deletions
.pre-commit-config.yaml
with
21 additions
and
0 deletions
.gitlab-ci.yml
0 → 100644
+
18
−
0
View file @
50d6b091
variables
:
TARGET_BRANCH
:
master
run-checks
:
image
:
python:3.9
variables
:
PRE_COMMIT_HOME
:
${CI_PROJECT_DIR}/.cache/pre-commit
cache
:
key
:
"
$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
paths
:
-
${CI_PROJECT_DIR}/.cache
script
:
-
python -m venv .cache/pre-commit-venv
-
. .cache/pre-commit-venv/bin/activate
-
pip install pre-commit
-
pre-commit --version
-
git fetch origin master
-
pre-commit run --from-ref FETCH_HEAD --to-ref HEAD
This diff is collapsed.
Click to expand it.
.pre-commit-config.yaml
+
3
−
0
View file @
50d6b091
...
@@ -5,6 +5,9 @@ repos:
...
@@ -5,6 +5,9 @@ repos:
-
id
:
check-yaml
-
id
:
check-yaml
# this is needed to allow custom classes in YAML
# this is needed to allow custom classes in YAML
entry
:
check-yaml --unsafe
entry
:
check-yaml --unsafe
files
:
'
.*.yml(/.*)?'
exclude
:
'
/IOVs$'
types
:
[
file
]
-
id
:
end-of-file-fixer
-
id
:
end-of-file-fixer
-
id
:
trailing-whitespace
-
id
:
trailing-whitespace
-
id
:
check-merge-conflict
-
id
:
check-merge-conflict
...
...
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