Skip to content

Commit 9fe7d48

Browse files
committed
refactor: replace makefile and taskfile with justflle
1 parent 2060492 commit 9fe7d48

File tree

5 files changed

+141
-237
lines changed

5 files changed

+141
-237
lines changed

.tool-versions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
just 1.41.0
1+
just 1.46.0

CONTRIBUTING.md

Lines changed: 40 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -24,62 +24,64 @@ To set up a development environment for this repository, you can use [devbox](ht
2424

2525
If you prefer not to use Devbox, ensure you have the following tools installed:
2626

27-
- [golangci-lint](https://golangci-lint.run/): For linting Go code.
28-
- [go-task](https://taskfile.dev/) or `make`: For running project tasks.
29-
- [modernize](https://pkg.go.dev/golang.org/x/tools/gopls/internal/analysis/modernize): Run the modernizer analyzer to simplify code by using modern constructs.
27+
- [Go](https://go.dev/dl/) (1.25 or later)
28+
- [just](https://github.com/casey/just): Command runner for project tasks
29+
- [golangci-lint](https://golangci-lint.run/): For linting Go code
30+
- [modernize](https://pkg.go.dev/golang.org/x/tools/gopls/internal/analysis/modernize): Run the modernizer analyzer to simplify code
31+
- [govulncheck](https://pkg.go.dev/golang.org/x/vuln/cmd/govulncheck): Reports known vulnerabilities that affect Go code
32+
33+
Optional tools:
34+
35+
- [goreportcard-cli](https://github.com/gojp/goreportcard): For local code quality reports (requires manual installation via git clone + make)
36+
- [prek](https://github.com/indaco/prek): For Git hooks management
3037

3138
## Setting Up Git Hooks
3239

33-
Git hooks are used to enforce code quality and streamline the workflow. Follow these steps to set them up:
40+
Git hooks are used to enforce code quality and streamline the workflow.
3441

3542
### Using Devbox
3643

37-
If using `devbox`, Git hooks are automatically installed when you run `devbox shell`. No further action is required.
44+
If using `devbox`, Git hooks are automatically installed when you run `devbox shell`. The hooks are managed by [prek](https://github.com/indaco/prek).
3845

3946
### Manual Setup
4047

41-
For users not using `devbox`, follow the steps below to manually install the Git hooks:
42-
43-
1. Clone the repository:
44-
45-
```bash
46-
git clone https://github.com/indaco/tempo.git
47-
cd tempo
48-
```
49-
50-
2. Install the Git Hooks
48+
For users not using `devbox`, install prek and run:
5149

52-
**Unix-based systems (Linux, macOS):**
50+
```bash
51+
pip install prek
52+
prek install -- --workspace
53+
```
5354

54-
```bash
55-
sh .scripts/setup-hooks.sh
56-
```
55+
This installs the commit-msg hook that validates conventional commit messages.
5756

58-
**Windows systems:**
57+
## Running Tasks
5958

60-
```cmd
61-
.scripts\setup-hooks.bat
62-
```
59+
This project uses [just](https://github.com/casey/just) for running tasks.
6360

64-
## Running Tasks
61+
### View all available recipes
6562

66-
This project provides both a `Makefile` and a `Taskfile` for running various tasks. You can use either `make` or `task` to execute the tasks, depending on your preference.
63+
```bash
64+
just help
65+
```
6766

68-
### View all available tasks
67+
### Available Recipes
6968

70-
- _Makefile_: `make help`
71-
- _Taskfile_: `task --list-all`
69+
| Recipe | Description |
70+
| ----------------- | ------------------------------------------ |
71+
| `just help` | Print help message |
72+
| `just all` | Clean and build |
73+
| `just clean` | Clean the build directory and Go cache |
74+
| `just test` | Run all tests and generate coverage report |
75+
| `just test-force` | Clean go tests cache and run all tests |
76+
| `just modernize` | Run go-modernize with auto-fix |
77+
| `just check` | Run modernize, lint, and test |
78+
| `just lint` | Run golangci-lint |
79+
| `just build` | Build the binary to build/tempo |
80+
| `just install` | Install the binary using Go install |
7281

73-
#### Common tasks
82+
### Quick Start
7483

7584
```bash
76-
build: # Build the binary
77-
clean: # Clean the build directory and Go cache
78-
default: # Run clean and build tasks
79-
install: # Install the binary using Go install
80-
lint: # Run golangci-lint
81-
modernize: # Run go-modernize
82-
test: # Run all tests and generate coverage report
83-
test/coverage: # Run go tests and use go tool cover
84-
test/force: # Clean go tests cache and run all tests
85+
# Run all quality checks before submitting a PR
86+
just check
8587
```

Makefile

Lines changed: 0 additions & 107 deletions
This file was deleted.

Taskfile.yml

Lines changed: 0 additions & 91 deletions
This file was deleted.

0 commit comments

Comments
 (0)