From f32cb5dc09b903f4e544c092afcb9c7c613ca618 Mon Sep 17 00:00:00 2001 From: Roberto Alsina Date: Fri, 16 Jun 2023 14:04:21 -0300 Subject: [PATCH] Initial code --- .pre-commit-hooks.yaml | 6 ++++++ bin/ameba.sh | 9 +++++++++ 2 files changed, 15 insertions(+) create mode 100644 .pre-commit-hooks.yaml create mode 100755 bin/ameba.sh diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml new file mode 100644 index 0000000..528cc18 --- /dev/null +++ b/.pre-commit-hooks.yaml @@ -0,0 +1,6 @@ +- id: ameba + name: Ameba + description: Check Crystal files using ameba + entry: bin/ameba.sh + language: script + files: (\.cr)$ diff --git a/bin/ameba.sh b/bin/ameba.sh new file mode 100755 index 0000000..385fd17 --- /dev/null +++ b/bin/ameba.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +if command ameba != 0; then + echo "Ameba needs to be installed" + exit 1 +fi + +ameba "$@" +exit $?