1
0
mirror of https://github.com/periph/host.git synced 2026-10-23 05:09:34 +03:00
Files
host/Makefile
Marc-Antoine Ruel f781f49490 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.

Preserve platform and architecture coverage and downstream devices/cmd
consumer gates while sharing runtime and static-check setup.

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.

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

46 lines
1.8 KiB
Makefile

# 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.
# Repository development targets and pinned static analysis tools.
.DEFAULT_GOAL := help
.PHONY: fix git-hooks help test test-race verify
help:
@printf ' %-14s - %s\n' \
'make fix' 'Apply formatting and safe lint fixes' \
'make verify' 'Run static checks' \
'make test' 'Run Go tests with coverage and benchmark smoke checks' \
'make test-race' 'Run Go tests with the race detector' \
'make git-hooks' 'Install versioned Git hooks'
fix:
@uv run --locked ruff check --quiet --fix scripts
@uv run --locked ruff format scripts >/dev/null
@uv run --locked python scripts/update_agents_file_index.py
@go tool golangci-lint fmt
@go tool golangci-lint run --show-stats=false --fix ./...
verify:
@uv run --locked ruff check --quiet scripts
@uv run --locked ruff format --check --quiet scripts
@go run github.com/rhysd/actionlint/cmd/actionlint@v1.7.12
@go tool golangci-lint fmt --diff
@go tool golangci-lint run --show-stats=false ./...
@go test -run '^$$' ./...
@go tool addlicense -ignore '.venv/**' -ignore '.ruff_cache/**' -ignore 'third_party/**' -ignore 'vendor/**' -check .
@uv run --locked python scripts/lint_binaries.py
@uv run --locked python scripts/update_agents_file_index.py --check
# Module metadata contains upstream dependency names rather than prose.
@git ls-files -z -- . ':(exclude)go.mod' ':(exclude)go.sum' | xargs -0 go run github.com/client9/misspell/cmd/misspell@v0.3.4 -error
@go mod tidy -diff
test:
@go test -timeout=120s -covermode=count -coverprofile coverage.txt -bench=. -benchtime=1x ./...
test-race:
@go test -timeout=120s -race -bench=. -benchtime=1x ./...
git-hooks:
@./scripts/install-git-hooks.sh