diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 5d496d3..a8ca473 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,8 +1,8 @@ blank_issues_enabled: true contact_links: - name: Questions & Discussions - url: https://github.com/unsaid-dev/goperf/discussions + url: https://github.com/cschuman/goperf/discussions about: Ask questions and discuss goperf usage - name: Security Issues - url: https://github.com/unsaid-dev/goperf/blob/main/SECURITY.md + url: https://github.com/cschuman/goperf/blob/main/SECURITY.md about: Report security vulnerabilities privately diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..3954e58 --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,86 @@ +# GoReleaser configuration for goperf +# Documentation: https://goreleaser.com + +version: 2 + +before: + hooks: + - go mod tidy + - go generate ./... + +builds: + - id: goperf + main: . + binary: goperf + env: + - CGO_ENABLED=0 + goos: + - linux + - darwin + - windows + goarch: + - amd64 + - arm64 + ldflags: + - -s -w + - -X main.version={{.Version}} + - -X main.commit={{.Commit}} + - -X main.date={{.Date}} + +archives: + - id: default + formats: + - tar.gz + format_overrides: + - goos: windows + formats: + - zip + name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}" + files: + - LICENSE + - README.md + - CHANGELOG.md + - docs/RULES.md + - .goperf.yml.example + +checksum: + name_template: "checksums.txt" + +snapshot: + version_template: "{{ incpatch .Version }}-next" + +changelog: + sort: asc + filters: + exclude: + - "^docs:" + - "^test:" + - "^chore:" + - Merge pull request + - Merge branch + +release: + github: + owner: cschuman + name: goperf + draft: false + prerelease: auto + name_template: "v{{.Version}}" + +brews: + - name: goperf + repository: + owner: cschuman + name: homebrew-tap + commit_author: + name: goreleaser + email: goreleaser@example.com + directory: Formula + homepage: "https://github.com/cschuman/goperf" + description: "Preventive performance analysis for Go" + license: "MIT" + skip_upload: true # Enable when homebrew-tap repo exists + test: | + system "#{bin}/goperf", "--version" + install: | + bin.install "goperf" diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5a5934b..4472709 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -156,8 +156,8 @@ git push origin v0.2.0 ## Getting Help -- **Questions**: Open a [Discussion](https://github.com/unsaid-dev/goperf/discussions) -- **Bugs**: Open an [Issue](https://github.com/unsaid-dev/goperf/issues) +- **Questions**: Open a [Discussion](https://github.com/cschuman/goperf/discussions) +- **Bugs**: Open an [Issue](https://github.com/cschuman/goperf/issues) - **Security**: See [SECURITY.md](SECURITY.md) ## License diff --git a/README.md b/README.md index 7d393e7..9376de5 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,8 @@ **Preventive performance analysis for Go** - Catch O(n²) loops, N+1 queries, and other performance anti-patterns before they hit production. [![Go Version](https://img.shields.io/badge/Go-1.21+-00ADD8?style=flat&logo=go)](https://go.dev) -[![Go Report Card](https://goreportcard.com/badge/github.com/unsaid-dev/goperf)](https://goreportcard.com/report/github.com/unsaid-dev/goperf) -[![GoDoc](https://pkg.go.dev/badge/github.com/unsaid-dev/goperf)](https://pkg.go.dev/github.com/unsaid-dev/goperf) +[![Go Report Card](https://goreportcard.com/badge/github.com/cschuman/goperf)](https://goreportcard.com/report/github.com/cschuman/goperf) +[![GoDoc](https://pkg.go.dev/badge/github.com/cschuman/goperf)](https://pkg.go.dev/github.com/cschuman/goperf) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md) @@ -21,12 +21,12 @@ Most performance tools are **reactive** - they tell you what's slow after it's i ## Installation ```bash -go install github.com/unsaid-dev/goperf@latest +go install github.com/cschuman/goperf@latest ``` Or build from source: ```bash -git clone https://github.com/unsaid-dev/goperf.git +git clone https://github.com/cschuman/goperf.git cd goperf go build -o goperf . ``` @@ -115,7 +115,7 @@ jobs: - uses: actions/setup-go@v5 with: go-version: '1.21' - - run: go install github.com/unsaid-dev/goperf@latest + - run: go install github.com/cschuman/goperf@latest - run: goperf --fail-on=high ./... ``` diff --git a/fixer/fixer.go b/fixer/fixer.go index fbd54d1..f4ec47e 100644 --- a/fixer/fixer.go +++ b/fixer/fixer.go @@ -10,7 +10,7 @@ import ( "path/filepath" "strings" - "github.com/unsaid-dev/goperf/rules" + "github.com/cschuman/goperf/rules" ) // Fix represents a suggested change diff --git a/go.mod b/go.mod index 4d9bf85..fe3dff2 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/unsaid-dev/goperf +module github.com/cschuman/goperf go 1.21 diff --git a/main.go b/main.go index 90efe6c..02798eb 100644 --- a/main.go +++ b/main.go @@ -8,10 +8,10 @@ import ( "path/filepath" "strings" - "github.com/unsaid-dev/goperf/config" - "github.com/unsaid-dev/goperf/fixer" - "github.com/unsaid-dev/goperf/reporter" - "github.com/unsaid-dev/goperf/rules" + "github.com/cschuman/goperf/config" + "github.com/cschuman/goperf/fixer" + "github.com/cschuman/goperf/reporter" + "github.com/cschuman/goperf/rules" ) // Resource limits to prevent DoS @@ -21,7 +21,12 @@ const ( MaxDirectoryDepth = 50 ) -var version = "0.1.0" +// Build info (set by goreleaser via ldflags) +var ( + version = "dev" + commit = "none" + date = "unknown" +) func main() { cfg, err := config.LoadConfig() @@ -112,7 +117,7 @@ Fix Suggestion Support: flag.Parse() if *versionFlag { - fmt.Printf("goperf version %s\n", version) + fmt.Printf("goperf %s (commit: %s, built: %s)\n", version, commit, date) os.Exit(0) } diff --git a/reporter/console.go b/reporter/console.go index 1e0ed94..2549e39 100644 --- a/reporter/console.go +++ b/reporter/console.go @@ -5,7 +5,7 @@ import ( "path/filepath" "strings" - "github.com/unsaid-dev/goperf/rules" + "github.com/cschuman/goperf/rules" ) // ConsoleReporter outputs human-readable reports diff --git a/reporter/json.go b/reporter/json.go index 8d994b5..31bcb88 100644 --- a/reporter/json.go +++ b/reporter/json.go @@ -3,7 +3,7 @@ package reporter import ( "encoding/json" - "github.com/unsaid-dev/goperf/rules" + "github.com/cschuman/goperf/rules" ) // JSONReporter outputs machine-readable JSON diff --git a/reporter/reporter.go b/reporter/reporter.go index 18bed36..da4bb8a 100644 --- a/reporter/reporter.go +++ b/reporter/reporter.go @@ -1,6 +1,6 @@ package reporter -import "github.com/unsaid-dev/goperf/rules" +import "github.com/cschuman/goperf/rules" // Reporter formats and outputs issues type Reporter interface {