Compare commits

...

3 Commits

4 changed files with 39 additions and 2 deletions

17
.gitlab-ci.yml Normal file
View File

@ -0,0 +1,17 @@
# Based on https://pre-commit.com
#image: python:alpine
image: pypy:latest
gitlab-ci-pre-commit:
stage: build
before_script:
#- apk add --no-cache git gcc musl-dev go
- pypy3 -m pip install pre-commit
script:
- pre-commit run --all-files --show-diff-on-failure
variables:
# Remember to gitignore .cache/**
PRE_COMMIT_HOME: ${CI_PROJECT_DIR}/.cache/pre-commit
TERM: dumb
cache:
paths:
- ${PRE_COMMIT_HOME}

View File

@ -0,0 +1,20 @@
#!/usr/bin/env bash
# This is a noteish on how to pre-commit on SteamOS
set -x
cd ~
mkdir -p ~/.local/bin/
# My pre-commit configuration expects to find a pypy
ln -sf /usr/bin/python ~/.local/bin/pypy
ln -sf /usr/bin/python3 ~/.local/bin/pypy3
mkdir -p ~/venv
python3 -m venv ~/venv
. ~/venv/bin/activate
python3 -m pip install pip --upgrade
python3 -m pip install pre-commit --upgrade
# Removes duplicates from $PATH. Copied from https://unix.stackexchange.com/a/14896
PATH=$(echo "$PATH" | awk -v RS=':' -v ORS=":" '!a[$1]++{if (NR > 1) printf ORS; printf $a[$1]}')
printf "Remember to apply the following somewhere appropiate:\nPATH=$PATH"
set +x

@ -1 +1 @@
Subproject commit 27fc7c6fbf06f0d32e5833736863d3455d1b8b8d
Subproject commit d970278eb14cc859b1e4911e9c4336e4ca50d6b8

@ -1 +1 @@
Subproject commit f02731ffbbad3071dd55f500529d9235d5405a7b
Subproject commit 330fafa17ac70dfed5e116fb570fc04c9c9bb73e