Skip to content

Commit ce9bee9

Browse files
authored
sync: update 9 files from source repository (#34)
1 parent 55c3dca commit ce9bee9

File tree

9 files changed

+93
-43
lines changed

9 files changed

+93
-43
lines changed

.cursorrules

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
All contributors must read `.github/AGENTS.md` for complete guidelines. If any rule here conflicts with that file, **AGENTS.md** takes precedence.
55

66
## Coding Standards
7-
- Format with `go fmt ./...` and `goimports -w .`.
8-
- Lint with `golangci-lint run` and vet with `go vet ./...`.
9-
- Run `go test ./...` before committing.
7+
- Format with `magex format:fix`.
8+
- Lint with `magex lint` and vet with `magex vet`.
9+
- Run `magex test` before committing.
1010
- Follow Go naming and commenting conventions described in AGENTS.md.
1111

1212
## Commit Messages
@@ -22,8 +22,7 @@ All contributors must read `.github/AGENTS.md` for complete guidelines. If any r
2222
4. **Impact / Risk**
2323

2424
## Dependency Management
25-
- Manage modules with `go mod tidy` after import changes.
26-
- Run `make govulncheck` to check for vulnerabilities when dependencies change.
25+
- Manage modules with `magex tidy` after import changes.
2726

2827
## Security Reporting
2928
- Do not open public issues for vulnerabilities.

.devcontainer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"settings": {
1010
"editor.codeActionsOnSave": {
11-
"source.organizeImports": true
11+
"source.organizeImports": "explicit"
1212
},
1313
"editor.formatOnSave": true,
1414
"go.lintTool": "golangci-lint",
@@ -29,7 +29,7 @@
2929
"type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock"
3030
],
3131
"name": "go-subtree dev container",
32-
"postCreateCommand": "make lint && go vet ./... && go test ./...",
32+
"postCreateCommand": "magex lint && magex vet && magex test",
3333
"remoteUser": "vscode",
3434
"runArgs": [
3535
"--cap-drop=ALL",

.dockerignore

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,20 @@ __pycache__/
5454
.LSOverride
5555
._*
5656

57-
# Custom repo notes
58-
todo.md
59-
6057
# Temporary directories in the project
6158
bin
6259
tmp
63-
.golangci.yml
60+
61+
# Project files not needed in the container
62+
.cursorrules
63+
.editorconfig
64+
.github
65+
.gitpod.yml
6466
.golangci.json
67+
.golangci.yml
6568
.goreleaser.yml
66-
.editorconfig
67-
codecov.yml
69+
.vscode
70+
docs
6871
LICENSE
6972
README.md
73+
codecov.yml

.github/.env.base

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ REDIS_CACHE_FORCE_PULL=false # Force pull Redis images even when cache
225225
# 🪄 MAGE-X CONFIGURATION
226226
# ================================================================================================
227227

228-
MAGE_X_VERSION=v1.7.2 # https://github.com/mrz1836/mage-x/releases
228+
MAGE_X_VERSION=v1.7.5 # https://github.com/mrz1836/mage-x/releases
229229
MAGE_X_AUTO_DISCOVER_BUILD_TAGS=true # Enable auto-discovery of build tags
230230
MAGE_X_AUTO_DISCOVER_BUILD_TAGS_EXCLUDE=race,custom # Comma-separated list of tags to exclude
231231
MAGE_X_FORMAT_EXCLUDE_PATHS=vendor,node_modules,.git,.idea # Format exclusion paths (comma-separated directories to exclude from formatting)

.github/workflows/codeql-analysis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747

4848
# Initializes the CodeQL tools for scanning.
4949
- name: Initialize CodeQL
50-
uses: github/codeql-action/init@e296a935590eb16afc0c0108289f68c87e2a89a5 # v3.29.5
50+
uses: github/codeql-action/init@64d10c13136e1c5bce3e5fbde8d4906eeaafc885 # v3.29.5
5151
with:
5252
languages: ${{ matrix.language }}
5353
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -58,7 +58,7 @@ jobs:
5858
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5959
# If this step fails, then you should remove it and run the build manually (see below)
6060
- name: Autobuild
61-
uses: github/codeql-action/autobuild@e296a935590eb16afc0c0108289f68c87e2a89a5 # v3.29.5
61+
uses: github/codeql-action/autobuild@64d10c13136e1c5bce3e5fbde8d4906eeaafc885 # v3.29.5
6262

6363
# ℹ️ Command-line programs to run using the OS shell.
6464
# 📚 https://git.io/JvXDl
@@ -68,4 +68,4 @@ jobs:
6868
# uses a compiled language
6969

7070
- name: Perform CodeQL Analysis
71-
uses: github/codeql-action/analyze@e296a935590eb16afc0c0108289f68c87e2a89a5 # v3.29.5
71+
uses: github/codeql-action/analyze@64d10c13136e1c5bce3e5fbde8d4906eeaafc885 # v3.29.5

.github/workflows/scorecard.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,6 @@ jobs:
7878
# Upload the results to GitHub's code scanning dashboard (optional).
7979
# Commenting out will disable the upload of results to your repo's Code Scanning dashboard
8080
- name: "Upload to code-scanning"
81-
uses: github/codeql-action/upload-sarif@e296a935590eb16afc0c0108289f68c87e2a89a5 # v3.29.5
81+
uses: github/codeql-action/upload-sarif@64d10c13136e1c5bce3e5fbde8d4906eeaafc885 # v3.29.5
8282
with:
8383
sarif_file: results.sarif

.gitpod.yml

Lines changed: 39 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,54 @@
1-
# Gitpod workspace configuration for the local repository.
2-
# This file creates a repeatable cloud development environment.
3-
# It ensures dependencies are installed and the codebase is vetted
4-
# and tested on workspace start.
1+
# Gitpod workspace configuration for go-subtree
2+
# Uses magex for build automation and development tasks
3+
# This creates a one-click development environment for contributors
54

6-
image:
7-
name: gitpod/workspace-full:1.0.0
5+
image: gitpod/workspace-go:latest
86

97
tasks:
108
- name: setup-and-test
119
init: |
12-
echo "Downloading Go modules..."
13-
go mod download
14-
go mod tidy
15-
# Install goimports if not present
16-
if ! command -v goimports >/dev/null; then
17-
go install golang.org/x/tools/cmd/goimports@latest
18-
fi
19-
go fmt ./...
20-
goimports -w .
21-
golangci-lint run
22-
go vet ./...
10+
echo "🚀 Setting up go-subtree development environment..."
11+
echo "📦 Installing MAGE-X build tool..."
12+
go install github.com/mrz1836/mage-x/cmd/magex@latest
13+
14+
echo "📥 Downloading dependencies..."
15+
magex deps:download
16+
17+
echo "🔧 Initial build..."
18+
magex build
19+
20+
echo "✅ Running initial tests..."
21+
magex test
22+
2323
command: |
24-
go test ./...
24+
echo "==============================================="
25+
echo "🎯 Welcome to go-subtree development!"
26+
echo "==============================================="
27+
echo ""
28+
echo "🛠️ Available magex commands:"
29+
echo " magex test - Run all tests"
30+
echo " magex lint - Run linters"
31+
echo " magex format:fix - Format code"
32+
echo " magex build - Build the project"
33+
echo " magex help - List all available commands"
34+
echo ""
35+
echo "📖 Quick start:"
36+
echo " 1. Try: magex test"
37+
echo " 2. Make your changes"
38+
echo " 3. Run: magex format:fix && magex lint && magex test"
39+
echo " 4. Commit and push your changes"
40+
echo ""
41+
echo "💡 For more help: magex help"
42+
echo "==============================================="
2543
2644
ports:
2745
- port: 8080
28-
onOpen: open-preview
29-
description: Application
46+
onOpen: ignore
47+
description: Application (if needed)
3048

3149
vscode:
3250
extensions:
3351
- golang.go
3452
- github.vscode-pull-request-github
3553
- streetsidesoftware.code-spell-checker
54+
- eamodio.gitlens

.goreleaser.yml

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@ version: 2
66

77
before:
88
hooks:
9-
- make test
9+
- sh -c 'if [ "$SKIP_GORELEASER_TESTS" = "true" ]; then echo "Skipping tests (SKIP_GORELEASER_TESTS=true)"; else magex test; fi'
1010
changelog:
1111
sort: asc
1212
filters:
1313
exclude:
14-
- "^.github:"
1514
- "^.vscode:"
1615
- "^test:"
1716

@@ -27,6 +26,24 @@ builds:
2726
- darwin
2827
skip: true
2928

29+
# ---------------------------
30+
# Archives
31+
# ---------------------------
32+
archives:
33+
- id: go-subtree
34+
name_template: >-
35+
{{- .ProjectName }}_{{- .Version }}_{{- .Os }}_{{- .Arch }}
36+
files:
37+
- LICENSE
38+
- README.md
39+
40+
# ---------------------------
41+
# Checksum
42+
# ---------------------------
43+
checksum:
44+
name_template: "{{ .ProjectName }}_{{ .Version }}_checksums.txt"
45+
algorithm: sha256
46+
3047
# ---------------------------
3148
# Github Release
3249
# ---------------------------
@@ -41,7 +58,7 @@ announce:
4158
# See more at: https://goreleaser.com/customization/announce/#slack
4259
slack:
4360
enabled: false
44-
message_template: "{{ .ProjectName }} {{ .Tag }} is out! Changelog: https://github.com/bsv-blockchain/{{ .ProjectName }}/releases/tag/{{ .Tag }}"
61+
message_template: "{{ .ProjectName }} {{ .Tag }} is out! Changelog: https://github.com/{{ .GitOwner }}/{{ .ProjectName }}/releases/tag/{{ .Tag }}"
4562
channel: "#test_slack"
4663
# username: ''
4764
# icon_emoji: ''
@@ -71,6 +88,6 @@ announce:
7188
# Username for your Reddit account
7289
username: ""
7390
# Defaults to `{{ .GitURL }}/releases/tag/{{ .Tag }}`
74-
# url_template: 'https://github.com/bsv-blockchain/{{ .ProjectName }}/releases/tag/{{ .Tag }}'
91+
# url_template: 'https://github.com/{{ .GitOwner }}/{{ .ProjectName }}/releases/tag/{{ .Tag }}'
7592
# Defaults to `{{ .ProjectName }} {{ .Tag }} is out!`
7693
title_template: "{{ .ProjectName }} {{ .Tag }} is out!"

codecov.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,24 @@ coverage:
1313
round: down # up, down, or nearest
1414
precision: 2 # Number of decimal places, between 0 and 5
1515

16+
# Flag Management - Simple carryforward for everything
17+
# ----------------------
18+
flag_management:
19+
default_rules:
20+
carryforward: true # This keeps coverage from previous uploads
21+
statuses:
22+
- type: project
23+
target: auto
24+
threshold: 2%
25+
1626
# Ignoring Paths
1727
# --------------
1828
# which folders/files to ignore
1929
ignore:
2030
- ".github/**"
21-
- ".make/**"
31+
- ".mage-cache/**"
2232
- ".vscode/**"
33+
- "bin/**"
2334
- "examples/**"
2435

2536
# Parsers

0 commit comments

Comments
 (0)