Integriere golangci-lint in den Entwicklungsablauf
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
parent
b04acdee09
commit
1bfcdfd922
3 changed files with 20 additions and 1 deletions
9
.golangci.yml
Normal file
9
.golangci.yml
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
version: "2"
|
||||||
|
|
||||||
|
run:
|
||||||
|
timeout: 3m
|
||||||
|
modules-download-mode: readonly
|
||||||
|
|
||||||
|
linters:
|
||||||
|
enable:
|
||||||
|
- revive
|
||||||
|
|
@ -60,6 +60,7 @@ Spaeter zusaetzlich sinnvoll:
|
||||||
- `docker` und `docker compose`
|
- `docker` und `docker compose`
|
||||||
- `postgresql-client`
|
- `postgresql-client`
|
||||||
- `mosquitto-clients`
|
- `mosquitto-clients`
|
||||||
|
- `golangci-lint`
|
||||||
|
|
||||||
Fuer Container-Builds liegen erste Dockerfiles in:
|
Fuer Container-Builds liegen erste Dockerfiles in:
|
||||||
|
|
||||||
|
|
@ -114,6 +115,7 @@ Aktuell bedeutet das:
|
||||||
- `make run-backend` startet das Backend
|
- `make run-backend` startet das Backend
|
||||||
- `make run-agent` startet den Agenten
|
- `make run-agent` startet den Agenten
|
||||||
- `make fmt` formatiert beide Go-Module
|
- `make fmt` formatiert beide Go-Module
|
||||||
|
- `make lint` prueft beide Go-Module mit `golangci-lint`
|
||||||
|
|
||||||
Hinweis:
|
Hinweis:
|
||||||
|
|
||||||
|
|
|
||||||
10
Makefile
10
Makefile
|
|
@ -1,7 +1,7 @@
|
||||||
BACKEND_DIR=server/backend
|
BACKEND_DIR=server/backend
|
||||||
AGENT_DIR=player/agent
|
AGENT_DIR=player/agent
|
||||||
|
|
||||||
.PHONY: build build-backend build-agent run-backend run-agent fmt
|
.PHONY: build build-backend build-agent run-backend run-agent fmt lint lint-backend lint-agent
|
||||||
|
|
||||||
build: build-backend build-agent
|
build: build-backend build-agent
|
||||||
|
|
||||||
|
|
@ -20,3 +20,11 @@ run-agent:
|
||||||
fmt:
|
fmt:
|
||||||
cd $(BACKEND_DIR) && go fmt ./...
|
cd $(BACKEND_DIR) && go fmt ./...
|
||||||
cd $(AGENT_DIR) && go fmt ./...
|
cd $(AGENT_DIR) && go fmt ./...
|
||||||
|
|
||||||
|
lint: lint-backend lint-agent
|
||||||
|
|
||||||
|
lint-backend:
|
||||||
|
cd $(BACKEND_DIR) && golangci-lint run --config ../../.golangci.yml ./...
|
||||||
|
|
||||||
|
lint-agent:
|
||||||
|
cd $(AGENT_DIR) && golangci-lint run --config ../../.golangci.yml ./...
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue