{"id":13339532,"url":"https://github.com/snwfdhmp/taskr","last_synced_at":"2025-04-12T07:12:37.336Z","repository":{"id":57591662,"uuid":"121192906","full_name":"snwfdhmp/taskr","owner":"snwfdhmp","description":"Automated testing: No-regression implementation using git hooks","archived":false,"fork":false,"pushed_at":"2018-02-12T04:05:04.000Z","size":21,"stargazers_count":17,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-12T07:12:30.809Z","etag":null,"topics":["git","go","golang","no-regression","pre-commit","regression-testing","speed","task","test","unit","unit-testing"],"latest_commit_sha":null,"homepage":"https://godoc.org/github.com/snwfdhmp/taskr/pkg","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/snwfdhmp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-12T02:59:38.000Z","updated_at":"2023-04-06T06:23:09.000Z","dependencies_parsed_at":"2022-09-26T19:43:22.368Z","dependency_job_id":null,"html_url":"https://github.com/snwfdhmp/taskr","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snwfdhmp%2Ftaskr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snwfdhmp%2Ftaskr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snwfdhmp%2Ftaskr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snwfdhmp%2Ftaskr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/snwfdhmp","download_url":"https://codeload.github.com/snwfdhmp/taskr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248530571,"owners_count":21119600,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["git","go","golang","no-regression","pre-commit","regression-testing","speed","task","test","unit","unit-testing"],"created_at":"2024-07-29T19:20:21.605Z","updated_at":"2025-04-12T07:12:37.305Z","avatar_url":"https://github.com/snwfdhmp.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# taskr ⏩ go forward\n\n**Taskr keeps you going forward by applying strict no-regression rules on your repo.**\n\n```bash\n$ git commit -m \"update api /home and /welcome\"\ntaskr: regression: task 'welcomeSayHello' has returned error, did not on previous commit.\ntaskr: abort commit.\n```\n\n**It helps your team know exactly what has to be done, and how it will be rewarded.**\n\n```bash\n$ git commit -m \"fixed linting issues\"\ntaskr: this commit don't introduce any regression.\ntaskr: task lint done, reward: 5.\n[master f263b5e] fixed linting issues\n 3 files changed, 12 insertions(+), 1 deletion(-)\n```\n\n### Summary\n\n- [Installation](#installation)\n  \t- [Install with brew](#install-with-brew)\n  \t- [Install from binaries](#install-from-binaries)\n  \t- [Install with go](#install-with-go)\n    \t- [Requirements](#requirements)\n    \t- [Download](#download)\n    \t- [Install](#install)\n- [Getting started](#getting-started)\n- [Go forward](#go-forward)\n- [Complete tasks](#complete-tasks)\n- [Golang package](#golang-package)\n- [Documentation](#documentation)\n- [Author](#author)\n\n## Installation\n\nTaskr is compatible with windows, macOS, and linux.\n\n### Install with brew\n\nBrew installation is available and maybe the most simple :\n\n```sh\n$ brew tap snwfdhmp/homebrew-tap\n$ brew install taskr\n```\n\n### Install from binaries\n\nLatest release can be found [here](https://github.com/snwfdhmp/taskr/releases) for Windows, macOS, and linux.\n\n### Install with go\n\n#### Requirements\n\n- [go](https://golang.org/doc/install) (easy install)\n\nAfter you have go installed, **make sure the go binary directory is in your $PATH**. Go binary directory is located at *$(go env GOPATH)/bin*\n\nIf for any reason, you can't add GOPATH/bin to your $PATH, replace every call to  `taskr` by `$(go env GOPATH)/bin/taskr`\n\n#### Download\n\n```bash\ngo get -u github.com/snwfdhmp/taskr/...\n```\n\n#### Install\n\n```bash\ngo install github.com/snwfdhmp/taskr\n```\n\nNow, in any git repo, run:\n\n```bash\ntaskr init\n\n```\n\n## Getting started\n\nLet's create a new git repository.\n\n```bash\n$ mkdir myRepo\n$ cd myRepo\n$ git init\nInitialized empty Git repository in /Users/snwfdhmp/myRepo/.git/\n```\n\nNow **init taskr** in this repository. This works the same way in an existing repository.\n\n```bash\n$ taskr init\ntaskr inited successfully.\n```\n\nNow let's see the *taskr.yaml* file the previous just created.\n\n```yaml\n- name: compile\n  test: go build main.go\n  reward: 0\n- name: lint\n  test: golint -set_exit_status\n  reward: 0\n```\n\nBy default, taskr will create an example *taskr.yaml* file for golang.\nEach test is defined by its name, a command to run to determine if the test is pass or fail (based on exit status: 0 = pass, any other = fail), and a reward for the developer if the task is completed (will be used in upcoming versions).\n\nLet's add a bunch of code in a *main.go*.\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc SayHello() {\n\tfmt.Println(\"Hello world !\")\n}\n\nfunc main() {\n\tSayHello()\n\treturn\n}\n```\n\nNow **commit** our changes.\n\n```bash\n$ git add .taskr taskr.yaml\n$ git add main.go\n$ git commit -m \"taskr init\"\ntaskr: task 'compile' completed.\n[master (root-commit) 1eb4392] taskr init\n 3 files changed, 20 insertions(+)\n create mode 100644 .taskr/history.yaml\n create mode 100644 main.go\n create mode 100644 taskr.yaml\n```\n\nWe can see that the **task 'compile' has been completed** with this commit.\n\n## Go forward\n\nTaskr is built to keep going forward. **Regressions are automatically blocked** and taskr will abort any commit introducing one.\n\nFor example, let's add a mistake in our previous code :\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc SayHello() {\n\tfmt.Println(\"Hello world !\")\n}\n\nfunc main() {\n\tSayHe110[] //\u003c- this won't compile\n\treturn\n}\n```\n\nRemember we previously completed the task 'compile'.\n\nLet's try to commit this thing.\n\n```bash\n$ git add main.go\n$ git commit -m \"update main.go\"\ntaskr: regression: task 'compile' has returned error, did not on previous commit.\ntaskr: abort commit.\n```\n\nTaskr isn't accepting our commit because the task 'compile' now fails.\nWe have to get the test of compile (it was `go build main.go`) to pass again.\n\n## Complete tasks\n\n**To complete tasks, you have to pass their tests successfully** (exit status 0).\n\nFor example, remember the default task 'lint':\n\n```yaml\n- name: lint\n  test: golint -set_exit_status\n  reward: 0\n```\n\nWe have to get `golint -set_exit_status` to exit with status code 0.\n\nLet's try\n\n```bash\n$ golint -set_exit_status\nmain.go:7:1: exported function SayHello should have comment or be unexported\nFound 1 lint suggestions; failing.\n```\n\nWhat we have to do is fix this issue.\n\nLet's change our *main.go*\n\n```go\n...\n\n//SayHello prints \"Hello world !\" to the user\nfunc SayHello() {\n\tfmt.Println(\"Hello world !\")\n}\n\n...\n```\n\nNow retry the go linter.\n\n```bash\n$ golint -set_exit_status\n```\n\nGreat ! Let's commit those changes.\n\n```bash\n$ git add main.go\n$ git commit -m \"commented func for linting\"\ntaskr: task 'lint' completed.\n[master f265f60] commented func for linting\n 2 files changed, 1 insertion(+)\n create mode 100755 main\n```\n\nNow you know how to **complete tasks with taskr**.\n\n## Golang package\n\nTaskr is built upon the golang package **taskr**. It can be used by importing *github.com/snwfdhmp/taskr/pkg*\n\n```go\nimport (\n\t\"github.com/snwfdhmp/taskr/pkg\"\n)\n```\n\nThe package name is **taskr**.\n\nThen, for example\n\n```go\nhistory, err := taskr.OpenHistory() //error handling is omitted for readability purposes\ntasks, err := taskr.ParseTasks()\nreport, err := history.Run(tasks...)\n\nfor _, t := range report.Tests {\n\tfmt.Println(\"Test\", t.Name, \"completed. Congratulations\")\n}\n```\n\n## Documentation\n\nThe package documentation can be found [here on godoc](https://godoc.org/github.com/snwfdhmp/taskr/pkg).\n\n## Author\n\n[snwfdhmp](https://github.com/snwfdhmp)\n[Talk to me on LinkedIn](https://www.linkedin.com/in/martin-joly-951b8913b/)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnwfdhmp%2Ftaskr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsnwfdhmp%2Ftaskr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnwfdhmp%2Ftaskr/lists"}