From 5730dd35174e9dfbe93e7f3885a13b71a53236d6 Mon Sep 17 00:00:00 2001
From: Guilhem Saurel <guilhem.saurel@laas.fr>
Date: Wed, 26 Jun 2024 12:17:34 +0200
Subject: [PATCH] setup pre-commit

---
 .pre-commit-config.yaml | 29 +++++++++++++++++++++++++++++
 newcomers/default.nix   |  4 ++--
 2 files changed, 31 insertions(+), 2 deletions(-)
 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..02ab000
--- /dev/null
+++ b/.pre-commit-config.yaml
@@ -0,0 +1,29 @@
+ci:
+  skip:
+    - treefmt
+repos:
+- repo: https://github.com/pre-commit/pre-commit-hooks
+  rev: v4.6.0
+  hooks:
+  - id: check-added-large-files
+  - id: check-ast
+  - id: check-executables-have-shebangs
+  - id: check-json
+  - id: check-merge-conflict
+  - id: check-symlinks
+  - id: check-toml
+  - id: check-yaml
+  - id: debug-statements
+  - id: destroyed-symlinks
+  - id: detect-private-key
+  - id: end-of-file-fixer
+  - id: fix-byte-order-marker
+  - id: mixed-line-ending
+  - id: trailing-whitespace
+- repo: local
+  hooks:
+  - id: treefmt
+    name: treefmt
+    entry: treefmt
+    language: system
+    always_run: true
diff --git a/newcomers/default.nix b/newcomers/default.nix
index 950b74a..91308f3 100644
--- a/newcomers/default.nix
+++ b/newcomers/default.nix
@@ -1,7 +1,7 @@
 {
   lib,
   ldap3,
-  buildPythonApplication
+  buildPythonApplication,
 }:
 buildPythonApplication {
   pname = "greet-newcomers";
@@ -26,7 +26,7 @@ buildPythonApplication {
     description = "Greet gepetto newcomers";
     homepage = "https://github.com/gepetto/gepetto-utils/tree/master/newcomers";
     license = lib.licenses.bsd2;
-    maintainers = [lib.maintainers.nim65s ];
+    maintainers = [ lib.maintainers.nim65s ];
     mainProgram = "greet-newcomers";
   };
 }
-- 
GitLab