Files
Charon/.pre-commit-config.yaml
Wikid82 ca4ddc4e3e feat: enhance dev workflow and prepare for goreleaser
- Update Makefile with new targets:
  - lint-backend: Run golangci-lint via Docker
  - lint-docker: Run hadolint via Docker
  - test-race: Run Go tests with race detection
  - benchmark: Run Go benchmarks
  - integration-test: Run local integration tests
- Update .pre-commit-config.yaml:
  - Add go-test-race hook
  - Add golangci-lint hook
  - Add hadolint hook
- Add .goreleaser.yaml configuration:
  - Define builds for linux/amd64 and linux/arm64
  - Configure archive creation (tar.gz)
  - Configure package creation (deb, rpm)
- Add .github/workflows/release-goreleaser.yml:
  - New workflow to test GoReleaser builds
  - Builds frontend first, then uses GoReleaser
  - Handles cross-compilation dependencies
2025-11-28 00:28:42 +00:00

89 lines
2.8 KiB
YAML

repos:
- repo: local
hooks:
- id: python-compile
name: python compile check
entry: tools/python_compile_check.sh
language: script
files: ".*\\.py$"
pass_filenames: false
always_run: true
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: end-of-file-fixer
exclude: '^(frontend/(coverage|dist|node_modules|\.vite)/|.*\.tsbuildinfo$)'
- id: trailing-whitespace
exclude: '^(frontend/(coverage|dist|node_modules|\.vite)/|.*\.tsbuildinfo$)'
- id: check-yaml
- id: check-added-large-files
args: ['--maxkb=2500']
- repo: local
hooks:
- id: dockerfile-check
name: dockerfile validation
entry: tools/dockerfile_check.sh
language: script
files: "Dockerfile.*"
pass_filenames: true
- id: go-test-coverage
name: Go Test Coverage
entry: scripts/go-test-coverage.sh
language: script
files: '\.go$'
pass_filenames: false
verbose: true
- id: go-vet
name: Go Vet
entry: bash -c 'cd backend && go vet ./...'
language: system
files: '\.go$'
pass_filenames: false
- id: go-test-race
name: Go Test Race
entry: bash -c 'cd backend && go test -race ./...'
language: system
files: '\.go$'
pass_filenames: false
- id: golangci-lint
name: GolangCI-Lint
entry: bash -c 'cd backend && docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:latest golangci-lint run -v'
language: system
files: '\.go$'
pass_filenames: false
- id: hadolint
name: Hadolint Dockerfile Check
entry: bash -c 'docker run --rm -i hadolint/hadolint < Dockerfile'
language: system
files: 'Dockerfile'
pass_filenames: false
- id: frontend-type-check
name: Frontend TypeScript Check
entry: bash -c 'cd frontend && npm run type-check'
language: system
files: '^frontend/.*\.(ts|tsx)$'
pass_filenames: false
- id: frontend-lint
name: Frontend Lint (Fix)
entry: bash -c 'cd frontend && npm run lint -- --fix'
language: system
files: '^frontend/.*\.(ts|tsx|js|jsx)$'
pass_filenames: false
- id: frontend-test-coverage
name: Frontend Test Coverage
entry: scripts/frontend-test-coverage.sh
language: script
files: '^frontend/.*\.(ts|tsx|js|jsx)$'
pass_filenames: false
verbose: true
- id: security-scan
name: Security Vulnerability Scan
entry: scripts/security-scan.sh
language: script
files: '(\.go$|go\.mod$|go\.sum$)'
pass_filenames: false
verbose: true
stages: [pre-commit, manual]