repos:
  - repo: https://github.com/golangci/golangci-lint
    rev: v1.57.1
    hooks:
      - id: golangci-lint
        entry: golangci-lint run
        exclude: "^(vendor/|.circleci/)"
        language: golang
        require_serial: true
        types: [go]
  - repo: git@github.com:launchdarkly/pre-commit-go
    rev: v0.11.0
    hooks:
      - id: compile-go-tests
        entry: bin/run-script run-on-dirs "go test ./..."
        exclude: "^vendor/|^.circleci/image/tools"
        name: run-go-tests
      - id: discarded-stacktrace
        exclude: '(^vendor/|.*gen\.go)'
      - id: go-mod-tidy
      - id: go-mod-verify
      - id: go-mod-vendor-no-change
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v4.6.0
    hooks:
      - id: end-of-file-fixer
        exclude: "^vendor"
  - repo: local
    hooks:
      - id: ui-tests
        name: Run dev-server UI tests
        entry: bash -c 'cd internal/dev_server/ui && npm test'
        language: system
        files: \.(jsx|tsx)$
        pass_filenames: false
      - id: ui-build
        name: Build dev-server UI
        entry: bash -c 'cd internal/dev_server/ui && npm run build'
        language: system
        files: \.(jsx|tsx)$
        pass_filenames: false
