From 9c84bdd7c7eefb6bd054b57a2bd724253081ee9e Mon Sep 17 00:00:00 2001 From: Dan Jones Date: Tue, 1 Apr 2025 11:00:51 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=89=20Initial=20commit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 25 ++++++++++++++++ Taskfile.yml | 72 +++++++++++++++++++++++++++++++++++++++++++++ cmd/trakter/main.go | 7 +++++ go.mod | 3 ++ 4 files changed, 107 insertions(+) create mode 100644 .gitignore create mode 100644 Taskfile.yml create mode 100644 cmd/trakter/main.go create mode 100644 go.mod diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..71f6a2d --- /dev/null +++ b/.gitignore @@ -0,0 +1,25 @@ +# If you prefer the allow list template instead of the deny list, see community template: +# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore +# +# Binaries for programs and plugins +*.exe +*.exe~ +*.dll +*.so +*.dylib + +# Test binary, built with `go test -c` +*.test + +# Dependency directories +vendor/ + +# Go workspace file +go.work +go.work.sum + +# env file +.env + +build/ +.task/ diff --git a/Taskfile.yml b/Taskfile.yml new file mode 100644 index 0000000..0a25f53 --- /dev/null +++ b/Taskfile.yml @@ -0,0 +1,72 @@ +version: '3' + +tasks: + default: + cmds: + - task: fmt + - task: test + - task: lint + + fmt: + desc: Format go code + sources: + - '**/*.go' + cmds: + - go fmt ./... + - go mod tidy + + gen: + desc: Generate files + sources: + - '**/*.go' + cmds: + - go generate ./... + + lint: + desc: Do static analysis + sources: + - '**/*.go' + cmds: + - golangci-lint run + + test: + desc: Run unit tests + deps: [fmt] + sources: + - '**/*.go' + generates: + - build/cover.out + cmds: + - go test -race -cover -coverprofile build/cover.out ./... + + coverage-report: + desc: Build coverage report + deps: [test] + sources: + - build/cover.out + generates: + - build/cover.html + cmds: + - go tool cover -html=build/cover.out -o build/cover.html + + serve-report: + desc: Serve the coverage report + deps: [coverage-report] + cmds: + - ip addr list | grep inet + - php -S 0.0.0.0:3434 -t build + + serve-docs: + desc: Serve the current docs + cmds: + - godoc -http=0.0.0.0:3434 -play + + build: + desc: Build binaries + deps: [test] + sources: + - '**/*.go' + generates: + - ./build/trakter + cmds: + - go build -o ./build/ ./cmd/trakter/ diff --git a/cmd/trakter/main.go b/cmd/trakter/main.go new file mode 100644 index 0000000..51e1bc0 --- /dev/null +++ b/cmd/trakter/main.go @@ -0,0 +1,7 @@ +package main + +import "fmt" + +func main() { + fmt.Println("TODO") +} diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..3edd45d --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module codeberg.org/danjones000/trakter + +go 1.23.6