1
0
mirror of https://github.com/periph/cmd.git synced 2026-10-24 17:39:16 +03:00
Files
cmd/scripts/hooks/pre-commit
Marc-Antoine Ruel 0cb65f351d Standardize development checks and CI tooling
Expose fix, verify, test, and help through consistent Make targets, with
locked uv tools, EditorConfig, versioned hooks, shared binary checks, and
generated agent file indexes. Apply safe lint fixes and formatting quietly
while preserving diagnostics and failure exit codes.

Require Go 1.26 and read CI toolchains from go.mod. Track lint and license
tools in the root module; run pinned actionlint separately because of YAML
dependency conflicts. Run vet through golangci-lint and retain distinct
compile/link and module-tidiness checks.

Refresh Actions and share setup where applicable. Ignore Codecov and
coverage artifacts on Unix and Windows while keeping plain Git status
checks for tracked changes and unexpected output.

Run historical benchmark comparisons and their tool setup only on Ubuntu.

Reject malformed web API JSON before hardware calls and protect session
cookies and tokens. Track upstream minify/v2 as a module tool, regenerate
embedded assets, and index the upstream DS18B20 example.

Validation: make fix and make verify pass. Applicable test, generation,
race, cross-build, and consumer checks passed during implementation.
Formatter diagnostic fixtures, ignore-rule fixtures, index checks, and
staged hooks pass. Native hosted OS and physical hardware execution remain
outside local validation.
The rebased cmd tree also passes make fix, make verify, and make test.

Squashing preserves the validated file tree exactly.
2026-10-18 21:04:33 -04:00

17 lines
476 B
Bash
Executable File

#!/bin/bash
# Copyright 2026 Marc-Antoine Ruel. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
# Runs focused checks against the staged snapshot.
set -euo pipefail
script_dir="$(CDPATH='' cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
readonly script_dir
repo_root="$(CDPATH='' cd -- "$script_dir/../.." && pwd)"
readonly repo_root
cd -- "$repo_root"
./scripts/check-staged.sh