From 1abd030c0e4f356275c2e0c1f786e62fa0e63aef Mon Sep 17 00:00:00 2001 From: Seth Hoenig Date: Sun, 22 Dec 2024 09:12:11 -0600 Subject: [PATCH] repo: migration and updates for 2025 --- .github/dependabot.yaml | 17 +++++++++ .github/workflows/ci.yaml | 19 +++++----- .github/workflows/scripts/copywrite.hcl | 4 +-- .github/workflows/scripts/golangci.yaml | 2 +- .gitignore | 28 +++++++-------- Justfile | 47 +++++++++++++++++++++++++ Makefile | 26 -------------- README.md | 21 ++++++----- go.mod | 4 +-- 9 files changed, 101 insertions(+), 67 deletions(-) create mode 100644 .github/dependabot.yaml create mode 100644 Justfile delete mode 100644 Makefile diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml new file mode 100644 index 0000000..44db944 --- /dev/null +++ b/.github/dependabot.yaml @@ -0,0 +1,17 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directories: + - "/" + schedule: + interval: "monthly" + labels: + - "dependencies" + - package-ecosystem: "gomod" + directories: + - "/" + schedule: + interval: "monthly" + labels: + - "dependencies" + diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 2613067..fe0f0af 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -16,25 +16,22 @@ jobs: - uses: hashicorp/setup-copywrite@v1.1.3 - name: verify copyright run: | - copywrite --config=.github/workflows/scripts/copywrite.hcl \ + copywrite --config .github/workflows/scripts/copywrite.hcl \ headers --spdx "BSD-3-Clause" --plan - run-lint: - timeout-minutes: 5 - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v4 - - uses: golangci/golangci-lint-action@v6 - with: - version: v1.60.3 - args: --config .github/workflows/scripts/golangci.yaml run-tests: runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 + - uses: extractions/setup-just@v2 - uses: actions/setup-go@v5 with: go-version-file: go.mod cache-dependency-path: '**/go.sum' + - name: Show System + run: | + uname -a + just sysinfo - name: Run Go Test run: | - make test + just init tidy lint test + diff --git a/.github/workflows/scripts/copywrite.hcl b/.github/workflows/scripts/copywrite.hcl index cb051af..2ee1ec8 100644 --- a/.github/workflows/scripts/copywrite.hcl +++ b/.github/workflows/scripts/copywrite.hcl @@ -2,8 +2,8 @@ schema_version = 1 project { license = "BSD-3-Clause" - copyright_holder = "NOXIDE.LOL" - copyright_year = 2023 + copyright_holder = "CattleCloud LLC" + copyright_year = 2024 header_ignore = [ ".golangci.yaml", ".copywrite.hcl", diff --git a/.github/workflows/scripts/golangci.yaml b/.github/workflows/scripts/golangci.yaml index 5c00f77..dfa19b8 100644 --- a/.github/workflows/scripts/golangci.yaml +++ b/.github/workflows/scripts/golangci.yaml @@ -6,6 +6,7 @@ linters: - asciicheck - bidichk - bodyclose + - copyloopvar - dogsled - dupword - durationcheck @@ -13,7 +14,6 @@ linters: - errname - errorlint - exhaustive - - exportloopref - gochecknoinits - gocritic - gofmt diff --git a/.gitignore b/.gitignore index 3b735ec..5f40696 100644 --- a/.gitignore +++ b/.gitignore @@ -1,21 +1,17 @@ -# If you prefer the allow list template instead of the deny list, see community template: -# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore -# -# Binaries for programs and plugins -*.exe -*.exe~ -*.dll -*.so -*.dylib +*~ +~* -# Test binary, built with `go test -c` -*.test +# OS files +**/.DS_Store -# Output of the go coverage tool, specifically when used with LiteIDE -*.out - -# Dependency directories (remove the comment below to include it) -# vendor/ +# Build artifacts +site # Go workspace file go.work +go.work.sum + +# Local source and binary files +.src/ +.bin/ + diff --git a/Justfile b/Justfile new file mode 100644 index 0000000..dc2573e --- /dev/null +++ b/Justfile @@ -0,0 +1,47 @@ +set shell := ["bash", "-u", "-c"] + +export scripts := ".github/workflows/scripts" +export GOBIN := `echo $PWD/.bin` + +# show available commands +[private] +default: + @just --list + +# tidy up Go modules +[group('build')] +tidy: + go mod tidy + +# run tests across source tree +[group('build')] +test: + go test -v -race -count=1 ./... + +# ensure copywrite headers present on source files +[group('lint')] +copywrite: + copywrite \ + --config {{scripts}}/copywrite.hcl headers \ + --spdx "BSD-3-Clause" + +# apply go vet command on source tree +[group('lint')] +vet: + go vet ./... + +# apply golangci-lint linters on source tree +[group('lint')] +lint: vet + $GOBIN/golangci-lint run --config .github/workflows/scripts/golangci.yaml + +# show host system information +[group('build')] +@sysinfo: + echo "{{os()/arch()}} {{num_cpus()}}c" + +# locally install build dependencies +[group('build')] +init: + go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.62.2 + diff --git a/Makefile b/Makefile deleted file mode 100644 index b9e48b4..0000000 --- a/Makefile +++ /dev/null @@ -1,26 +0,0 @@ -SHELL = sh - -default: test - -.PHONY: test -test: vet - @echo "==> Running Tests ..." - @go test -count=1 -v -race ./... - -.PHONY: copywrite -copywrite: - @echo "==> Checking Copywrite ..." - copywrite \ - --config .github/workflows/scripts/copywrite.hcl headers \ - --spdx "BSD-3-Clause" - -.PHONY: vet -vet: - @echo "==> Vet Go sources ..." - @go vet ./... - -.PHONY: lint -lint: vet - @echo "==> Lint ..." - @golangci-lint run \ - --config .github/workflows/scripts/golangci.yaml diff --git a/README.md b/README.md index a14e3c4..ee35750 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,26 @@ -# xtc +# scope -[![Go Reference](https://pkg.go.dev/badge/noxide.lol/go/xtc.svg)](https://pkg.go.dev/noxide.lol/go/xtc) -[![License](https://img.shields.io/github/license/noxideproject/xtc?color=7C00D8&style=flat-square&label=License)](https://github.com/noxideproject/xtc/blob/main/LICENSE) -[![Build](https://img.shields.io/github/actions/workflow/status/noxideproject/xtc/ci.yaml?style=flat-square&color=0FAA07&label=Tests)](https://github.com/noxideproject/xtc/actions/workflows/ci.yaml) +[![Go Reference](https://pkg.go.dev/badge/cattlecloud.net/go/scope.svg)](https://pkg.go.dev/cattlecloud.net/go/scope) +[![License](https://img.shields.io/github/license/cattlecloud/scope?color=7C00D8&style=flat-square&label=License)](https://github.com/cattlecloud/scope/blob/main/LICENSE) +[![Build](https://img.shields.io/github/actions/workflow/status/cattlecloud/scope/ci.yaml?style=flat-square&color=0FAA07&label=Tests)](https://github.com/cattlecloud/scope/actions/workflows/ci.yaml) -`xtc` is a substitute for the Go context package. +`scope` is a substitute for the Go context package. + +It provides a more convenient context API than the standard library, while +maintaining 100% compatibility. ### Requirements -The minimum Go version is `go1.21`. +The minimum Go version is `go1.23`. ### Install -Use `go get` to grab the latest version of `xtc`. +The `forms` package can be added to a project with `go get`. ```shell -go get -u noxide.lol/go/xtc@latest +go get -u cattlecloud.net/go/scope@latest ``` ### License -Open source under the [BSD-3-Clause](LICENSE) +The `cattlecloud.net/go/scope` module is open source under the [BSD](LICENSE) license. diff --git a/go.mod b/go.mod index 5376457..9f929c5 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,3 @@ -module noxide.lol/go/xtc +module cattlecloud.net/go/scope -go 1.21 +go 1.23