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
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -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
86 changes: 86 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -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"
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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 .
```
Expand Down Expand Up @@ -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 ./...
```

Expand Down
2 changes: 1 addition & 1 deletion fixer/fixer.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"path/filepath"
"strings"

"github.com/unsaid-dev/goperf/rules"
"github.com/cschuman/goperf/rules"
)

// Fix represents a suggested change
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/unsaid-dev/goperf
module github.com/cschuman/goperf

go 1.21

Expand Down
17 changes: 11 additions & 6 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
"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
Expand All @@ -21,7 +21,12 @@
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()
Expand Down Expand Up @@ -112,7 +117,7 @@
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)
}

Expand Down Expand Up @@ -391,7 +396,7 @@
Low int `json:"low"`
}

func toJSON(issues []rules.Issue) string {

Check failure on line 399 in main.go

View workflow job for this annotation

GitHub Actions / lint

func `toJSON` is unused (unused)
summary := Summary{Total: len(issues)}
for _, issue := range issues {
switch issue.Severity {
Expand Down
2 changes: 1 addition & 1 deletion reporter/console.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"path/filepath"
"strings"

"github.com/unsaid-dev/goperf/rules"
"github.com/cschuman/goperf/rules"
)

// ConsoleReporter outputs human-readable reports
Expand Down
2 changes: 1 addition & 1 deletion reporter/json.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion reporter/reporter.go
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
Loading