chore: migrate linting and formatting commands to mise tasks

This commit is contained in:
Pasha Sviderski
2026-10-30 21:33:07 +10:00
parent 965879b69f
commit b214d23f21
5 changed files with 34 additions and 52 deletions
+1 -1
View File
@@ -30,6 +30,6 @@ jobs:
run: git checkout mise.lock
- name: Lint
run: make lint
run: mise run lint
timeout-minutes: 10
+6 -31
View File
@@ -98,33 +98,6 @@ management.
- **`misc/`**: Design documents and guides
## Key Technologies
### Core Dependencies
```go
// Networking and orchestration
github.com/docker/docker // Docker API client
github.com/docker/compose/v2 // Docker Compose integration
golang.zx2c4.com/wireguard // WireGuard implementation
github.com/hashicorp/serf // Gossip protocol
// State management
github.com/ipfs/go-ds-crdt // CRDT distributed storage
github.com/dgraph-io/badger/v3 // Embedded database
// Web proxy
github.com/caddyserver/caddy/v2 // HTTP server and reverse proxy
// CLI and UX
github.com/spf13/cobra // CLI framework
github.com/charmbracelet/huh // Interactive forms
// gRPC and networking
google.golang.org/grpc // gRPC framework
github.com/siderolabs/grpc-proxy // gRPC proxy for forwarding
```
## Development Workflow
### Build and Development
@@ -135,16 +108,18 @@ go build -o uc ./cmd/uc
go build -o uncloudd ./cmd/uncloudd
```
### Key Make Targets
### Formatting and Linting
- `mise run lint`: Check Go code and formatting without changing files
- `mise run lint:fix`: Apply formatting and available lint fixes
### Other Development Tasks
- `proto`: Generate protobuf code
- `ucind-cluster`: Create development cluster
- `update-dev`: Deploy to development machines
- `demo-reset`: Reset demo environment
- `fmt`: Format code
- `test`: Run all tests
- `lint`: Lint the code using golangci-lint
- `lint-and-fix`: Lint the code and fix issues whenever possible
## CLI Commands Structure
+8 -2
View File
@@ -100,10 +100,16 @@ mise run dev:reset user@host1 user@host2
## Linting and formatting
Lint and format the code:
Check the code and formatting without changing files:
```shell
make lint-and-fix
mise run lint
```
Apply formatting and available lint fixes:
```shell
mise run lint:fix
```
## Code generation
-18
View File
@@ -47,21 +47,3 @@ test-clean:
else \
echo "Nothing to clean."; \
fi
.PHONY: vet
vet:
go vet ./...
.PHONY: format fmt
format fmt:
GOOS=linux golangci-lint fmt
LINT_TARGETS := lint lint-and-fix
.PHONY: $(LINT_TARGETS) _lint
$(LINT_TARGETS): _lint
lint: ARGS=
lint-and-fix: ARGS=--fix
_lint:
# Explicitly set OS to Linux to not skip *_linux.go files when running on macOS.
# Uncloud daemon won't likely support OS other than Linux anytime soon, so for now we can rely on that.
GOOS=linux golangci-lint run $(ARGS)
+19
View File
@@ -46,6 +46,25 @@ description = "Run the documentation website locally"
dir = "website"
run = "npm start --"
[tasks.fmt]
description = "Format Go code and imports"
alias = "format"
env.GOOS = "linux"
run = "golangci-lint fmt"
[tasks.lint]
description = "Check Go code and formatting"
# Explicitly set OS to Linux to not skip *_linux.go files when running on macOS.
# Uncloud daemon won't likely support OS other than Linux anytime soon, so for now we can rely on that.
env.GOOS = "linux"
run = "golangci-lint run"
[tasks."lint:fix"]
description = "Format Go code and apply available lint fixes"
alias = "lint-and-fix"
env.GOOS = "linux"
run = "golangci-lint run --fix"
[tasks.mocks]
description = "Regenerate Go test mocks"
run = "mockery"