Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added taskfile for development (thanks to @eschreve!) #60

Merged
merged 2 commits into from
Mar 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*.dll
*.so
*.dylib

.task
# Test binary, built with `go test -c`
*.test

Expand Down
3 changes: 0 additions & 3 deletions Makefile

This file was deleted.

8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,14 @@ it is also available for all packages in the repository in markdown format. Just
you'll see the GoDocs rendered in beautiful Github-flavored markdown thanks to the
awesome [gomarkdoc](https://github.com/princjef/gomarkdoc) tool.

## Development

To get involved developing features and fixes for Pillager, get started with the following:

- [Install Go](https://go.dev/doc/install)
- Install [Taskfile.dev](https://taskfile.dev/#/installation)
- Read the [CONTRIBUTING.MD](./CONTRIBUTING.md)

---

### Shoulders of Giants :star:
Expand Down
85 changes: 85 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
version: "3"

tasks:
default:
cmds:
- task -l

mod:
desc: download and tidy go modules
cmds:
- go mod download
- go mod tidy

clean:
desc: remove executables, temporary, and cached files
ignore_error: true
cmds:
- rm bin/pillager
- go clean -cache
- rm -rf pkg/hunter/testdata
- mkdir pkg/hunter/testdata

lint:
desc: runs golint
cmds:
- golangci-lint run ./...

test:
desc: run all tests
cmds:
- go test ./...

test:v:
desc: run all tests verbose
cmds:
- go test -v ./...

test:cov:
desc: run all tests and generate coverage
cmds:
- go test -covermode=set -coverprofile=coverage.out ./...
sources:
- ./**/*.go
generates:
- coverage.out
method: checksum

build:
desc: run go build
cmds:
- go build -v -o bin/pillager .
sources:
- ./**/*.go
generates:
- bin/pillager
method: checksum

install:
desc: install executable
cmds:
- go install github.com/brittonhayes/pillager@latest

run:
desc: run the executable
cmds:
- task: build
- bin/pillager

docs:gen:
desc: generate documentation via gomarkdocwn
cmds:
- go generate ./...

docs:serve:
desc: serve godoc server locally
silent: true
cmds:
- echo "Documentation is available at http://localhost:6060/pkg/github.com/brittonhayes/pillager/"
- godoc -http=:6060

dev-setup:
desc: set things up for local development
cmds:
- task: mod
- task: build