Skip to content

Commit

Permalink
fix(devshell): tidy the nix devshell (#120)
Browse files Browse the repository at this point in the history
Signed-off-by: oluwole fadeyi <[email protected]>
  • Loading branch information
tfadeyi authored Nov 1, 2023
1 parent 8d6260d commit 9c46793
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 68 deletions.
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
ROOT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
SHELL := /bin/bash
COMMIT:=$(shell git rev-list -1 HEAD)
VERSION:=$(COMMIT)
DATE:=$(shell date -uR)
Expand Down Expand Up @@ -56,6 +55,9 @@ clean:
lint:
golangci-lint run

format:
gofmt -l -s -w .

# generates the licenses used by the tool
licenses:
rm -rf kodata
Expand Down
42 changes: 34 additions & 8 deletions dev/devshell.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ motd = """{106}NixOS Prometheus exporter development shell{reset}
Developement commands:
* generate: runs go generate
* test: run tests and linting
* run-test: run tests and linting
* up: startup services
* down: shutdown services
* fmt: formatter
{250}Links{reset}:
* {30}go ref{reset}: http://localhost:1313/pkg/github.com/tfadeyi/auth0-simple-exporter/
Expand All @@ -31,13 +32,38 @@ packages = [
"prometheus", "moq",
"goreleaser", "golangci-lint",
"tmux", "helm-docs",
"go-swag", "ko",
"go-swag", "ko", "gnumake"
]

# Profiling & Testing
startup.heap.text = "alias heap='go tool pprof'"
[[commands]]
name = "run-test"
command = """
make test
make lint
KO_DOCKER_REPO=ghcr.io/tfadeyi/auth0-exporter goreleaser check
"""

[[commands]]
name = "fmt"
command = """
make format
"""

[[commands]]
name = "generate"
command = """
make generate
gomod2nix
"""

[[commands]]
name = "up"
command = """
process-compose -f ./dev/services.yaml up godoc
"""

startup.generate.text = "alias generate='process-compose -f ./dev/process-compose.yaml up generate'"
startup.testing.text = "alias test='process-compose -f ./dev/process-compose.yaml'"
startup.services_up.text = "alias up='process-compose -f ./dev/services.yaml up godoc'"
startup.services_down.text = "alias down='process-compose process stop godoc'"
[[commands]]
name = "down"
command = """
process-compose process stop godoc
"""
59 changes: 0 additions & 59 deletions dev/process-compose.yaml

This file was deleted.

0 comments on commit 9c46793

Please sign in to comment.