Refactor codebase with improved structure and logging
- Restructured info.go with extracted helper functions for better readability - Enhanced updateassets.go with cleaner asset processing logic and better error handling - Improved client.go formatting and logging consistency - Added logs.go for centralized logging functionality - Updated dependencies in go.mod to include tint as direct dependency - Cleaned up README.md with simplified installation instructions and structure - Added comprehensive assets/ directory with build configuration 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
c01c9c2843
commit
71a7b0de11
18 changed files with 852 additions and 105 deletions
57
assets/build/test.mk
Normal file
57
assets/build/test.mk
Normal file
|
@ -0,0 +1,57 @@
|
|||
# ====================================================================================
|
||||
# Testing and Quality Assurance
|
||||
# ====================================================================================
|
||||
|
||||
## Install go tools
|
||||
install-go-tools:
|
||||
@echo Installing go tools
|
||||
$(GO) install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.61.0
|
||||
$(GO) install gotest.tools/gotestsum@v1.7.0
|
||||
|
||||
## Runs eslint and golangci-lint
|
||||
.PHONY: check-style
|
||||
check-style: manifest-check webapp/node_modules install-go-tools
|
||||
@echo Checking for style guide compliance
|
||||
|
||||
ifneq ($(HAS_WEBAPP),)
|
||||
cd webapp && npm run lint
|
||||
cd webapp && npm run check-types
|
||||
endif
|
||||
|
||||
# It's highly recommended to run go-vet first
|
||||
# to find potential compile errors that could introduce
|
||||
# weird reports at golangci-lint step
|
||||
ifneq ($(HAS_SERVER),)
|
||||
@echo Running golangci-lint
|
||||
$(GO) vet ./...
|
||||
$(GOBIN)/golangci-lint run ./...
|
||||
endif
|
||||
|
||||
## Runs any lints and unit tests defined for the server and webapp, if they exist.
|
||||
.PHONY: test
|
||||
test: webapp/node_modules install-go-tools
|
||||
ifneq ($(HAS_SERVER),)
|
||||
$(GOBIN)/gotestsum -- -v ./...
|
||||
endif
|
||||
ifneq ($(HAS_WEBAPP),)
|
||||
cd webapp && $(NPM) run test;
|
||||
endif
|
||||
|
||||
## Runs any lints and unit tests defined for the server and webapp, if they exist, optimized
|
||||
## for a CI environment.
|
||||
.PHONY: test-ci
|
||||
test-ci: webapp/node_modules install-go-tools
|
||||
ifneq ($(HAS_SERVER),)
|
||||
$(GOBIN)/gotestsum --format standard-verbose --junitfile report.xml -- ./...
|
||||
endif
|
||||
ifneq ($(HAS_WEBAPP),)
|
||||
cd webapp && $(NPM) run test;
|
||||
endif
|
||||
|
||||
## Creates a coverage report for the server code.
|
||||
.PHONY: coverage
|
||||
coverage: webapp/node_modules
|
||||
ifneq ($(HAS_SERVER),)
|
||||
$(GO) test $(GO_TEST_FLAGS) -coverprofile=server/coverage.txt ./server/...
|
||||
$(GO) tool cover -html=server/coverage.txt
|
||||
endif
|
Loading…
Add table
Add a link
Reference in a new issue