4
0
forked from midou/invidious
Files
.github
assets
config
docker
kubernetes
locales
mocks
screenshots
scripts
git
pre-commit
deploy-database.sh
fetch-player-dependencies.cr
install-dependencies.sh
spec
src
.ameba.yml
.editorconfig
.gitattributes
.gitignore
.gitmodules
CHANGELOG.md
LICENSE
Makefile
README.md
TRANSLATION
docker-compose.yml
invidious.service
shard.lock
shard.yml
videojs-dependencies.yml
invidious-experimenting/scripts/git/pre-commit
Samantaz Fox e85bc3e0f6 Remove script for locales propagation
Not required anymore now that weblate takes care of it
2022-01-28 02:19:53 +01:00

18 lines
757 B
Plaintext

# Useful precomit hooks
# Please see https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks for instructions on installation.
# Crystal linter
# This is a modified version of the pre-commit hook from the crystal repo. https://github.com/crystal-lang/crystal/blob/master/scripts/git/pre-commit
# Please refer to that if you'd like an version that doesn't automatically format staged files.
changed_cr_files=$(git diff --cached --name-only --diff-filter=ACM | grep '\.cr$')
if [ ! -z "$changed_cr_files" ]; then
if [ -x bin/crystal ]; then
# use bin/crystal wrapper when available to run local compiler build
bin/crystal tool format $changed_cr_files >&2
else
crystal tool format $changed_cr_files >&2
fi
git add $changed_cr_files
fi