feat: harden SMTP transport
Add explicit TLS modes, context-aware delivery, and typed transport errors. Preserve raw MIME messages and cover the new delivery paths with local SMTP tests.
This commit is contained in:
@@ -1,13 +1,34 @@
|
||||
COVERAGE_DIR=coverage
|
||||
COVERAGE_DIR := coverage
|
||||
|
||||
lint:
|
||||
.PHONY: help fmt fmt-check vet lint test test-race test-coverage check clean
|
||||
|
||||
help: ## Show available targets
|
||||
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf " %-15s %s\n", $$1, $$2}' $(MAKEFILE_LIST)
|
||||
|
||||
fmt: ## Format Go source files
|
||||
gofmt -w .
|
||||
|
||||
fmt-check: ## Check Go source formatting
|
||||
@test -z "$$(gofmt -l .)"
|
||||
|
||||
vet: ## Run Go static analysis
|
||||
go vet ./...
|
||||
|
||||
lint: ## Run golangci-lint
|
||||
golangci-lint run
|
||||
goreportcard:
|
||||
goreportcard-cli -v
|
||||
test:
|
||||
go test ./...
|
||||
test-coverage:
|
||||
rm -rf ${COVERAGE_DIR}
|
||||
mkdir ${COVERAGE_DIR}
|
||||
go test -v -coverprofile ${COVERAGE_DIR}/cover.out ./...
|
||||
go tool cover -html ${COVERAGE_DIR}/cover.out -o ${COVERAGE_DIR}/cover.html
|
||||
|
||||
test: ## Run tests
|
||||
go test ./... -count=1
|
||||
|
||||
test-race: ## Run tests with the race detector
|
||||
go test -race ./... -count=1
|
||||
|
||||
test-coverage: ## Generate an HTML coverage report
|
||||
mkdir -p $(COVERAGE_DIR)
|
||||
go test ./... -count=1 -coverprofile=$(COVERAGE_DIR)/cover.out
|
||||
go tool cover -html=$(COVERAGE_DIR)/cover.out -o $(COVERAGE_DIR)/cover.html
|
||||
|
||||
check: fmt-check vet test test-race lint ## Run all validation checks
|
||||
|
||||
clean: ## Remove generated coverage files
|
||||
rm -rf $(COVERAGE_DIR)
|
||||
|
||||
Reference in New Issue
Block a user