2022-05-21 00:49:13 +02:00
|
|
|
# Copyright 2022 wanderer <a_mirre at utb dot cz>
|
|
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
2022-05-13 22:58:09 +02:00
|
|
|
---
|
|
|
|
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 .
|
2022-05-24 12:20:52 +02:00
|
|
|
always_run: false
|
2022-05-13 22:58:09 +02:00
|
|
|
pass_filenames: false
|
2022-05-24 12:20:52 +02:00
|
|
|
files: '\.*.nix$'
|
2022-05-13 22:58:09 +02:00
|
|
|
language: system
|
|
|
|
- id: nixpkgs-fmt
|
|
|
|
name: nixpkgs-fmt
|
|
|
|
entry: ./check-fmt
|
2022-05-24 12:20:52 +02:00
|
|
|
always_run: false
|
2022-05-13 22:58:09 +02:00
|
|
|
pass_filenames: false
|
2022-05-24 12:20:52 +02:00
|
|
|
files: '\.*.nix$'
|
2022-05-13 22:58:09 +02:00
|
|
|
language: system
|
|
|
|
- id: flake-check
|
|
|
|
name: nix flake check
|
|
|
|
entry: nix flake check --impure
|
2022-05-24 12:20:52 +02:00
|
|
|
always_run: false
|
2022-05-13 22:58:09 +02:00
|
|
|
pass_filenames: false
|
2022-05-24 12:20:52 +02:00
|
|
|
files: "flake.(nix|lock)$"
|
2022-05-13 22:58:09 +02:00
|
|
|
language: system
|
2022-05-21 00:49:13 +02:00
|
|
|
- id: addlicense
|
|
|
|
name: addlicence -check
|
|
|
|
entry: >
|
|
|
|
go run github.com/google/addlicense@v1.0.0 -check -v
|
|
|
|
pass_filenames: true
|
|
|
|
types_or: ["go", "yaml"]
|
|
|
|
exclude: "^.drone.*"
|
|
|
|
language: system
|
2022-05-13 22:58:09 +02:00
|
|
|
- repo: https://github.com/dnephin/pre-commit-golang
|
|
|
|
rev: v0.5.0
|
|
|
|
hooks:
|
|
|
|
- id: go-fmt
|
|
|
|
- id: go-vet
|
|
|
|
- id: go-imports
|
|
|
|
- id: go-cyclo
|
|
|
|
args: [-over=15]
|
|
|
|
- id: golangci-lint
|
|
|
|
- id: go-unit-tests
|
|
|
|
- id: go-build
|
|
|
|
- id: go-mod-tidy
|
2022-05-24 11:44:55 +02:00
|
|
|
- repo: https://github.com/tekwizely/pre-commit-golang
|
|
|
|
rev: v1.0.0-beta.5
|
|
|
|
hooks:
|
|
|
|
- id: go-revive-mod
|
|
|
|
- id: go-sec-mod
|
2022-05-13 22:58:09 +02:00
|
|
|
- repo: local
|
|
|
|
hooks:
|
|
|
|
- id: nix-build
|
2022-05-16 13:56:26 +02:00
|
|
|
name: nix build
|
|
|
|
entry: nix build .#go-xkcdreader
|
2022-05-13 22:58:09 +02:00
|
|
|
pass_filenames: false
|
2022-05-24 12:20:52 +02:00
|
|
|
# trigger this hook on changes to any of nix (also flake.lock) files
|
2022-05-25 19:39:31 +02:00
|
|
|
# and go's mod or sum files
|
|
|
|
files: '\.*.(nix|lock|mod|sum)$'
|
2022-05-13 22:58:09 +02:00
|
|
|
language: system
|