mirror of
https://github.com/juanfont/headscale.git
synced 2026-07-10 18:18:19 +09:00
9e96adfa49
Drop the old testdata/{acl,grant,routes,ssh}_results/ files (mixed
uppercase ACL-*/ROUTES-*/GRANT-*/SSH-* filenames with the pre-tscap
schema) and replace with the 617 captures tscap produced for the
kradalby/3157-subnet-to-subnet branch. Files are lowercase and
anonymized (odin/thor/freya users, pokemon hostnames) per
kradalby/tscap package anonymize.
Relax pre-commit check-added-large-files: tscap captures include full
netmaps and can exceed 500 KB per file; testdata/ is now excluded
from the size check and the global ceiling is bumped to 2 MB.
Source: github.com/kradalby/tscap @ cb375ec
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
65 lines
1.8 KiB
YAML
65 lines
1.8 KiB
YAML
# prek/pre-commit configuration for headscale
|
|
# See: https://prek.j178.dev/quickstart/
|
|
# See: https://prek.j178.dev/builtin/
|
|
|
|
# Global exclusions - ignore generated code
|
|
exclude: ^gen/
|
|
|
|
repos:
|
|
# Built-in hooks from pre-commit/pre-commit-hooks
|
|
# prek will use fast-path optimized versions automatically
|
|
# See: https://prek.j178.dev/builtin/
|
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
rev: v6.0.0
|
|
hooks:
|
|
- id: check-added-large-files
|
|
args: [--maxkb=2000]
|
|
exclude: ^hscontrol/policy/v2/testdata/
|
|
- id: check-case-conflict
|
|
- id: check-executables-have-shebangs
|
|
- id: check-json
|
|
- id: check-merge-conflict
|
|
- id: check-symlinks
|
|
- id: check-toml
|
|
- id: check-xml
|
|
- id: check-yaml
|
|
- id: detect-private-key
|
|
- id: end-of-file-fixer
|
|
- id: fix-byte-order-marker
|
|
- id: mixed-line-ending
|
|
- id: trailing-whitespace
|
|
|
|
# Local hooks for project-specific tooling
|
|
- repo: local
|
|
hooks:
|
|
# nixpkgs-fmt for Nix files
|
|
- id: nixpkgs-fmt
|
|
name: nixpkgs-fmt
|
|
entry: nixpkgs-fmt
|
|
language: system
|
|
files: \.nix$
|
|
|
|
# Prettier for formatting
|
|
- id: prettier
|
|
name: prettier
|
|
entry: prettier --write --list-different
|
|
language: system
|
|
exclude: ^docs/
|
|
types_or: [javascript, jsx, ts, tsx, yaml, json, toml, html, css, scss, sass, markdown]
|
|
|
|
# mdformat for docs
|
|
- id: mdformat
|
|
name: mdformat
|
|
entry: mdformat
|
|
language: system
|
|
types_or: [markdown]
|
|
files: ^docs/
|
|
|
|
# golangci-lint for Go code quality
|
|
- id: golangci-lint
|
|
name: golangci-lint
|
|
entry: nix develop --command -- golangci-lint run --new-from-rev=HEAD~1 --timeout=5m --fix
|
|
language: system
|
|
types: [go]
|
|
pass_filenames: false
|