add .pre-commit-config.yaml

This commit is contained in:
leo 2023-01-28 19:24:26 +01:00
parent 95afeb6815
commit 8de860a22a
Signed by: wanderer
SSH Key Fingerprint: SHA256:Dp8+iwKHSlrMEHzE3bJnPng70I7LEsa3IJXRH/U+idQ

58
.pre-commit-config.yaml Normal file
View File

@ -0,0 +1,58 @@
---
fail_fast: false
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0
hooks:
- id: check-merge-conflict
- repo: meta
hooks:
- id: check-hooks-apply
- repo: local
hooks:
- id: statix
name: statix
entry: statix check .
always_run: false
pass_filenames: false
files: '\.*.nix$'
language: system
- id: nix-fmt
name: nix fmt
entry: nix fmt -- --check .
always_run: false
pass_filenames: false
files: '\.*.nix$'
language: system
- id: flake-check
name: nix flake check
entry: nix flake check --keep-going
always_run: false
pass_filenames: false
files: "flake.(nix|lock)$"
language: system
- repo: https://github.com/dnephin/pre-commit-golang
rev: v0.5.0
hooks:
- id: go-mod-tidy
- id: go-unit-tests
- id: golangci-lint
- id: go-build
- repo: local
hooks:
- id: nix-build-py
name: nix build py
entry: nix build .#p1
pass_filenames: false
# trigger this hook on changes to any of nix (also flake.lock) or
# python files.
files: '\.*.(nix|lock|py)$'
language: system
- id: nix-build-go
name: nix build go
entry: nix build .#p2
pass_filenames: false
# trigger this hook on changes to any of nix (also flake.lock) files
# and go's mod or sum files
files: '\.*.(nix|lock|mod|sum)$'
language: system