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
9 changes: 4 additions & 5 deletions .cursorrules
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
All contributors must read `.github/AGENTS.md` for complete guidelines. If any rule here conflicts with that file, **AGENTS.md** takes precedence.

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

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

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

## Security Reporting
- Do not open public issues for vulnerabilities.
Expand Down
4 changes: 2 additions & 2 deletions .devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"settings": {
"editor.codeActionsOnSave": {
"source.organizeImports": true
"source.organizeImports": "explicit"
},
"editor.formatOnSave": true,
"go.lintTool": "golangci-lint",
Expand All @@ -29,7 +29,7 @@
"type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock"
],
"name": "go-tx-map dev container",
"postCreateCommand": "make lint && go vet ./... && go test ./...",
"postCreateCommand": "magex lint && magex vet && magex test",
"remoteUser": "vscode",
"runArgs": [
"--cap-drop=ALL",
Expand Down
16 changes: 10 additions & 6 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,20 @@ __pycache__/
.LSOverride
._*

# Custom repo notes
todo.md

# Temporary directories in the project
bin
tmp
.golangci.yml

# Project files not needed in the container
.cursorrules
.editorconfig
.github
.gitpod.yml
.golangci.json
.golangci.yml
.goreleaser.yml
.editorconfig
codecov.yml
.vscode
docs
LICENSE
README.md
codecov.yml
2 changes: 1 addition & 1 deletion .github/.env.base
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ REDIS_CACHE_FORCE_PULL=false # Force pull Redis images even when cache
# 🪄 MAGE-X CONFIGURATION
# ================================================================================================

MAGE_X_VERSION=v1.7.2 # https://github.com/mrz1836/mage-x/releases
MAGE_X_VERSION=v1.7.5 # https://github.com/mrz1836/mage-x/releases
MAGE_X_AUTO_DISCOVER_BUILD_TAGS=true # Enable auto-discovery of build tags
MAGE_X_AUTO_DISCOVER_BUILD_TAGS_EXCLUDE=race,custom # Comma-separated list of tags to exclude
MAGE_X_FORMAT_EXCLUDE_PATHS=vendor,node_modules,.git,.idea # Format exclusion paths (comma-separated directories to exclude from formatting)
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:

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

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

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@e296a935590eb16afc0c0108289f68c87e2a89a5 # v3.29.5
uses: github/codeql-action/analyze@64d10c13136e1c5bce3e5fbde8d4906eeaafc885 # v3.29.5
2 changes: 1 addition & 1 deletion .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,6 @@ jobs:
# Upload the results to GitHub's code scanning dashboard (optional).
# Commenting out will disable the upload of results to your repo's Code Scanning dashboard
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@e296a935590eb16afc0c0108289f68c87e2a89a5 # v3.29.5
uses: github/codeql-action/upload-sarif@64d10c13136e1c5bce3e5fbde8d4906eeaafc885 # v3.29.5
with:
sarif_file: results.sarif
63 changes: 43 additions & 20 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,54 @@
# Gitpod workspace configuration for the local repository.
# This file creates a repeatable cloud development environment.
# It ensures dependencies are installed and the codebase is vetted
# and tested on workspace start.
image:
name: gitpod/workspace-full:1.0.0
# Gitpod workspace configuration for go-tx-map
# Uses magex for build automation and development tasks
# This creates a one-click development environment for contributors

image: gitpod/workspace-go:latest

tasks:
- name: setup-and-test
init: |
echo "Downloading Go modules..."
go mod download
go mod tidy
# Install goimports if not present
if ! command -v goimports >/dev/null; then
go install golang.org/x/tools/cmd/goimports@latest
fi
go fmt ./...
goimports -w .
golangci-lint run
go vet ./...
echo "🚀 Setting up go-tx-map development environment..."
echo "📦 Installing MAGE-X build tool..."
go install github.com/mrz1836/mage-x/cmd/magex@latest

echo "📥 Downloading dependencies..."
magex deps:download

echo "🔧 Initial build..."
magex build

echo "✅ Running initial tests..."
magex test

command: |
go test ./...
echo "==============================================="
echo "🎯 Welcome to go-tx-map development!"
echo "==============================================="
echo ""
echo "🛠️ Available magex commands:"
echo " magex test - Run all tests"
echo " magex lint - Run linters"
echo " magex format:fix - Format code"
echo " magex build - Build the project"
echo " magex help - List all available commands"
echo ""
echo "📖 Quick start:"
echo " 1. Try: magex test"
echo " 2. Make your changes"
echo " 3. Run: magex format:fix && magex lint && magex test"
echo " 4. Commit and push your changes"
echo ""
echo "💡 For more help: magex help"
echo "==============================================="

ports:
- port: 8080
onOpen: open-preview
description: Application
onOpen: ignore
description: Application (if needed)

vscode:
extensions:
- golang.go
- github.vscode-pull-request-github
- streetsidesoftware.code-spell-checker
- eamodio.gitlens
32 changes: 28 additions & 4 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@
# General
# ---------------------------
version: 2

before:
hooks:
- make test
- sh -c 'if [ "$SKIP_GORELEASER_TESTS" = "true" ]; then echo "Skipping tests (SKIP_GORELEASER_TESTS=true)"; else magex test; fi'
changelog:
sort: asc
filters:
exclude:
- "^.github:"
- "^.vscode:"
- "^test:"

# ---------------------------
# Builder
# ---------------------------
Expand All @@ -24,28 +25,50 @@ builds:
- windows
- darwin
skip: true

# ---------------------------
# Archives
# ---------------------------
archives:
- id: go-tx-map
name_template: >-
{{- .ProjectName }}_{{- .Version }}_{{- .Os }}_{{- .Arch }}
files:
- LICENSE
- README.md

# ---------------------------
# Checksum
# ---------------------------
checksum:
name_template: "{{ .ProjectName }}_{{ .Version }}_checksums.txt"
algorithm: sha256

# ---------------------------
# Github Release
# ---------------------------
release:
prerelease: "false"
name_template: "Release v{{.Version}}"

# ---------------------------
# Announce
# ---------------------------
announce:
# See more at: https://goreleaser.com/customization/announce/#slack
slack:
enabled: false
message_template: "{{ .ProjectName }} {{ .Tag }} is out! Changelog: https://github.com/bsv-blockchain/{{ .ProjectName }}/releases/tag/{{ .Tag }}"
message_template: "{{ .ProjectName }} {{ .Tag }} is out! Changelog: https://github.com/{{ .GitOwner }}/{{ .ProjectName }}/releases/tag/{{ .Tag }}"
channel: "#test_slack"
# username: ''
# icon_emoji: ''
# icon_url: ''

# See more at: https://goreleaser.com/customization/announce/#twitter
twitter:
enabled: false
message_template: "{{ .ProjectName }} {{ .Tag }} is out!"

# See more at: https://goreleaser.com/customization/announce/#discord
discord:
enabled: false
Expand All @@ -56,6 +79,7 @@ announce:
color: ""
# Defaults to `https://goreleaser.com/static/avatar.png`
icon_url: ""

# See more at: https://goreleaser.com/customization/announce/#reddit
reddit:
enabled: false
Expand All @@ -64,6 +88,6 @@ announce:
# Username for your Reddit account
username: ""
# Defaults to `{{ .GitURL }}/releases/tag/{{ .Tag }}`
# url_template: 'https://github.com/bsv-blockchain/{{ .ProjectName }}/releases/tag/{{ .Tag }}'
# url_template: 'https://github.com/{{ .GitOwner }}/{{ .ProjectName }}/releases/tag/{{ .Tag }}'
# Defaults to `{{ .ProjectName }} {{ .Tag }} is out!`
title_template: "{{ .ProjectName }} {{ .Tag }} is out!"
17 changes: 16 additions & 1 deletion codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# ----------------------
codecov:
require_ci_to_pass: true

# Coverage configuration
# ----------------------
coverage:
Expand All @@ -11,14 +12,27 @@ coverage:
# (default is 70..100)
round: down # up, down, or nearest
precision: 2 # Number of decimal places, between 0 and 5

# Flag Management - Simple carryforward for everything
# ----------------------
flag_management:
default_rules:
carryforward: true # This keeps coverage from previous uploads
statuses:
- type: project
target: auto
threshold: 2%

# Ignoring Paths
# --------------
# which folders/files to ignore
ignore:
- ".github/**"
- ".make/**"
- ".mage-cache/**"
- ".vscode/**"
- "bin/**"
- "examples/**"

# Parsers
# --------------
parsers:
Expand All @@ -28,6 +42,7 @@ parsers:
loop: yes
method: no
macro: no

# Pull request comments:
# ----------------------
# Diff is the Coverage Diff of the pull request.
Expand Down