@mytechtoday/augment-extensions 1.3.1 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +105 -6
- package/augment-extensions/coding-standards/c/CHANGELOG.md +55 -0
- package/augment-extensions/coding-standards/c/LICENSE +22 -0
- package/augment-extensions/coding-standards/c/README.md +167 -0
- package/augment-extensions/coding-standards/c/config/defaults.json +26 -0
- package/augment-extensions/coding-standards/c/config/examples/embedded.yaml +25 -0
- package/augment-extensions/coding-standards/c/config/examples/systems.json +31 -0
- package/augment-extensions/coding-standards/c/config/schema.json +244 -0
- package/augment-extensions/coding-standards/c/docs/API.md +613 -0
- package/augment-extensions/coding-standards/c/docs/CONFIGURATION.md +259 -0
- package/augment-extensions/coding-standards/c/docs/USER_GUIDE.md +567 -0
- package/augment-extensions/coding-standards/c/examples/drivers/Makefile +33 -0
- package/augment-extensions/coding-standards/c/examples/drivers/README.md +192 -0
- package/augment-extensions/coding-standards/c/examples/drivers/dma-example.c +224 -0
- package/augment-extensions/coding-standards/c/examples/drivers/example.dts +64 -0
- package/augment-extensions/coding-standards/c/examples/drivers/platform-driver.c +174 -0
- package/augment-extensions/coding-standards/c/examples/embedded/README.md +167 -0
- package/augment-extensions/coding-standards/c/examples/embedded/gpio-control.c +172 -0
- package/augment-extensions/coding-standards/c/examples/embedded/timer-isr.c +198 -0
- package/augment-extensions/coding-standards/c/examples/embedded/uart-communication.c +212 -0
- package/augment-extensions/coding-standards/c/examples/kernel/Makefile +82 -0
- package/augment-extensions/coding-standards/c/examples/kernel/README.md +168 -0
- package/augment-extensions/coding-standards/c/examples/kernel/char-device.c +198 -0
- package/augment-extensions/coding-standards/c/examples/kernel/proc-file.c +131 -0
- package/augment-extensions/coding-standards/c/examples/kernel/simple-module.c +111 -0
- package/augment-extensions/coding-standards/c/examples/legacy/Makefile +62 -0
- package/augment-extensions/coding-standards/c/examples/legacy/README.md +255 -0
- package/augment-extensions/coding-standards/c/examples/legacy/c89-to-c11-migration.c +268 -0
- package/augment-extensions/coding-standards/c/examples/legacy/compatibility-layer.c +239 -0
- package/augment-extensions/coding-standards/c/examples/networking/Makefile +35 -0
- package/augment-extensions/coding-standards/c/examples/networking/README.md +207 -0
- package/augment-extensions/coding-standards/c/examples/networking/protocol-parser.c +270 -0
- package/augment-extensions/coding-standards/c/examples/networking/tcp-server.c +197 -0
- package/augment-extensions/coding-standards/c/examples/networking/udp-multicast.c +220 -0
- package/augment-extensions/coding-standards/c/examples/realtime/Makefile +53 -0
- package/augment-extensions/coding-standards/c/examples/realtime/README.md +199 -0
- package/augment-extensions/coding-standards/c/examples/realtime/deadline-monitoring.c +260 -0
- package/augment-extensions/coding-standards/c/examples/realtime/priority-scheduling.c +258 -0
- package/augment-extensions/coding-standards/c/examples/systems/Makefile +34 -0
- package/augment-extensions/coding-standards/c/examples/systems/README.md +123 -0
- package/augment-extensions/coding-standards/c/examples/systems/ipc-pipes.c +181 -0
- package/augment-extensions/coding-standards/c/examples/systems/process-management.c +153 -0
- package/augment-extensions/coding-standards/c/examples/systems/signal-handling.c +162 -0
- package/augment-extensions/coding-standards/c/module.json +149 -0
- package/augment-extensions/coding-standards/c/rules/categories/drivers.md +635 -0
- package/augment-extensions/coding-standards/c/rules/categories/embedded.md +510 -0
- package/augment-extensions/coding-standards/c/rules/categories/kernel.md +653 -0
- package/augment-extensions/coding-standards/c/rules/categories/legacy.md +526 -0
- package/augment-extensions/coding-standards/c/rules/categories/networking.md +735 -0
- package/augment-extensions/coding-standards/c/rules/categories/realtime.md +631 -0
- package/augment-extensions/coding-standards/c/rules/categories/systems.md +586 -0
- package/augment-extensions/coding-standards/c/rules/universal/const-correctness.md +275 -0
- package/augment-extensions/coding-standards/c/rules/universal/documentation.md +251 -0
- package/augment-extensions/coding-standards/c/rules/universal/error-handling.md +250 -0
- package/augment-extensions/coding-standards/c/rules/universal/header-guards.md +254 -0
- package/augment-extensions/coding-standards/c/rules/universal/memory-safety.md +233 -0
- package/augment-extensions/coding-standards/c/rules/universal/naming.md +146 -0
- package/augment-extensions/coding-standards/c/src/conflict-detector.ts +461 -0
- package/augment-extensions/coding-standards/c/src/prompt-generator.ts +307 -0
- package/augment-extensions/coding-standards/c/src/rule-evaluator.ts +307 -0
- package/augment-extensions/coding-standards/c/src/rule-override.ts +427 -0
- package/augment-extensions/coding-standards/c/src/template-engine.ts +217 -0
- package/augment-extensions/coding-standards/c/templates/prompts/drivers.txt +191 -0
- package/augment-extensions/coding-standards/c/templates/prompts/embedded.txt +164 -0
- package/augment-extensions/coding-standards/c/templates/prompts/kernel.txt +175 -0
- package/augment-extensions/coding-standards/c/templates/prompts/legacy.txt +280 -0
- package/augment-extensions/coding-standards/c/templates/prompts/networking.txt +259 -0
- package/augment-extensions/coding-standards/c/templates/prompts/realtime.txt +219 -0
- package/augment-extensions/coding-standards/c/templates/prompts/systems.txt +147 -0
- package/augment-extensions/coding-standards/c/tests/integration/category-specific.test.ts +356 -0
- package/augment-extensions/coding-standards/c/tests/integration/end-to-end-workflow.test.ts +377 -0
- package/augment-extensions/coding-standards/c/tests/performance/benchmarks.test.ts +407 -0
- package/augment-extensions/coding-standards/c/tests/unit/config-manager.test.ts +345 -0
- package/augment-extensions/coding-standards/c/tests/unit/conflict-detector.test.ts +294 -0
- package/augment-extensions/coding-standards/c/tests/unit/prompt-generator.test.ts +174 -0
- package/augment-extensions/coding-standards/c/tests/unit/registry.test.ts +313 -0
- package/augment-extensions/coding-standards/c/tests/unit/rule-evaluator.test.ts +318 -0
- package/augment-extensions/coding-standards/c/tests/unit/rule-override.test.ts +326 -0
- package/augment-extensions/coding-standards/c/tests/unit/template-engine.test.ts +314 -0
- package/augment-extensions/coding-standards/go/CHARACTER-COUNT-REPORT.md +135 -0
- package/augment-extensions/coding-standards/go/PHASE1-COMPLETION.md +146 -0
- package/augment-extensions/coding-standards/go/PHASE4-COMPLETION.md +184 -0
- package/augment-extensions/coding-standards/go/README.md +200 -0
- package/augment-extensions/coding-standards/go/VALIDATION-CHECKLIST.md +154 -0
- package/augment-extensions/coding-standards/go/config/examples/example-cli.json +15 -0
- package/augment-extensions/coding-standards/go/config/examples/example-microservices.json +21 -0
- package/augment-extensions/coding-standards/go/config/examples/example-multi-category.yaml +24 -0
- package/augment-extensions/coding-standards/go/config/examples/example-web.json +15 -0
- package/augment-extensions/coding-standards/go/config/schema.json +110 -0
- package/augment-extensions/coding-standards/go/docs/CATEGORIES.md +221 -0
- package/augment-extensions/coding-standards/go/docs/CONFIGURATION.md +198 -0
- package/augment-extensions/coding-standards/go/docs/TROUBLESHOOTING.md +285 -0
- package/augment-extensions/coding-standards/go/examples/cli/cobra-app.go +287 -0
- package/augment-extensions/coding-standards/go/examples/cloud-native-app.go +217 -0
- package/augment-extensions/coding-standards/go/examples/devops-tool.go +250 -0
- package/augment-extensions/coding-standards/go/examples/distributed-system.go +247 -0
- package/augment-extensions/coding-standards/go/examples/microservices/grpc-service.go +253 -0
- package/augment-extensions/coding-standards/go/examples/rest-api.go +270 -0
- package/augment-extensions/coding-standards/go/examples/web/http-server.go +224 -0
- package/augment-extensions/coding-standards/go/module.json +139 -0
- package/augment-extensions/coding-standards/go/rules/categories/api-development/api-versioning.md +149 -0
- package/augment-extensions/coding-standards/go/rules/categories/api-development/rate-limiting.md +209 -0
- package/augment-extensions/coding-standards/go/rules/categories/api-development/rest-api-design.md +183 -0
- package/augment-extensions/coding-standards/go/rules/categories/cloud-native/cloud-config.md +193 -0
- package/augment-extensions/coding-standards/go/rules/categories/cloud-native/health-checks.md +231 -0
- package/augment-extensions/coding-standards/go/rules/categories/cloud-native/kubernetes.md +180 -0
- package/augment-extensions/coding-standards/go/rules/categories/devops-tooling/automation.md +179 -0
- package/augment-extensions/coding-standards/go/rules/categories/devops-tooling/ci-cd-integration.md +147 -0
- package/augment-extensions/coding-standards/go/rules/categories/devops-tooling/infrastructure-as-code.md +231 -0
- package/augment-extensions/coding-standards/go/rules/categories/distributed-systems/caching.md +150 -0
- package/augment-extensions/coding-standards/go/rules/categories/distributed-systems/consensus.md +187 -0
- package/augment-extensions/coding-standards/go/rules/categories/distributed-systems/event-sourcing.md +246 -0
- package/augment-extensions/coding-standards/go/rules/cli/command-parsing.md +264 -0
- package/augment-extensions/coding-standards/go/rules/cli/configuration.md +268 -0
- package/augment-extensions/coding-standards/go/rules/cli/cross-platform.md +324 -0
- package/augment-extensions/coding-standards/go/rules/microservices/distributed-tracing.md +253 -0
- package/augment-extensions/coding-standards/go/rules/microservices/grpc.md +257 -0
- package/augment-extensions/coding-standards/go/rules/microservices/metrics.md +278 -0
- package/augment-extensions/coding-standards/go/rules/microservices/service-discovery.md +249 -0
- package/augment-extensions/coding-standards/go/rules/universal/code-organization.md +221 -0
- package/augment-extensions/coding-standards/go/rules/universal/documentation.md +269 -0
- package/augment-extensions/coding-standards/go/rules/universal/performance.md +323 -0
- package/augment-extensions/coding-standards/go/rules/universal/testing.md +162 -0
- package/augment-extensions/coding-standards/go/rules/web/graceful-shutdown.md +249 -0
- package/augment-extensions/coding-standards/go/rules/web/http-handlers.md +164 -0
- package/augment-extensions/coding-standards/go/rules/web/middleware.md +234 -0
- package/augment-extensions/coding-standards/go/rules/web/routing.md +251 -0
- package/augment-extensions/coding-standards/go/templates/prompts/api.md +160 -0
- package/augment-extensions/coding-standards/go/templates/prompts/cli.md +225 -0
- package/augment-extensions/coding-standards/go/templates/prompts/cloud-native.md +121 -0
- package/augment-extensions/coding-standards/go/templates/prompts/devops.md +146 -0
- package/augment-extensions/coding-standards/go/templates/prompts/distributed.md +133 -0
- package/augment-extensions/coding-standards/go/templates/prompts/microservices.md +225 -0
- package/augment-extensions/coding-standards/go/templates/prompts/web.md +181 -0
- package/augment-extensions/coding-standards/go/tests/integration/module-integration.test.ts +164 -0
- package/augment-extensions/coding-standards/go/tests/unit/category-selection.test.ts +147 -0
- package/augment-extensions/coding-standards/go/tests/unit/module-structure.test.ts +154 -0
- package/augment-extensions/coding-standards/go/tests/validate-character-count.ps1 +13 -0
- package/augment-extensions/coding-standards/go/tests/validate-examples.ps1 +148 -0
- package/augment-extensions/coding-standards/go/tests/validate-examples.sh +135 -0
- package/cli/dist/analysis/ast-parser.d.ts +47 -0
- package/cli/dist/analysis/ast-parser.d.ts.map +1 -0
- package/cli/dist/analysis/ast-parser.js +161 -0
- package/cli/dist/analysis/ast-parser.js.map +1 -0
- package/cli/dist/analysis/complexity-analyzer.d.ts +27 -0
- package/cli/dist/analysis/complexity-analyzer.d.ts.map +1 -0
- package/cli/dist/analysis/complexity-analyzer.js +189 -0
- package/cli/dist/analysis/complexity-analyzer.js.map +1 -0
- package/cli/dist/analysis/dependency-analyzer.d.ts +23 -0
- package/cli/dist/analysis/dependency-analyzer.d.ts.map +1 -0
- package/cli/dist/analysis/dependency-analyzer.js +237 -0
- package/cli/dist/analysis/dependency-analyzer.js.map +1 -0
- package/cli/dist/analysis/index.d.ts +9 -0
- package/cli/dist/analysis/index.d.ts.map +1 -0
- package/cli/dist/analysis/index.js +25 -0
- package/cli/dist/analysis/index.js.map +1 -0
- package/cli/dist/analysis/security-scanner.d.ts +11 -0
- package/cli/dist/analysis/security-scanner.d.ts.map +1 -0
- package/cli/dist/analysis/security-scanner.js +294 -0
- package/cli/dist/analysis/security-scanner.js.map +1 -0
- package/cli/dist/analysis/types.d.ts +151 -0
- package/cli/dist/analysis/types.d.ts.map +1 -0
- package/cli/dist/analysis/types.js +6 -0
- package/cli/dist/analysis/types.js.map +1 -0
- package/cli/dist/cli.js +24 -0
- package/cli/dist/cli.js.map +1 -1
- package/cli/dist/commands/code-analysis.d.ts +11 -0
- package/cli/dist/commands/code-analysis.d.ts.map +1 -0
- package/cli/dist/commands/code-analysis.js +412 -0
- package/cli/dist/commands/code-analysis.js.map +1 -0
- package/modules.md +99 -3
- package/package.json +21 -2
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "https://github.com/mytech-today-now/augment-extensions/coding-standards/go/config/schema.json",
|
|
4
|
+
"title": "Go Coding Standards Configuration",
|
|
5
|
+
"description": "Configuration schema for Go coding standards extension",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"categories": {
|
|
9
|
+
"type": "array",
|
|
10
|
+
"description": "Array of Go project categories to enable. Each category provides specialized rules and best practices.",
|
|
11
|
+
"items": {
|
|
12
|
+
"type": "string",
|
|
13
|
+
"enum": ["web", "microservices", "cli", "cloud", "distributed", "devops", "api"],
|
|
14
|
+
"enumDescriptions": {
|
|
15
|
+
"web": "HTTP server development, middleware patterns, routing, graceful shutdown",
|
|
16
|
+
"microservices": "gRPC, service discovery, distributed tracing, health checks, metrics",
|
|
17
|
+
"cli": "Command-line tools with cobra, viper, flag handling, cross-platform support",
|
|
18
|
+
"cloud": "Kubernetes operators, cloud SDKs, containerization, 12-factor apps",
|
|
19
|
+
"distributed": "Event sourcing, message queues, consensus algorithms, distributed locks",
|
|
20
|
+
"devops": "Infrastructure automation, CI/CD, monitoring, log aggregation",
|
|
21
|
+
"api": "RESTful APIs, GraphQL, authentication, rate limiting, OpenAPI"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"uniqueItems": true,
|
|
25
|
+
"minItems": 1,
|
|
26
|
+
"default": ["web"]
|
|
27
|
+
},
|
|
28
|
+
"rules": {
|
|
29
|
+
"type": "object",
|
|
30
|
+
"description": "Rule configuration and overrides",
|
|
31
|
+
"properties": {
|
|
32
|
+
"enabled": {
|
|
33
|
+
"type": "boolean",
|
|
34
|
+
"description": "Enable or disable all rules globally",
|
|
35
|
+
"default": true
|
|
36
|
+
},
|
|
37
|
+
"severity": {
|
|
38
|
+
"type": "string",
|
|
39
|
+
"description": "Default severity level for all rules",
|
|
40
|
+
"enum": ["error", "warning", "info"],
|
|
41
|
+
"default": "error"
|
|
42
|
+
},
|
|
43
|
+
"overrides": {
|
|
44
|
+
"type": "object",
|
|
45
|
+
"description": "Category-specific rule overrides",
|
|
46
|
+
"patternProperties": {
|
|
47
|
+
"^(web|microservices|cli|cloud|distributed|devops|api)$": {
|
|
48
|
+
"type": "object",
|
|
49
|
+
"properties": {
|
|
50
|
+
"enabled": {
|
|
51
|
+
"type": "boolean",
|
|
52
|
+
"description": "Enable/disable rules for this category"
|
|
53
|
+
},
|
|
54
|
+
"severity": {
|
|
55
|
+
"type": "string",
|
|
56
|
+
"enum": ["error", "warning", "info"],
|
|
57
|
+
"description": "Override severity for this category"
|
|
58
|
+
},
|
|
59
|
+
"specific": {
|
|
60
|
+
"type": "object",
|
|
61
|
+
"description": "Specific rule configurations",
|
|
62
|
+
"additionalProperties": {
|
|
63
|
+
"type": "object",
|
|
64
|
+
"properties": {
|
|
65
|
+
"enabled": {
|
|
66
|
+
"type": "boolean"
|
|
67
|
+
},
|
|
68
|
+
"severity": {
|
|
69
|
+
"type": "string",
|
|
70
|
+
"enum": ["error", "warning", "info"]
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
"staticAnalysis": {
|
|
82
|
+
"type": "object",
|
|
83
|
+
"description": "Static analysis tool configuration",
|
|
84
|
+
"properties": {
|
|
85
|
+
"golangci-lint": {
|
|
86
|
+
"type": "boolean",
|
|
87
|
+
"description": "Enable golangci-lint integration",
|
|
88
|
+
"default": true
|
|
89
|
+
},
|
|
90
|
+
"staticcheck": {
|
|
91
|
+
"type": "boolean",
|
|
92
|
+
"description": "Enable staticcheck integration",
|
|
93
|
+
"default": true
|
|
94
|
+
},
|
|
95
|
+
"govet": {
|
|
96
|
+
"type": "boolean",
|
|
97
|
+
"description": "Enable go vet integration",
|
|
98
|
+
"default": true
|
|
99
|
+
},
|
|
100
|
+
"gosec": {
|
|
101
|
+
"type": "boolean",
|
|
102
|
+
"description": "Enable gosec security scanner",
|
|
103
|
+
"default": true
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
"required": ["categories"]
|
|
109
|
+
}
|
|
110
|
+
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
# Category Guide
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
The Go Coding Standards module supports 7 specialized categories, each with tailored rules and best practices for specific project types.
|
|
6
|
+
|
|
7
|
+
## Categories
|
|
8
|
+
|
|
9
|
+
### 1. Web Services (`web`)
|
|
10
|
+
|
|
11
|
+
**Use Case:** HTTP servers, REST APIs, web applications
|
|
12
|
+
|
|
13
|
+
**Key Rules:**
|
|
14
|
+
- HTTP handler patterns
|
|
15
|
+
- Middleware implementation
|
|
16
|
+
- Request/response handling
|
|
17
|
+
- Graceful shutdown
|
|
18
|
+
- Routing best practices
|
|
19
|
+
|
|
20
|
+
**Example Projects:**
|
|
21
|
+
- REST API servers
|
|
22
|
+
- Web applications
|
|
23
|
+
- HTTP microservices
|
|
24
|
+
- API gateways
|
|
25
|
+
|
|
26
|
+
**Template:** `templates/web-service.md`
|
|
27
|
+
|
|
28
|
+
**Examples:** `examples/web/`
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
### 2. Microservices (`microservices`)
|
|
33
|
+
|
|
34
|
+
**Use Case:** gRPC services, service-oriented architectures
|
|
35
|
+
|
|
36
|
+
**Key Rules:**
|
|
37
|
+
- gRPC service implementation
|
|
38
|
+
- Service discovery patterns
|
|
39
|
+
- Distributed tracing
|
|
40
|
+
- Metrics and monitoring
|
|
41
|
+
- Inter-service communication
|
|
42
|
+
|
|
43
|
+
**Example Projects:**
|
|
44
|
+
- gRPC services
|
|
45
|
+
- Service meshes
|
|
46
|
+
- Event-driven microservices
|
|
47
|
+
- Backend-for-frontend (BFF)
|
|
48
|
+
|
|
49
|
+
**Template:** `templates/microservice.md`
|
|
50
|
+
|
|
51
|
+
**Examples:** `examples/microservices/`
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
### 3. CLI Tools (`cli`)
|
|
56
|
+
|
|
57
|
+
**Use Case:** Command-line applications, developer tools
|
|
58
|
+
|
|
59
|
+
**Key Rules:**
|
|
60
|
+
- Command parsing (Cobra)
|
|
61
|
+
- Configuration management (Viper)
|
|
62
|
+
- Cross-platform compatibility
|
|
63
|
+
- User-friendly error messages
|
|
64
|
+
- Exit codes and signals
|
|
65
|
+
|
|
66
|
+
**Example Projects:**
|
|
67
|
+
- Developer tools
|
|
68
|
+
- System utilities
|
|
69
|
+
- Build tools
|
|
70
|
+
- Deployment scripts
|
|
71
|
+
|
|
72
|
+
**Template:** `templates/cli-tool.md`
|
|
73
|
+
|
|
74
|
+
**Examples:** `examples/cli/`
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
### 4. Cloud-Native (`cloud`)
|
|
79
|
+
|
|
80
|
+
**Use Case:** Kubernetes applications, cloud platforms
|
|
81
|
+
|
|
82
|
+
**Key Rules:**
|
|
83
|
+
- Kubernetes integration
|
|
84
|
+
- Health checks and readiness probes
|
|
85
|
+
- Configuration from environment
|
|
86
|
+
- Graceful shutdown
|
|
87
|
+
- 12-factor app principles
|
|
88
|
+
|
|
89
|
+
**Example Projects:**
|
|
90
|
+
- Kubernetes operators
|
|
91
|
+
- Cloud-native applications
|
|
92
|
+
- Containerized services
|
|
93
|
+
- Platform services
|
|
94
|
+
|
|
95
|
+
**Template:** `templates/cloud-native.md`
|
|
96
|
+
|
|
97
|
+
**Examples:** `examples/cloud/`
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
### 5. Distributed Systems (`distributed`)
|
|
102
|
+
|
|
103
|
+
**Use Case:** Event-driven architectures, distributed computing
|
|
104
|
+
|
|
105
|
+
**Key Rules:**
|
|
106
|
+
- Consensus algorithms (Raft)
|
|
107
|
+
- Event sourcing and CQRS
|
|
108
|
+
- Distributed caching
|
|
109
|
+
- Message queues
|
|
110
|
+
- Eventual consistency
|
|
111
|
+
|
|
112
|
+
**Example Projects:**
|
|
113
|
+
- Event-driven systems
|
|
114
|
+
- Distributed databases
|
|
115
|
+
- Message brokers
|
|
116
|
+
- Stream processing
|
|
117
|
+
|
|
118
|
+
**Template:** `templates/distributed.md`
|
|
119
|
+
|
|
120
|
+
**Examples:** `examples/distributed/`
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
### 6. DevOps Tooling (`devops`)
|
|
125
|
+
|
|
126
|
+
**Use Case:** Automation tools, infrastructure management
|
|
127
|
+
|
|
128
|
+
**Key Rules:**
|
|
129
|
+
- Deployment automation
|
|
130
|
+
- CI/CD integration
|
|
131
|
+
- Infrastructure as code
|
|
132
|
+
- Idempotent operations
|
|
133
|
+
- State management
|
|
134
|
+
|
|
135
|
+
**Example Projects:**
|
|
136
|
+
- Deployment tools
|
|
137
|
+
- Infrastructure automation
|
|
138
|
+
- CI/CD pipelines
|
|
139
|
+
- Configuration management
|
|
140
|
+
|
|
141
|
+
**Template:** `templates/devops.md`
|
|
142
|
+
|
|
143
|
+
**Examples:** `examples/devops/`
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
### 7. API Development (`api`)
|
|
148
|
+
|
|
149
|
+
**Use Case:** REST and GraphQL APIs
|
|
150
|
+
|
|
151
|
+
**Key Rules:**
|
|
152
|
+
- REST API design
|
|
153
|
+
- API versioning
|
|
154
|
+
- Rate limiting
|
|
155
|
+
- Authentication/authorization
|
|
156
|
+
- API documentation
|
|
157
|
+
|
|
158
|
+
**Example Projects:**
|
|
159
|
+
- REST APIs
|
|
160
|
+
- GraphQL servers
|
|
161
|
+
- API gateways
|
|
162
|
+
- Backend services
|
|
163
|
+
|
|
164
|
+
**Template:** `templates/api.md`
|
|
165
|
+
|
|
166
|
+
**Examples:** `examples/api/`
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
## Selecting Categories
|
|
171
|
+
|
|
172
|
+
### Single Category
|
|
173
|
+
|
|
174
|
+
```json
|
|
175
|
+
{
|
|
176
|
+
"categories": ["web"]
|
|
177
|
+
}
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
### Multiple Categories
|
|
181
|
+
|
|
182
|
+
```json
|
|
183
|
+
{
|
|
184
|
+
"categories": ["web", "api", "microservices"]
|
|
185
|
+
}
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
## Category Combinations
|
|
189
|
+
|
|
190
|
+
### Common Combinations
|
|
191
|
+
|
|
192
|
+
**Web + API:**
|
|
193
|
+
```json
|
|
194
|
+
{
|
|
195
|
+
"categories": ["web", "api"]
|
|
196
|
+
}
|
|
197
|
+
```
|
|
198
|
+
Best for: REST API servers, web services
|
|
199
|
+
|
|
200
|
+
**Microservices + Distributed:**
|
|
201
|
+
```json
|
|
202
|
+
{
|
|
203
|
+
"categories": ["microservices", "distributed"]
|
|
204
|
+
}
|
|
205
|
+
```
|
|
206
|
+
Best for: Event-driven microservices, distributed systems
|
|
207
|
+
|
|
208
|
+
**CLI + DevOps:**
|
|
209
|
+
```json
|
|
210
|
+
{
|
|
211
|
+
"categories": ["cli", "devops"]
|
|
212
|
+
}
|
|
213
|
+
```
|
|
214
|
+
Best for: Deployment tools, automation scripts
|
|
215
|
+
|
|
216
|
+
## Next Steps
|
|
217
|
+
|
|
218
|
+
- See [CONFIGURATION.md](./CONFIGURATION.md) for configuration details
|
|
219
|
+
- See [README.md](../README.md) for module overview
|
|
220
|
+
- See category-specific rules in `rules/[category]/`
|
|
221
|
+
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
# Configuration Guide
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
The Go Coding Standards module supports flexible configuration to match your project's needs. You can select specific categories, enable/disable rules, and configure static analysis tools.
|
|
6
|
+
|
|
7
|
+
## Configuration File
|
|
8
|
+
|
|
9
|
+
Create a `.augment/go-config.json` file in your project root:
|
|
10
|
+
|
|
11
|
+
```json
|
|
12
|
+
{
|
|
13
|
+
"categories": ["web", "api"],
|
|
14
|
+
"rules": {
|
|
15
|
+
"enabled": true,
|
|
16
|
+
"severity": "error"
|
|
17
|
+
},
|
|
18
|
+
"staticAnalysis": {
|
|
19
|
+
"golangci-lint": true,
|
|
20
|
+
"staticcheck": true,
|
|
21
|
+
"govet": true,
|
|
22
|
+
"gosec": true
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Configuration Options
|
|
28
|
+
|
|
29
|
+
### Categories
|
|
30
|
+
|
|
31
|
+
Select one or more project categories:
|
|
32
|
+
|
|
33
|
+
- **`web`** - Web services and HTTP servers
|
|
34
|
+
- **`microservices`** - gRPC services and microservices
|
|
35
|
+
- **`cli`** - Command-line tools and utilities
|
|
36
|
+
- **`cloud`** - Cloud-native applications (Kubernetes, etc.)
|
|
37
|
+
- **distributed`** - Distributed systems and event-driven architectures
|
|
38
|
+
- **`devops`** - DevOps tooling and automation
|
|
39
|
+
- **`api`** - REST and GraphQL API development
|
|
40
|
+
|
|
41
|
+
**Example:**
|
|
42
|
+
```json
|
|
43
|
+
{
|
|
44
|
+
"categories": ["web", "api"]
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Rules Configuration
|
|
49
|
+
|
|
50
|
+
Control rule enforcement:
|
|
51
|
+
|
|
52
|
+
```json
|
|
53
|
+
{
|
|
54
|
+
"rules": {
|
|
55
|
+
"enabled": true,
|
|
56
|
+
"severity": "error"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
**Options:**
|
|
62
|
+
- `enabled` (boolean): Enable/disable all rules
|
|
63
|
+
- `severity` (string): Default severity level (`error`, `warning`, `info`)
|
|
64
|
+
|
|
65
|
+
### Static Analysis Tools
|
|
66
|
+
|
|
67
|
+
Configure which tools to use:
|
|
68
|
+
|
|
69
|
+
```json
|
|
70
|
+
{
|
|
71
|
+
"staticAnalysis": {
|
|
72
|
+
"golangci-lint": true,
|
|
73
|
+
"staticcheck": true,
|
|
74
|
+
"govet": true,
|
|
75
|
+
"gosec": true
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Category-Specific Configuration
|
|
81
|
+
|
|
82
|
+
### Web Services
|
|
83
|
+
|
|
84
|
+
```json
|
|
85
|
+
{
|
|
86
|
+
"categories": ["web"],
|
|
87
|
+
"web": {
|
|
88
|
+
"framework": "standard-library",
|
|
89
|
+
"middleware": ["logging", "recovery", "cors"],
|
|
90
|
+
"gracefulShutdown": true
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Microservices
|
|
96
|
+
|
|
97
|
+
```json
|
|
98
|
+
{
|
|
99
|
+
"categories": ["microservices"],
|
|
100
|
+
"microservices": {
|
|
101
|
+
"protocol": "grpc",
|
|
102
|
+
"serviceDiscovery": "consul",
|
|
103
|
+
"tracing": "jaeger",
|
|
104
|
+
"metrics": "prometheus"
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### CLI Tools
|
|
110
|
+
|
|
111
|
+
```json
|
|
112
|
+
{
|
|
113
|
+
"categories": ["cli"],
|
|
114
|
+
"cli": {
|
|
115
|
+
"framework": "cobra",
|
|
116
|
+
"configuration": "viper",
|
|
117
|
+
"crossPlatform": true
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## Environment-Specific Configuration
|
|
123
|
+
|
|
124
|
+
### Development
|
|
125
|
+
|
|
126
|
+
```json
|
|
127
|
+
{
|
|
128
|
+
"categories": ["web"],
|
|
129
|
+
"rules": {
|
|
130
|
+
"severity": "warning"
|
|
131
|
+
},
|
|
132
|
+
"staticAnalysis": {
|
|
133
|
+
"golangci-lint": true
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### Production
|
|
139
|
+
|
|
140
|
+
```json
|
|
141
|
+
{
|
|
142
|
+
"categories": ["web", "api"],
|
|
143
|
+
"rules": {
|
|
144
|
+
"severity": "error"
|
|
145
|
+
},
|
|
146
|
+
"staticAnalysis": {
|
|
147
|
+
"golangci-lint": true,
|
|
148
|
+
"staticcheck": true,
|
|
149
|
+
"govet": true,
|
|
150
|
+
"gosec": true
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
## Configuration Schema
|
|
156
|
+
|
|
157
|
+
See `config/schema.json` for the complete JSON Schema definition.
|
|
158
|
+
|
|
159
|
+
## Configuration Examples
|
|
160
|
+
|
|
161
|
+
See `config/examples/` for complete configuration examples:
|
|
162
|
+
|
|
163
|
+
- `web-service.json` - Web service configuration
|
|
164
|
+
- `microservice.json` - Microservice configuration
|
|
165
|
+
- `cli-tool.json` - CLI tool configuration
|
|
166
|
+
- `multi-category.json` - Multiple categories
|
|
167
|
+
|
|
168
|
+
## Validation
|
|
169
|
+
|
|
170
|
+
Validate your configuration:
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
# Using JSON Schema validator
|
|
174
|
+
ajv validate -s config/schema.json -d .augment/go-config.json
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
## Troubleshooting
|
|
178
|
+
|
|
179
|
+
### Configuration Not Loading
|
|
180
|
+
|
|
181
|
+
1. Check file location: `.augment/go-config.json`
|
|
182
|
+
2. Validate JSON syntax
|
|
183
|
+
3. Verify category names match exactly
|
|
184
|
+
4. Check file permissions
|
|
185
|
+
|
|
186
|
+
### Rules Not Applying
|
|
187
|
+
|
|
188
|
+
1. Ensure `rules.enabled` is `true`
|
|
189
|
+
2. Check category selection
|
|
190
|
+
3. Verify rule files exist in `rules/` directory
|
|
191
|
+
4. Check severity level
|
|
192
|
+
|
|
193
|
+
## Next Steps
|
|
194
|
+
|
|
195
|
+
- See [CATEGORIES.md](./CATEGORIES.md) for category details
|
|
196
|
+
- See [TROUBLESHOOTING.md](./TROUBLESHOOTING.md) for common issues
|
|
197
|
+
- See [README.md](../README.md) for module overview
|
|
198
|
+
|