Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .air.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Air configuration file for hot reload development
# https://github.com/air-verse/air

root = "."
testdata_dir = "testdata"
tmp_dir = "tmp"

[build]
args_bin = []
bin = "./tmp/main"
cmd = "go build -o ./tmp/main ./cmd/server"
delay = 1000
exclude_dir = ["assets", "tmp", "vendor", "testdata", "test", "bin"]
exclude_file = []
exclude_regex = ["_test.go"]
exclude_unchanged = false
follow_symlink = false
full_bin = ""
include_dir = []
include_ext = ["go", "tpl", "tmpl", "html"]
include_file = []
kill_delay = "0s"
log = "build-errors.log"
poll = false
poll_interval = 0
post_cmd = []
pre_cmd = []
rerun = false
rerun_delay = 500
send_interrupt = false
stop_on_error = false

[color]
app = ""
build = "yellow"
main = "magenta"
runner = "green"
watcher = "cyan"

[log]
main_only = false
time = false

[misc]
clean_on_exit = true

[screen]
clear_on_rebuild = false
keep_scroll = true
60 changes: 60 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

# Go files
[*.go]
indent_style = tab
indent_size = 4

# Makefiles require tabs
[{Makefile,*.mk}]
indent_style = tab
indent_size = 4

# YAML files
[*.{yml,yaml}]
indent_style = space
indent_size = 2

# JSON files
[*.json]
indent_style = space
indent_size = 2

# TOML files
[*.toml]
indent_style = space
indent_size = 2

# Markdown files
[*.md]
indent_style = space
indent_size = 2
trim_trailing_whitespace = false

# Shell scripts (Unix)
[*.sh]
indent_style = space
indent_size = 2
end_of_line = lf

# PowerShell scripts (Windows)
[*.ps1]
indent_style = space
indent_size = 4
end_of_line = crlf

# Batch files (Windows)
[*.{cmd,bat}]
indent_style = space
indent_size = 4
end_of_line = crlf
51 changes: 51 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Cross-platform line ending configuration
# This ensures proper handling of line endings across Windows, macOS, and Linux

# Auto detect text files and normalize line endings to LF in the repository
* text=auto

# Shell scripts should always use LF
*.sh text eol=lf
*.bash text eol=lf

# PowerShell scripts should use CRLF on Windows
*.ps1 text eol=crlf

# Go source files
*.go text eol=lf

# Markdown and documentation
*.md text eol=lf
*.txt text eol=lf

# YAML and configuration files
*.yml text eol=lf
*.yaml text eol=lf
*.toml text eol=lf
*.json text eol=lf

# Makefiles must use LF
Makefile text eol=lf
*.mk text eol=lf

# Binary files
*.exe binary
*.dll binary
*.so binary
*.dylib binary
*.a binary
*.o binary

# Images
*.png binary
*.jpg binary
*.jpeg binary
*.gif binary
*.ico binary
*.svg binary

# Archives
*.tar binary
*.gz binary
*.zip binary
*.7z binary
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
#
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
Expand Down
13 changes: 12 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
{
"recommendations": ["golang.go", "redhat.vscode-yaml"],
"recommendations": [
"golang.go",
"redhat.vscode-yaml",
"ms-vscode.makefile-tools",
"ms-vscode.powershell",
"eamodio.gitlens",
"davidanson.vscode-markdownlint",
"editorconfig.editorconfig",
"streetsidesoftware.code-spell-checker",
"ms-azuretools.vscode-docker",
"github.vscode-github-actions"
],
"unwantedRecommendations": []
}
49 changes: 49 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch Server",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/cmd/server",
"env": {},
"args": [],
"showLog": true,
"preLaunchTask": "Build (Current Platform)"
},
{
"name": "Launch Server (No Build)",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/cmd/server",
"env": {},
"args": [],
"showLog": true
},
{
"name": "Debug Tests (Current File)",
"type": "go",
"request": "launch",
"mode": "test",
"program": "${fileDirname}",
"showLog": true
},
{
"name": "Debug Tests (All)",
"type": "go",
"request": "launch",
"mode": "test",
"program": "${workspaceFolder}/test",
"showLog": true
},
{
"name": "Attach to Process",
"type": "go",
"request": "attach",
"mode": "local",
"processId": "${command:pickProcess}"
}
]
}
153 changes: 153 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Build (Current Platform)",
"type": "shell",
"command": "make build-current",
"windows": {
"command": "go build -o ${workspaceFolder}\\bin\\gochat.exe ${workspaceFolder}\\cmd\\server"
},
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"reveal": "always",
"panel": "new"
},
"problemMatcher": ["$go"]
},
{
"label": "Build All Platforms",
"type": "shell",
"command": "make build-all",
"group": "build",
"presentation": {
"reveal": "always",
"panel": "new"
},
"problemMatcher": ["$go"]
},
{
"label": "Run Server",
"type": "shell",
"command": "${workspaceFolder}/bin/gochat",
"windows": {
"command": "${workspaceFolder}\\bin\\gochat.exe"
},
"group": "none",
"presentation": {
"reveal": "always",
"panel": "new"
},
"problemMatcher": []
},
{
"label": "Dev (Hot Reload)",
"type": "shell",
"command": "air",
"group": "none",
"presentation": {
"reveal": "always",
"panel": "new"
},
"problemMatcher": ["$go"]
},
{
"label": "Test All",
"type": "shell",
"command": "make test",
"windows": {
"command": "go test -v -race ./..."
},
"group": {
"kind": "test",
"isDefault": true
},
"presentation": {
"reveal": "always",
"panel": "new"
},
"problemMatcher": ["$go"]
},
{
"label": "Test with Coverage",
"type": "shell",
"command": "make test-coverage",
"windows": {
"command": "go test -v -race -coverpkg=./cmd/...,./internal/... -coverprofile=coverage.out ./test/... && go tool cover -html=coverage.out"
},
"group": "test",
"presentation": {
"reveal": "always",
"panel": "new"
},
"problemMatcher": ["$go"]
},
{
"label": "Lint",
"type": "shell",
"command": "make lint",
"windows": {
"command": "golangci-lint run --config .golangci.yml"
},
"group": "none",
"presentation": {
"reveal": "always",
"panel": "new"
},
"problemMatcher": ["$go"]
},
{
"label": "Security Scan",
"type": "shell",
"command": "make security-scan",
"windows": {
"command": "govulncheck ./... && gosec ./..."
},
"group": "none",
"presentation": {
"reveal": "always",
"panel": "new"
},
"problemMatcher": []
},
{
"label": "Full CI Check",
"type": "shell",
"command": "make ci-local",
"group": "none",
"presentation": {
"reveal": "always",
"panel": "new"
},
"problemMatcher": ["$go"]
},
{
"label": "Clean Build Artifacts",
"type": "shell",
"command": "make clean",
"windows": {
"command": "pwsh -Command if (Test-Path bin) { Remove-Item -Recurse -Force bin }; if (Test-Path tmp) { Remove-Item -Recurse -Force tmp }; if (Test-Path coverage.out) { Remove-Item coverage.out }"
},
"group": "none",
"presentation": {
"reveal": "always",
"panel": "new"
},
"problemMatcher": []
},
{
"label": "Create Release",
"type": "shell",
"command": "make release",
"group": "none",
"presentation": {
"reveal": "always",
"panel": "new"
},
"problemMatcher": ["$go"]
}
]
}
Loading
Loading