Skip to content

Commit

Permalink
Merge pull request #1379 from headlamp-k8s/backend-dx
Browse files Browse the repository at this point in the history
backend: Fix backend-lint, add backend-format, document backend make targets
  • Loading branch information
illume authored Sep 22, 2023
2 parents b2b5cdf + 2369706 commit 66a37b3
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ endif
all: backend frontend

tools/golangci-lint: backend/go.mod backend/go.sum
cd backend && go build -o ./tools/golangci-lint github.com/golangci/golangci-lint/cmd/golangci-lint
GOBIN=`pwd`/backend/tools go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.52.2

backend-lint: tools/golangci-lint
cd backend && ./tools/golangci-lint run
Expand Down Expand Up @@ -46,6 +46,10 @@ backend:
backend-test:
cd backend && go test -v -p 1 ./...

.PHONY: backend-format
backend-format:
cd backend && go fmt ./cmd/ ./pkg/**

frontend-install:
cd frontend && npm install

Expand Down
11 changes: 11 additions & 0 deletions backend/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Quickstart

```bash
make backend
make run-backend
```

See more detailed [Headlamp backend documentation on the web](
https://headlamp.dev/docs/latest/development/backend/)
or in this repo at
[../docs/development/backend.md](../docs/development/backend.md).
22 changes: 22 additions & 0 deletions docs/development/backend.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,25 @@ Once built, it can be run in development mode (insecure / don't use in productio
```bash
make run-backend
```

## Lint

To lint the backend/ code.

```bash
make backend-lint
```

## Format

To format the backend code.

```bash
make backend-format
```

## Test

```bash
make backend-test
```

0 comments on commit 66a37b3

Please sign in to comment.