
# THIS FILE IS AUTOGENERATED BY THE DEVENVSHELL
# DO NOT EDIT THIS FILE MANUALLY
# INSTEAD EDIT THE DEVENVSHELL CONFIGURATION FILE devenv.nix 
# AND OPEN A SHELL WITH THE COMMAND devenv shell
#
# Information about the task runner can be found here:
# https://taskfile.dev

version: '3'

tasks:
  default: 
    cmds:
      - task --list
    silent: true
    
  test:
    desc: Execute unit tests in Go.
    env:
      TEST_BY_TASK: true
    cmds:
      - docker pull atmoz/sftp:alpine
      - docker pull axllent/mailpit 
      - echo "Execute unit tests in Go."
      - test-lib

  test-fuzz:
    desc: Conduct fuzzing tests.#
    env:
      TEST_BY_TASK: true
    cmds:  
      - echo "Conduct fuzzing tests."
      - go test -tags=runOnTask -v -fuzztime=30s -fuzz=Fuzz ./...

  add-licenses:
    desc: Attach license headers to Go files.
    cmds:
      - echo "Attach license headers to Go files."
      - go install github.com/google/addlicense@latest
      - addlicense -c "schukai GmbH" -s -l "AGPL-3.0" ./*.go
    silent: true
    
  check-licenses:
    desc: Check license headers of Go files.
    silent: true
    cmds:
      - go-licenses save "$(get-go-default-packages)"  --ignore "gitlab.schukai.com"  --force --save_path ${DEVENV_ROOT}/licenses/

  check:
    desc: Confirm repository status.
    cmds:
      - git diff-index --quiet HEAD || (echo "There are uncommitted changes after running make. Please commit or stash them before running make."; exit 1)
    silent: true

  commit:
    desc: Commit changes to the repository.
    aliases:
      - c
      - ci
      - git-commit
    cmds:
      - do-git-commit
