Skip to content
Open
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
632 changes: 632 additions & 0 deletions CONTRIBUTING.md

Large diffs are not rendered by default.

50 changes: 39 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,44 @@
# Makefile
# Makefile for StackGuardian Go SDK

.PHONY: all build test fmt vet lint clean

# Default target
all: fmt vet build

# Format the Go SDK code
format:
fmt:
gofmt -w .
goimports -w .

# Apply git patches in order
# Any new patches are to be added at the end of this block
apply-patch:
git apply gitPatches/basePatch-workflowGroups.patch
git apply gitPatches/basePatch-UnmashalJSON-Optional.patch
git apply gitPatches/basePatch-optional-for-patched-policies.patch
git apply gitPatches/basePatch-optional-for-patched-integration.patch
# Build target to format and apply patches in sequence
build: format apply-patch
# Run go vet
vet:
go vet ./...

# Build the SDK (verify compilation)
build:
go build ./...

# Run tests
test:
go test -v -race -cover ./...

# Run linter (requires golangci-lint)
lint:
golangci-lint run

# Clean build artifacts
clean:
go clean ./...
rm -rf dist/

# Install development dependencies
install-dev-tools:
go install golang.org/x/tools/cmd/goimports@latest
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest

# Run examples (requires SG_API_TOKEN environment variable)
run-example-basic:
go run examples/basic/main.go

run-example-workflow:
go run examples/workflow_run/main.go
Loading