-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
makefile, compose updates, updateIsReady handler
- Loading branch information
Showing
22 changed files
with
370 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
SERVER_PORT= | ||
SERVER_HOST= | ||
SERVER_UPDATES_INTERVAL= | ||
SERVER_LOG_LEVEL= | ||
SERVER_PORT= | ||
SERVER_SECRET= | ||
|
||
REDIS_PORT= | ||
REDIS_HOST= | ||
REDIS_PASSWORD= | ||
REDIS_PASSWORD= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# https://golangci-lint.run/usage/configuration/ | ||
run: | ||
# Lint only *.go files that were changed in the git commit range (default: HEAD~1..HEAD) | ||
tests: false # Don't lint _test.go files | ||
concurrency: 4 # Max number of parallel linters to run | ||
timeout: 5m # Max run time for the linter | ||
|
||
linters: | ||
enable: | ||
- govet # Go vet for catching static issues | ||
- staticcheck # Replacement for deprecated megacheck suite | ||
- revive # Extensible, configurable, and faster alternative to golint | ||
- gofumpt # Enforces consistent formatting | ||
- gocyclo # Enforces complexity rules (default < 15) | ||
- goimports # Ensures properly ordered imports | ||
- gosimple # Reports simplifiable code | ||
- unused # Finds unused variables, constants, etc. | ||
- prealloc # Highlights preallocations for performance | ||
- misspell # Finds and fixes spelling mistakes | ||
- exhaustruct # Enforces initializing all struct fields | ||
- unparam # Identifies unused function parameters | ||
- nolintlint # Flags incorrect `nolint` comments | ||
disable: | ||
- errcheck | ||
|
||
linters-settings: | ||
misspell: | ||
locale: US # Enforce American English spelling | ||
revive: | ||
severity: warning # Set the default severity for all rules | ||
exhaustruct: | ||
exclude: | ||
- '^github\.com/redis/go-redis/v9\.Options$' | ||
- '^github\.com/gorilla/websocket\.Upgrader$' | ||
- '^net/http\.Server$' | ||
- '^log/slog\.HandlerOptions$' | ||
|
||
issues: | ||
max-same-issues: 3 # Limits the number of identical issues | ||
max-issues-per-linter: 20 # Limits the number of issues per linter | ||
|
||
output: | ||
formats: | ||
- format: colored-line-number | ||
print-issued-lines: true # Print offending lines for issues |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,55 @@ | ||
.DEFAULT_GOAL := lint | ||
|
||
.PHONY: gen-env-example | ||
gen-env-example: | ||
sed 's/=.*/=/' .env > .env.example | ||
|
||
.PHONY: down | ||
down: | ||
docker compose down | ||
|
||
.PHONY: up | ||
up: | ||
docker compose up | ||
|
||
.PHONY: upd | ||
upd: | ||
docker compose up -d | ||
|
||
.PHONY: build | ||
build: | ||
docker compose build | ||
|
||
.PHONY: run | ||
run: | ||
docker compose up --build | ||
|
||
.PHONY: rund | ||
rund: | ||
docker compose up --build -d | ||
|
||
.PHONY: logs | ||
logs: | ||
docker logs -f sharetube-server | sed 's/\\n/\n/g' | ||
|
||
.PHONY: run-logs | ||
run-logs: rund logs | ||
|
||
.PHONY: lint | ||
lint: | ||
golangci-lint run | ||
|
||
.PHONY: format | ||
format: | ||
gofumpt -l . | ||
|
||
.PHONY: test | ||
test: | ||
go test -v ./internal/app | ||
|
||
.PHONY: docker-clean | ||
docker-clean: | ||
docker compose down --remove-orphans | ||
docker system prune -af | ||
docker volume prune -f | ||
docker network prune -f | ||
|
||
.PHONY: gen-env-example up upd run rund build logs docker-clean run-logs | ||
docker network prune -f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.