From 3679e1cdbdd57db6e28d172aa654bc0b070656e1 Mon Sep 17 00:00:00 2001
From: Moul <moul@moul.re>
Date: Sun, 23 May 2021 15:11:06 +0200
Subject: [PATCH] [enh] #134: Introduce insert-license pre-commit-hook

---
 .pre-commit-config.yaml |  8 ++++++++
 license_header.txt      | 14 ++++++++++++++
 2 files changed, 22 insertions(+)
 create mode 100644 license_header.txt

diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 47fe30ad..99089cfb 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -3,3 +3,11 @@ repos:
     rev: 21.5b0
     hooks:
     - id: black
+-   repo: https://github.com/Lucas-C/pre-commit-hooks
+    rev: v1.1.10
+    hooks:
+    -   id: insert-license
+        files: \.py$
+        args:
+        - --license-filepath
+        - license_header.txt
diff --git a/license_header.txt b/license_header.txt
new file mode 100644
index 00000000..31d98e9a
--- /dev/null
+++ b/license_header.txt
@@ -0,0 +1,14 @@
+Copyright  2014-2021 Vincent Texier <vit@free.fr>
+
+DuniterPy is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+DuniterPy is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
-- 
GitLab