Add a Makefile, so one command is the whole check
Verifying a change meant four invocations — gofmt, go vet, go build, go test — and remembering the order. `make` is all of them with one exit code. gofmt needs the wrapper: it reports offending files on stdout and still exits 0, so a bare `gofmt -l .` in a target would never fail the build.
This commit is contained in:
@@ -88,14 +88,16 @@ go run .
|
||||
Requires Go 1.27+, plus `ffmpeg`, `ffprobe`, and `yt-dlp` on `PATH`. There is nothing to start first:
|
||||
the database is a file under `./storage`, created on the first run.
|
||||
|
||||
Tests get a fresh database file in a temp directory each, so they need no setup and touch nothing:
|
||||
Tests get a fresh database file in a temp directory each, so they need no setup and touch nothing.
|
||||
`make` is everything that has to pass before a commit — formatting, `go vet`, and the tests:
|
||||
|
||||
```sh
|
||||
go test ./...
|
||||
make # gofmt -l, go vet, go test
|
||||
make test # just the tests
|
||||
```
|
||||
|
||||
Templates, stylesheet, and migrations are embedded with `embed.FS`, so a rebuild is needed to see
|
||||
template changes. `go build && ./levyraati` is the loop.
|
||||
template changes. `make run` is the loop.
|
||||
|
||||
## Admin page
|
||||
|
||||
|
||||
Reference in New Issue
Block a user