From 20f4d0a6dbd9003e6169ebb3086661980e686e48 Mon Sep 17 00:00:00 2001 From: Yanick Champoux Date: Thu, 1 Dec 2022 12:50:41 -0500 Subject: [PATCH] add pre-commit --- .pre-commit-config.yaml | 20 ++++++++++++++++++++ 2022/Taskfile.yaml | 2 ++ 2 files changed, 22 insertions(+) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..26cf8f5 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,20 @@ +default_stages: + - merge-commit + - push + +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.3.0 + hooks: + - id: end-of-file-fixer + stages: [merge-commit, push] + - id: trailing-whitespace + stages: [merge-commit, push] + - id: check-merge-conflict + - repo: local + hooks: + - id: lint + name: lint + entry: task lint:fix -- + language: system + files: '' diff --git a/2022/Taskfile.yaml b/2022/Taskfile.yaml index 51b2a82..307d714 100644 --- a/2022/Taskfile.yaml +++ b/2022/Taskfile.yaml @@ -6,6 +6,8 @@ vars: GREETING: Hello, World! tasks: + "precommit:init": pre-commit install -t pre-merge-commit -t pre-push + default: cmds: - echo "{{.GREETING}}"