Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
MeanFi
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
Quantum Tinkerer
MeanFi
Commits
80a840ab
Commit
80a840ab
authored
11 months ago
by
Kostas Vilkelis
Browse files
Options
Downloads
Patches
Plain Diff
set up precommit hooks
parent
de992983
No related branches found
No related tags found
1 merge request
!5
Release version
Pipeline
#178555
failed
11 months ago
Stage: test
Stage: deploy
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitlab-ci.yml
+12
-0
12 additions, 0 deletions
.gitlab-ci.yml
.hooks/pre-commit
+0
-32
0 additions, 32 deletions
.hooks/pre-commit
.pre-commit-config.yaml
+16
-0
16 additions, 0 deletions
.pre-commit-config.yaml
with
28 additions
and
32 deletions
.gitlab-ci.yml
+
12
−
0
View file @
80a840ab
...
...
@@ -53,3 +53,15 @@ pages:
paths
:
-
public
run pre-commit
:
variables
:
PRE_COMMIT_HOME
:
$CI_PROJECT_DIR/.pre-commit-cache
script
:
-
micromamba install -c conda-forge -y mamba pip pre-commit git
-
git config --global --add safe.directory $CI_PROJECT_DIR
-
pre-commit run --all-files
cache
:
key
:
"
$CI_JOB_NAME"
paths
:
-
.pre-commit-cache
-
micromamba
This diff is collapsed.
Click to expand it.
.hooks/pre-commit
deleted
100755 → 0
+
0
−
32
View file @
de992983
#!/bin/sh
#
# strip output of IPython Notebooks
# add this as `.git/hooks/pre-commit`
# to run every time you commit a notebook
#
# requires `jupyter nbconvert` to be available on your PATH
if
git rev-parse
--verify
HEAD
>
/dev/null 2>&1
;
then
against
=
HEAD
else
# Initial commit: diff against an empty tree object
against
=
4b825dc642cb6eb9a060e54bf8d69288fbee4904
fi
# Find notebooks to be committed
(
IFS
=
'
'
NBS
=
`
git diff-index
--cached
$against
--name-only
|
grep
'.ipynb$'
|
uniq
`
for
NB
in
$NBS
;
do
echo
"Removing outputs from
$NB
"
cp
"
$NB
"
"
$NB
"
_backup
jupyter nbconvert
--to
notebook
--ClearOutputPreprocessor
.enabled
=
True
--ClearOutputPreprocessor
.remove_metadata_fields
=
"['deletable', 'editable', 'collapsed', 'scrolled']"
"
$NB
"
--output
"
$NB
"
--output-dir
=
'.'
git add
"
$NB
"
mv
"
$NB
"
_backup
"
$NB
"
done
)
exec
git diff-index
--check
--cached
$against
--
This diff is collapsed.
Click to expand it.
.pre-commit-config.yaml
0 → 100644
+
16
−
0
View file @
80a840ab
repos
:
-
repo
:
https://github.com/pre-commit/pre-commit-hooks
rev
:
v4.5.0
hooks
:
-
id
:
trailing-whitespace
-
id
:
end-of-file-fixer
-
repo
:
https://github.com/psf/black
rev
:
24.1.1
hooks
:
-
id
:
black
-
repo
:
https://github.com/codespell-project/codespell
rev
:
v2.2.6
hooks
:
-
id
:
codespell
additional_dependencies
:
-
tomli
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