From 6afb707bd4a13a1e78d52d331078b0842b30f994 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Sun, 7 May 2023 04:09:08 +0200 Subject: [PATCH] add pre-commit who use black formatting --- GUIDE.md | 7 +++++++ githooks/pre-commit | 3 +++ 2 files changed, 10 insertions(+) create mode 100755 githooks/pre-commit diff --git a/GUIDE.md b/GUIDE.md index 74a9018..2601742 100644 --- a/GUIDE.md +++ b/GUIDE.md @@ -58,3 +58,10 @@ class Mycheat(Hack): Please, use `black` before doing a pull request, as it's the formatter the project use. + +On Linux, you can copy the git hook stored in [githooks/](./githooks) who check +the code, preventing any commit with bad formatting. + +```sh +$ cp githooks/* .git/hooks/ +``` diff --git a/githooks/pre-commit b/githooks/pre-commit new file mode 100755 index 0000000..77061ce --- /dev/null +++ b/githooks/pre-commit @@ -0,0 +1,3 @@ +#!/bin/sh + +python3 -m black --check .