From a4312158fa260ce730be64b9871dace0e4c71167 Mon Sep 17 00:00:00 2001 From: Gabriel Almeida Date: Wed, 31 May 2023 01:04:40 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20chore(pre-commit):=20add=20git?= =?UTF-8?q?=20add=20command=20to=20pre-commit=20hook=20The=20pre-commit=20?= =?UTF-8?q?hook=20now=20adds=20the=20files=20that=20were=20formatted=20by?= =?UTF-8?q?=20the=20make=20format=20command=20to=20the=20staging=20area.?= =?UTF-8?q?=20This=20ensures=20that=20the=20changes=20made=20by=20the=20fo?= =?UTF-8?q?rmatting=20are=20included=20in=20the=20commit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .githooks/pre-commit | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.githooks/pre-commit b/.githooks/pre-commit index f5008c586..ef67eaa37 100755 --- a/.githooks/pre-commit +++ b/.githooks/pre-commit @@ -1,2 +1,6 @@ +#!/bin/sh -make format \ No newline at end of file +added_files=$(git diff --name-only --cached --diff-filter=d) + +make format +git add ${added_files} \ No newline at end of file