From 0d3765e0d9d559ff2699c6f56e12d187b1946666 Mon Sep 17 00:00:00 2001 From: surtur Date: Fri, 13 May 2022 22:58:09 +0200 Subject: [PATCH] add .pre-commit-config.yaml [skip ci] --- .pre-commit-config.yaml | 50 +++++++++++++++++++++++++++++++++++++++++ README.md | 1 + 2 files changed, 51 insertions(+) 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..383a875 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,50 @@ +--- +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 . + pass_filenames: false + language: system + - id: nixpkgs-fmt + require_serial: false + name: nixpkgs-fmt + entry: ./check-fmt + pass_filenames: false + language: system + - id: flake-check + require_serial: false + name: nix flake check + entry: nix flake check --impure + pass_filenames: false + files: "flake.nix" + language: system + - repo: https://github.com/dnephin/pre-commit-golang + rev: v0.5.0 + hooks: + - id: go-fmt + - id: go-vet + - id: go-lint + - id: go-imports + - id: go-cyclo + args: [-over=15] + - id: golangci-lint + - id: go-unit-tests + - id: go-build + - id: go-mod-tidy + - repo: local + hooks: + - id: nix-build + name: nix-build + entry: nix-build + pass_filenames: false + language: system diff --git a/README.md b/README.md index 8544152..8562755 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ # [go-xkcdreader](https://git.dotya.ml/wanderer/go-xkcdreader) [![built with nix](https://builtwithnix.org/badge.svg)](https://builtwithnix.org) [![Cachix](https://img.shields.io/badge/cachix-go--xkcdreader-blue.svg)](https://go-xkcdreader.cachix.org) +[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit) [![Build Status](https://drone.dotya.ml/api/badges/wanderer/go-xkcdreader/status.svg?ref=refs/heads/development)](https://drone.dotya.ml/wanderer/go-xkcdreader) ### disclaimer