merge: phase 0 scaffolding into main
This commit is contained in:
commit
48c6438ae7
37
.github/workflows/ci.yml
vendored
Normal file
37
.github/workflows/ci.yml
vendored
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
name: Test (Go ${{ matrix.go }})
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
go: ["1.24", "1.26"]
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: actions/setup-go@v5
|
||||||
|
with:
|
||||||
|
go-version: ${{ matrix.go }}
|
||||||
|
- name: Build
|
||||||
|
run: go build ./...
|
||||||
|
- name: Vet
|
||||||
|
run: go vet ./...
|
||||||
|
- name: Test
|
||||||
|
run: go test -race ./...
|
||||||
|
|
||||||
|
lint:
|
||||||
|
name: Lint
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: actions/setup-go@v5
|
||||||
|
with:
|
||||||
|
go-version: "1.26"
|
||||||
|
- uses: golangci/golangci-lint-action@v6
|
||||||
|
with:
|
||||||
|
version: latest
|
||||||
17
.gitignore
vendored
Normal file
17
.gitignore
vendored
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
# Binaries and build artifacts
|
||||||
|
/gitflow
|
||||||
|
/dist/
|
||||||
|
*.exe
|
||||||
|
|
||||||
|
# Test artifacts
|
||||||
|
*.test
|
||||||
|
coverage.out
|
||||||
|
|
||||||
|
# Editor / OS cruft
|
||||||
|
.DS_Store
|
||||||
|
.idea/
|
||||||
|
.vscode/
|
||||||
|
*.swp
|
||||||
|
|
||||||
|
# Local config overrides (never commit personal settings)
|
||||||
|
.gitflow.local.yaml
|
||||||
24
.golangci.yml
Normal file
24
.golangci.yml
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
# golangci-lint configuration for gitflow.
|
||||||
|
# Docs: https://golangci-lint.run/usage/configuration/
|
||||||
|
|
||||||
|
run:
|
||||||
|
timeout: 5m
|
||||||
|
|
||||||
|
linters:
|
||||||
|
enable:
|
||||||
|
- errcheck # unchecked errors
|
||||||
|
- govet # go vet
|
||||||
|
- staticcheck # static analysis
|
||||||
|
- gosimple # simplify code
|
||||||
|
- ineffassign # ineffective assignments
|
||||||
|
- unused # unused declarations
|
||||||
|
- misspell # typos in comments/strings
|
||||||
|
- gofmt # formatting
|
||||||
|
- goimports # import grouping
|
||||||
|
|
||||||
|
issues:
|
||||||
|
exclude-rules:
|
||||||
|
# Tests may use underscores to match fixture naming.
|
||||||
|
- path: _test\.go
|
||||||
|
linters:
|
||||||
|
- errcheck
|
||||||
35
Makefile
Normal file
35
Makefile
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
BINARY := gitflow
|
||||||
|
MODULE := gitea.oblak.solutions/dimitar/gitFlow
|
||||||
|
VERSION ?= dev
|
||||||
|
LDFLAGS := -ldflags "-X $(MODULE)/internal/version.Version=$(VERSION)"
|
||||||
|
|
||||||
|
.PHONY: build test fmt vet lint install clean
|
||||||
|
|
||||||
|
## build: compile the gitflow binary into the repo root
|
||||||
|
build:
|
||||||
|
go build $(LDFLAGS) -o $(BINARY) ./cmd/gitflow
|
||||||
|
|
||||||
|
## test: run the full test suite
|
||||||
|
test:
|
||||||
|
go test ./...
|
||||||
|
|
||||||
|
## fmt: format all Go sources
|
||||||
|
fmt:
|
||||||
|
gofmt -l -w .
|
||||||
|
|
||||||
|
## vet: run go vet over all packages
|
||||||
|
vet:
|
||||||
|
go vet ./...
|
||||||
|
|
||||||
|
## lint: run golangci-lint (requires golangci-lint on PATH)
|
||||||
|
lint:
|
||||||
|
golangci-lint run
|
||||||
|
|
||||||
|
## install: install gitflow into GOBIN
|
||||||
|
install:
|
||||||
|
go install $(LDFLAGS) ./cmd/gitflow
|
||||||
|
|
||||||
|
## clean: remove build artifacts
|
||||||
|
clean:
|
||||||
|
rm -f $(BINARY)
|
||||||
|
rm -f coverage.out
|
||||||
16
cmd/gitflow/main.go
Normal file
16
cmd/gitflow/main.go
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
// Command gitflow is a CLI tool that discovers Git repositories under a
|
||||||
|
// user-specified parent directory, scans their status, and presents findings
|
||||||
|
// with AI-driven suggestions for next actions.
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
|
||||||
|
"gitea.oblak.solutions/dimitar/gitFlow/internal/version"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
fmt.Printf("gitflow %s\n", version.Version)
|
||||||
|
os.Exit(0)
|
||||||
|
}
|
||||||
8
internal/version/version.go
Normal file
8
internal/version/version.go
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
// Package version exposes build metadata for the gitflow binary.
|
||||||
|
package version
|
||||||
|
|
||||||
|
// Version is the semantic version of the binary. It can be overridden at
|
||||||
|
// build time with:
|
||||||
|
//
|
||||||
|
// go build -ldflags "-X gitea.oblak.solutions/dimitar/gitFlow/internal/version.Version=v1.2.3" ./cmd/gitflow
|
||||||
|
var Version = "dev"
|
||||||
Loading…
Reference in New Issue
Block a user