Skip to content

Commit acaf1a8

Browse files
authored
chore: update docs and configure linting (#41)
* refactor: remove unused helper functions and tests * chore: simplify Makefile build targets * docs: add architecture and contributing guides * docs: update project README * docs: add internal package documentation * docs: add util package documentation * docs: improve npm and schema documentation * chore: bump version to 0.1.9 in package.json * docs: remove outdated AGENTS.md file containing project guidelines and best practices * chore: add golangci-lint configuration and update Makefile and CI workflow * chore: update test command in Makefile to generate HTML coverage report and update documentation * fix: resolve golangci-lint warnings for errcheck and staticcheck * chore: remove verification step
1 parent 7c33e60 commit acaf1a8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+2490
-767
lines changed

.github/workflows/ci.yml

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,23 @@ permissions:
1515
actions: write
1616

1717
jobs:
18-
# lint:
19-
# name: Lint
20-
# runs-on: ubuntu-latest
21-
# steps:
22-
# - name: Checkout code
23-
# uses: actions/checkout@v4
24-
25-
# - name: Set up Go
26-
# uses: actions/setup-go@v5
27-
# with:
28-
# go-version: '1.25.1'
29-
# cache: true
18+
lint:
19+
name: Lint
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Checkout code
23+
uses: actions/checkout@v4
3024

31-
# - name: Run go vet
32-
# run: go vet ./...
25+
- name: Set up Go
26+
uses: actions/setup-go@v5
27+
with:
28+
go-version: '1.25.1'
29+
cache: true
3330

34-
# - name: Run golangci-lint
35-
# uses: golangci/golangci-lint-action@v7
36-
# with:
37-
# version: v2.4.0
38-
# args: --timeout=5m
31+
- name: Run golangci-lint
32+
uses: golangci/golangci-lint-action@v9
33+
with:
34+
version: v2.7.2
3935

4036
test:
4137
name: Unit Test
@@ -54,9 +50,6 @@ jobs:
5450
- name: Download dependencies
5551
run: go mod download
5652

57-
- name: Verify dependencies
58-
run: go mod verify
59-
6053
- name: Run tests
6154
run: go test -short -v -race -coverprofile=coverage.out -covermode=atomic ./...
6255

.golangci.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# golangci-lint v2 configuration
2+
# Reference: https://github.com/golangci/golangci-lint/blob/main/.golangci.reference.yml
3+
4+
version: "2"
5+
6+
linters:
7+
# 기본 린터 세트 사용 (errcheck, govet, ineffassign, staticcheck, unused)
8+
default: standard
9+
10+
formatters:
11+
enable:
12+
- goimports # import 정리 및 포맷팅
13+
14+
run:
15+
# 타임아웃 설정
16+
timeout: 5m
17+
18+
# 테스트 파일 포함
19+
tests: true

AGENTS.md

Lines changed: 0 additions & 122 deletions
This file was deleted.

Makefile

Lines changed: 14 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
# symphonyclient integration: Added CSS build targets
2-
.PHONY: build test install clean fmt lint tidy help build-all setup coverage-check build-css install-css watch-css
1+
.PHONY: build build-all test unit-test clean fmt lint tidy setup run help
32

43
BINARY_NAME=sym
54
BUILD_DIR=bin
@@ -9,116 +8,56 @@ LDFLAGS=-ldflags "-X main.Version=$(VERSION)"
98

109
help:
1110
@echo "Available targets:"
12-
@echo " build - Build the binary for current platform (includes CSS)"
11+
@echo " build - Build the binary for current platform"
1312
@echo " build-all - Build for all platforms (Linux, macOS, Windows)"
14-
@echo " build-css - Build Tailwind CSS for dashboard"
15-
@echo " watch-css - Watch and rebuild CSS on changes"
16-
@echo " test - Run tests"
17-
@echo " install - Install the binary to GOPATH/bin"
13+
@echo " test - Run tests with coverage"
14+
@echo " unit-test - Run tests without coverage"
1815
@echo " clean - Remove build artifacts"
1916
@echo " fmt - Format code"
2017
@echo " lint - Run linter"
2118
@echo " tidy - Tidy dependencies"
2219
@echo " setup - Setup development environment"
20+
@echo " run - Run the application"
2321

24-
# symphonyclient integration: CSS build for dashboard
25-
install-css:
26-
@echo "Installing CSS dependencies..."
27-
@npm install
28-
29-
build-css: install-css
30-
@echo "Building Tailwind CSS..."
31-
@npm run build:css
32-
@echo "CSS build complete"
33-
34-
watch-css: install-css
35-
@echo "Watching CSS changes..."
36-
@npm run watch:css
37-
38-
build: build-css
39-
@echo "Building $(BINARY_NAME)..."
22+
build:
4023
@mkdir -p $(BUILD_DIR)
4124
ifeq ($(OS),Windows_NT)
4225
@go build $(LDFLAGS) -o $(BUILD_DIR)/$(BINARY_NAME).exe $(MAIN_PATH)
43-
@echo "Build complete: $(BUILD_DIR)/$(BINARY_NAME).exe"
4426
else
4527
@go build $(LDFLAGS) -o $(BUILD_DIR)/$(BINARY_NAME) $(MAIN_PATH)
46-
@echo "Build complete: $(BUILD_DIR)/$(BINARY_NAME)"
4728
endif
4829

49-
build-all: build-css
50-
@echo "Building for all platforms..."
30+
build-all:
5131
@mkdir -p $(BUILD_DIR)
52-
@echo "Building Linux amd64..."
5332
@GOOS=linux GOARCH=amd64 go build $(LDFLAGS) -o $(BUILD_DIR)/$(BINARY_NAME)-linux-amd64 $(MAIN_PATH)
54-
@echo "Building Linux arm64..."
5533
@GOOS=linux GOARCH=arm64 go build $(LDFLAGS) -o $(BUILD_DIR)/$(BINARY_NAME)-linux-arm64 $(MAIN_PATH)
56-
@echo "Building macOS amd64..."
5734
@GOOS=darwin GOARCH=amd64 go build $(LDFLAGS) -o $(BUILD_DIR)/$(BINARY_NAME)-darwin-amd64 $(MAIN_PATH)
58-
@echo "Building macOS arm64..."
5935
@GOOS=darwin GOARCH=arm64 go build $(LDFLAGS) -o $(BUILD_DIR)/$(BINARY_NAME)-darwin-arm64 $(MAIN_PATH)
60-
@echo "Building Windows amd64..."
6136
@GOOS=windows GOARCH=amd64 go build $(LDFLAGS) -o $(BUILD_DIR)/$(BINARY_NAME)-windows-amd64.exe $(MAIN_PATH)
62-
@echo "All platform builds complete"
6337

6438
test:
65-
@echo "Running tests..."
66-
@go test -v -race -coverprofile=coverage.out ./...
39+
@go test -v -race -coverprofile=coverage.out -covermode=atomic ./...
6740
@go tool cover -html=coverage.out -o coverage.html
68-
@echo "Test complete. Coverage report: coverage.html"
6941

70-
coverage-check:
71-
@echo "Checking coverage threshold..."
72-
@go test -coverprofile=coverage.out ./... > /dev/null 2>&1
73-
@COVERAGE=$$(go tool cover -func=coverage.out | grep total | awk '{print $$3}' | sed 's/%//'); \
74-
THRESHOLD=80; \
75-
echo "Current coverage: $$COVERAGE%"; \
76-
echo "Required threshold: $$THRESHOLD%"; \
77-
if [ "$$(echo "$$COVERAGE < $$THRESHOLD" | bc -l 2>/dev/null || awk "BEGIN {print ($$COVERAGE < $$THRESHOLD)}")" -eq 1 ]; then \
78-
echo "❌ Coverage $$COVERAGE% is below threshold $$THRESHOLD%"; \
79-
exit 1; \
80-
else \
81-
echo "✅ Coverage $$COVERAGE% meets threshold $$THRESHOLD%"; \
82-
fi
83-
84-
install:
85-
@echo "Installing $(BINARY_NAME)..."
86-
@go install $(MAIN_PATH)
87-
@echo "Install complete"
42+
unit-test:
43+
@go test -short ./...
8844

8945
clean:
90-
@echo "Cleaning..."
9146
@rm -rf $(BUILD_DIR)
9247
@rm -f coverage.out coverage.html
93-
@rm -rf node_modules
94-
@echo "Clean complete"
9548

9649
fmt:
97-
@echo "Formatting code..."
98-
@go fmt ./...
99-
@echo "Format complete"
50+
@golangci-lint fmt
10051

10152
lint:
102-
@echo "Running linter..."
103-
golangci-lint run
104-
@echo "Linter complete"
53+
@golangci-lint run
10554

10655
tidy:
107-
@echo "Tidying dependencies..."
10856
@go mod tidy
109-
@echo "Tidy complete"
11057

111-
# Development helpers
112-
setup: tidy install-css
113-
@echo "Setting up development environment..."
58+
setup:
11459
@go mod download
115-
@go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.4.0
116-
@echo "Development environment setup complete"
117-
118-
dev-deps:
119-
@echo "Installing development dependencies..."
120-
@go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
121-
@echo "Development dependencies installed"
60+
@go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.7.2
12261

12362
run:
12463
@go run $(MAIN_PATH) $(ARGS)

0 commit comments

Comments
 (0)