# https://taskfile.dev

version: '3'

vars:
  HELP: Для просмотра всех задач запустите 'task -a'

dotenv: [.env]

tasks:
  default:
    desc: Вывод справки
    cmds:
      - echo "{{.HELP}}"
    silent: true
  demo:
    desc: Запуск демо-проекта
    cmds:
      - clear
      - go fmt ./...
      - go build -race -o ./bin_dev/demo ./cmd/demo/main.go
  mod:
    desc: Обновление зависимостей
    cmds:
      - clear
      - go fmt ./...
      - go mod tidy -compat=1.24.2
      - go mod vendor
      - go fmt ./...
  test:
    desc: Запуск тестов
    cmds:
      - clear
      - go fmt ./...
      - go test -race -shuffle=on -timeout=30s -coverprofile=./cover.out ./...
      - go tool cover -func=./cover.out
  lint:
    desc: Запуск всех линтеров
    cmds:
      - clear
      - go fmt ./...
      - go vet ./...
      # - go install honnef.co/go/tools/cmd/staticcheck@latest
      # - staticcheck ./...
      # - go install github.com/MakeNowJust/enumcase/cmd/enumcase@latest
      # - enumcase ./...
      - go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
      - golangci-lint run ./...
      # - go install github.com/fzipp/gocyclo/cmd/gocyclo@latest
      # - gocyclo -over 11 .
      # - go install github.com/securego/gosec/cmd/gosec@latest
      # - gosec ./...
