Skip to content

Commit b284f69

Browse files
committed
feat: upgraded readme
1 parent 3b4bfc4 commit b284f69

File tree

1 file changed

+40
-94
lines changed

1 file changed

+40
-94
lines changed

README.md

Lines changed: 40 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@
5050
<a href=".github/AGENTS.md">
5151
<img src="https://img.shields.io/badge/AGENTS.md-found-40b814?style=flat&logo=openai" alt="AGENTS.md rules">
5252
</a><br/>
53-
<a href="Makefile">
54-
<img src="https://img.shields.io/badge/Makefile-supported-brightgreen?style=flat&logo=probot&logoColor=white" alt="Makefile Supported">
53+
<a href="https://magefile.org/">
54+
<img src="https://img.shields.io/badge/mage-powered-brightgreen?style=flat&logo=probot&logoColor=white" alt="Mage Powered">
5555
</a><br/>
5656
<a href=".github/dependabot.yml">
5757
<img src="https://img.shields.io/badge/dependencies-automatic-blue?logo=dependabot&style=flat" alt="Dependabot">
@@ -94,6 +94,11 @@
9494
go get -u github.com/bsv-blockchain/go-chaincfg
9595
```
9696

97+
Get the [MAGE-X](https://github.com/mrz1836/mage-x) build tool for development:
98+
```shell script
99+
go install github.com/mrz1836/mage-x/cmd/magex@latest
100+
```
101+
97102
<br/>
98103

99104
## 📚 Documentation
@@ -111,13 +116,13 @@ go get -u github.com/bsv-blockchain/go-chaincfg
111116

112117
* **Continuous Integration on Autopilot** with [GitHub Actions](https://github.com/features/actions) – every push is built, tested, and reported in minutes.
113118
* **Pull‑Request Flow That Merges Itself** thanks to [auto‑merge](.github/workflows/auto-merge-on-approval.yml) and hands‑free [Dependabot auto‑merge](.github/workflows/dependabot-auto-merge.yml).
114-
* **One‑Command Builds** powered by battle‑tested [Make](https://www.gnu.org/software/make) targets for linting, testing, releases, and more.
119+
* **One‑Command Builds** powered by battle‑tested [MAGE-X](https://github.com/mrz1836/mage-x) targets for linting, testing, releases, and more.
115120
* **First‑Class Dependency Management** using native [Go Modules](https://github.com/golang/go/wiki/Modules).
116121
* **Uniform Code Style** via [gofumpt](https://github.com/mvdan/gofumpt) plus zero‑noise linting with [golangci‑lint](https://github.com/golangci/golangci-lint).
117122
* **Confidence‑Boosting Tests** with [testify](https://github.com/stretchr/testify), the Go [race detector](https://blog.golang.org/race-detector), crystal‑clear [HTML coverage](https://blog.golang.org/cover) snapshots, and automatic uploads to [Codecov](https://codecov.io/).
118123
* **Hands‑Free Releases** delivered by [GoReleaser](https://github.com/goreleaser/goreleaser) whenever you create a [new Tag](https://git-scm.com/book/en/v2/Git-Basics-Tagging).
119-
* **Relentless Dependency & Vulnerability Scans** via [Dependabot](https://dependabot.com), [Nancy](https://github.com/sonatype-nexus-community/nancy), and [govulncheck](https://pkg.go.dev/golang.org/x/vuln/cmd/govulncheck).
120-
* **Security Posture by Default** with [CodeQL](https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/about-code-scanning), [OpenSSF Scorecard](https://openssf.org), and secret‑leak detection via [gitleaks](https://github.com/gitleaks/gitleaks).
124+
* **Relentless Dependency & Vulnerability Scans** via [Dependabot](https://dependabot.com), [Nancy](https://github.com/sonatype-nexus-community/nancy) and [govulncheck](https://pkg.go.dev/golang.org/x/vuln/cmd/govulncheck).
125+
* **Security Posture by Default** with [CodeQL](https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/about-code-scanning), [OpenSSF Scorecard](https://openssf.org) and secret‑leak detection via [gitleaks](https://github.com/gitleaks/gitleaks).
121126
* **Automatic Syndication** to [pkg.go.dev](https://pkg.go.dev/) on every release for instant godoc visibility.
122127
* **Polished Community Experience** using rich templates for [Issues & PRs](https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository).
123128
* **All the Right Meta Files** (`LICENSE`, `CONTRIBUTING.md`, `CODE_OF_CONDUCT.md`, `SUPPORT.md`, `SECURITY.md`) pre‑filled and ready.
@@ -129,9 +134,9 @@ go get -u github.com/bsv-blockchain/go-chaincfg
129134
* **Instant Cloud Workspaces** via [Gitpod](https://gitpod.io/) – spin up a fully configured dev environment with automatic linting and tests.
130135
* **Out‑of‑the‑Box VS Code Happiness** with a preconfigured [Go](https://code.visualstudio.com/docs/languages/go) workspace and [`.vscode`](.vscode) folder with all the right settings.
131136
* **Optional Release Broadcasts** to your community via [Slack](https://slack.com), [Discord](https://discord.com), or [Twitter](https://twitter.com) – plug in your webhook.
132-
* **AI Compliance Playbook** – machine‑readable guidelines ([AGENTS.md](.github/AGENTS.md), [CLAUDE.md](.github/CLAUDE.md), [.cursorrules](.cursorrules), [sweep.yaml](.github/sweep.yaml)) keep ChatGPT, Claude, Cursor & Sweep aligned with your repos rules.
133-
* **Pre-commit Hooks for Consistency** powered by [pre-commit](https://pre-commit.com) and the [.pre-commit-config.yaml](.pre-commit-config.yaml) file—run the same formatting, linting, and tests before every commit, just like CI.
134-
* **Automated Hook Updates** keep the [.pre-commit-config.yaml](.pre-commit-config.yaml) current via a weekly [workflow](.github/workflows/update-pre-commit-hooks.yml).
137+
* **AI Compliance Playbook** – machine‑readable guidelines ([AGENTS.md](.github/AGENTS.md), [CLAUDE.md](.github/CLAUDE.md), [.cursorrules](.cursorrules), [sweep.yaml](.github/sweep.yaml)) keep ChatGPT, Claude, Cursor & Sweep aligned with your repo's rules.
138+
* **Go-Pre-commit System** - [High-performance Go-native pre-commit hooks](https://github.com/mrz1836/go-pre-commit) with 17x faster execution—run the same formatting, linting, and tests before every commit, just like CI.
139+
* **Zero Python Dependencies** - Pure Go implementation with environment-based configuration via [.env.base](.github/.env.base).
135140
* **DevContainers for Instant Onboarding** – Launch a ready-to-code environment in seconds with [VS Code DevContainers](https://containers.dev/) and the included [.devcontainer.json](.devcontainer.json) config.
136141

137142
</details>
@@ -148,119 +153,64 @@ brew install goreleaser
148153

149154
The release process is defined in the [.goreleaser.yml](.goreleaser.yml) configuration file.
150155

151-
To generate a snapshot (non-versioned) release for testing purposes, run:
152-
153-
```bash
154-
make release-snap
155-
```
156156

157157
Then create and push a new Git tag using:
158158

159159
```bash
160-
make tag version=x.y.z
160+
magex version:bump push=true bump=patch branch=master
161161
```
162162

163163
This process ensures consistent, repeatable releases with properly versioned artifacts and citation metadata.
164164

165165
</details>
166166

167167
<details>
168-
<summary><strong><code>Makefile Commands</code></strong></summary>
168+
<summary><strong><code>Pre-commit Hooks</code></strong></summary>
169169
<br/>
170170

171-
View all `makefile` commands
171+
Set up the Go-Pre-commit System to run the same formatting, linting, and tests defined in [AGENTS.md](.github/AGENTS.md) before every commit:
172172

173-
```bash script
174-
make help
173+
```bash
174+
go install github.com/mrz1836/go-pre-commit/cmd/go-pre-commit@latest
175+
go-pre-commit install
175176
```
176177

177-
List of all current commands:
178-
179-
<!-- make-help-start -->
180-
```text
181-
bench ## Run all benchmarks in the Go application
182-
build-go ## Build the Go application (locally)
183-
citation ## Update version in CITATION.cff (use version=X.Y.Z)
184-
clean-mods ## Remove all the Go mod cache
185-
coverage ## Show test coverage
186-
diff ## Show git diff and fail if uncommitted changes exist
187-
fumpt ## Run fumpt to format Go code
188-
generate ## Run go generate in the base of the repo
189-
godocs ## Trigger GoDocs tag sync
190-
govulncheck-install ## Install govulncheck (pass VERSION= to override)
191-
govulncheck ## Scan for vulnerabilities
192-
help ## Display this help message
193-
install-go ## Install using go install with specific version
194-
install-releaser ## Install GoReleaser
195-
install-stdlib ## Install the Go standard library for the host platform
196-
install-template ## Kick-start a fresh copy of go-template (run once!)
197-
install ## Install the application binary
198-
lint-version ## Show the golangci-lint version
199-
lint ## Run the golangci-lint application (install if not found)
200-
loc ## Total lines of code table
201-
mod-download ## Download Go module dependencies
202-
mod-tidy ## Clean up go.mod and go.sum
203-
pre-build ## Pre-build all packages to warm cache
204-
release-snap ## Build snapshot binaries
205-
release-test ## Run release dry-run (no publish)
206-
release ## Run production release (requires github_token)
207-
tag-remove ## Remove local and remote tag (use version=X.Y.Z)
208-
tag-update ## Force-update tag to current commit (use version=X.Y.Z)
209-
tag ## Create and push a new tag (use version=X.Y.Z)
210-
test-ci-no-race ## CI test suite without race detector
211-
test-ci ## CI test runs tests with race detection and coverage (no lint - handled separately)
212-
test-cover-race ## Runs unit tests with race detector and outputs coverage
213-
test-cover ## Unit tests with coverage (no race)
214-
test-fuzz ## Run fuzz tests only (no unit tests)
215-
test-no-lint ## Run only tests (no lint)
216-
test-parallel ## Run tests in parallel (faster for large repos)
217-
test-race ## Unit tests with race detector (no coverage)
218-
test-short ## Run tests excluding integration tests (no lint)
219-
test ## Default testing uses lint + unit tests (fast)
220-
uninstall ## Uninstall the Go binary
221-
update-linter ## Upgrade golangci-lint (macOS only)
222-
update-releaser ## Reinstall GoReleaser
223-
update ## Update dependencies
224-
vet-parallel ## Run go vet in parallel (faster for large repos)
225-
vet ## Run go vet only on your module packages
226-
```
227-
<!-- make-help-end -->
178+
The system is configured via [.env.base](.github/.env.base) and can be customized using also using [.env.custom](.github/.env.custom) and provides 17x faster execution than traditional Python-based pre-commit hooks. See the [complete documentation](http://github.com/mrz1836/go-pre-commit) for details.
228179

229180
</details>
230181

231182
<details>
232183
<summary><strong><code>GitHub Workflows</code></strong></summary>
233184
<br/>
234185

235-
236186
### 🎛️ The Workflow Control Center
237187

238-
All GitHub Actions workflows in this repository are powered by a single configuration file: [**.env.shared**](.github/.env.shared) – your one-stop shop for tweaking CI/CD behavior without touching a single YAML file! 🎯
188+
All GitHub Actions workflows in this repository are powered by a single configuration files – your one-stop shop for tweaking CI/CD behavior without touching a single YAML file! 🎯
189+
190+
**Configuration Files:**
191+
- **[.env.base](.github/.env.base)** – Default configuration that works for most Go projects
192+
- **[.env.custom](.github/.env.custom)** – Optional project-specific overrides
239193

240194
This magical file controls everything from:
241-
- **🚀 Go version matrix** (test on multiple versions or just one)
195+
- **⚙️ Go version matrix** (test on multiple versions or just one)
242196
- **🏃 Runner selection** (Ubuntu or macOS, your wallet decides)
243-
- **🔬 Feature toggles** (coverage, fuzzing, linting, race detection)
197+
- **🔬 Feature toggles** (coverage, fuzzing, linting, race detection, benchmarks)
244198
- **🛡️ Security tool versions** (gitleaks, nancy, govulncheck)
245199
- **🤖 Auto-merge behaviors** (how aggressive should the bots be?)
246200
- **🏷️ PR management rules** (size labels, auto-assignment, welcome messages)
247201

248-
> **Pro tip:** Want to disable code coverage? Just flip `ENABLE_CODE_COVERAGE=false` in [.env.shared](.github/.env.shared) and push. No YAML archaeology required!
249-
250202
<br/>
251203

252204
| Workflow Name | Description |
253205
|------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
254206
| [auto-merge-on-approval.yml](.github/workflows/auto-merge-on-approval.yml) | Automatically merges PRs after approval and all required checks, following strict rules. |
255-
| [codeql.yml](.github/workflows/codeql-analysis.yml) | Analyzes code for security vulnerabilities using [GitHub CodeQL](https://codeql.github.com/). |
207+
| [codeql-analysis.yml](.github/workflows/codeql-analysis.yml) | Analyzes code for security vulnerabilities using [GitHub CodeQL](https://codeql.github.com/). |
256208
| [dependabot-auto-merge.yml](.github/workflows/dependabot-auto-merge.yml) | Automatically merges [Dependabot](https://github.com/dependabot) PRs that meet all requirements. |
257209
| [fortress.yml](.github/workflows/fortress.yml) | Runs the GoFortress security and testing workflow, including linting, testing, releasing, and vulnerability checks. |
258210
| [pull-request-management.yml](.github/workflows/pull-request-management.yml) | Labels PRs by branch prefix, assigns a default user if none is assigned, and welcomes new contributors with a comment. |
259211
| [scorecard.yml](.github/workflows/scorecard.yml) | Runs [OpenSSF](https://openssf.org/) Scorecard to assess supply chain security. |
260212
| [stale.yml](.github/workflows/stale-check.yml) | Warns about (and optionally closes) inactive issues and PRs on a schedule or manual trigger. |
261213
| [sync-labels.yml](.github/workflows/sync-labels.yml) | Keeps GitHub labels in sync with the declarative manifest at [`.github/labels.yml`](./.github/labels.yml). |
262-
| [update-python-dependencies.yml](.github/workflows/update-python-dependencies.yml) | Updates Python dependencies for pre-commit hooks in the repository. |
263-
| [update-pre-commit-hooks.yml](.github/workflows/update-pre-commit-hooks.yml) | Automatically update versions for [pre-commit](https://pre-commit.com/) hooks |
264214

265215
</details>
266216

@@ -271,26 +221,23 @@ This magical file controls everything from:
271221
To update all dependencies (Go modules, linters, and related tools), run:
272222

273223
```bash
274-
make update
224+
magex deps:update
275225
```
276226

277-
This command ensures all dependencies are brought up to date in a single step, including Go modules and any tools managed by the Makefile. It is the recommended way to keep your development environment and CI in sync with the latest versions.
227+
This command ensures all dependencies are brought up to date in a single step, including Go modules and any tools managed by [MAGE-X](https://github.com/mrz1836/mage-x). It is the recommended way to keep your development environment and CI in sync with the latest versions.
278228

279229
</details>
280230

281231
<details>
282-
<summary><strong><code>Pre-commit Hooks</code></strong></summary>
232+
<summary><strong><code>Build Commands</code></strong></summary>
283233
<br/>
284234

285-
Set up the optional [pre-commit](https://pre-commit.com) hooks to run the same formatting, linting, and tests defined in [AGENTS.md](.github/AGENTS.md) before every commit:
235+
View all build commands
286236

287-
```bash
288-
pip install pre-commit
289-
pre-commit install
237+
```bash script
238+
magex help
290239
```
291240

292-
The hooks are configured in [.pre-commit-config.yaml](.pre-commit-config.yaml) and mirror the CI pipeline.
293-
294241
</details>
295242

296243
<br/>
@@ -302,12 +249,12 @@ All unit tests and [examples](examples) run via [GitHub Actions](https://github.
302249
Run all tests (fast):
303250

304251
```bash script
305-
make test
252+
magex test
306253
```
307254

308255
Run all tests with race detector (slower):
309256
```bash script
310-
make test-race
257+
magex test:race
311258
```
312259

313260
<br/>
@@ -317,7 +264,7 @@ make test-race
317264
Run the Go [benchmarks](chaincfg_benchmark_test.go):
318265

319266
```bash script
320-
make bench
267+
magex bench
321268
```
322269

323270
<br/>
@@ -350,9 +297,9 @@ Edit `AGENTS.md` first when adjusting these policies, and keep the other files i
350297
<br/>
351298

352299
## 👥 Maintainers
353-
| [<img src="https://github.com/icellan.png" height="50" alt="Siggi" />](https://github.com/icellan) |
354-
|:--------------------------------------------------------------------------------------------------:|
355-
| [Siggi](https://github.com/icellan) |
300+
| [<img src="https://github.com/mrz1836.png" height="50" width="50" alt="MrZ" />](https://github.com/mrz1836) | [<img src="https://github.com/icellan.png" height="50" alt="Siggi" />](https://github.com/icellan) |
301+
|:-----------------------------------------------------------------------------------------------------------:|:--------------------------------------------------------------------------------------------------:|
302+
| [MrZ](https://github.com/mrz1836) | [Siggi](https://github.com/icellan) |
356303

357304
<br/>
358305

@@ -362,7 +309,6 @@ View the [contributing guidelines](.github/CONTRIBUTING.md) and please follow th
362309
### How can I help?
363310
All kinds of contributions are welcome :raised_hands:!
364311
The most basic way to show your support is to star :star2: the project, or to raise issues :speech_balloon:.
365-
You can also support this project by [becoming a sponsor on GitHub](https://github.com/sponsors/bsv-blockchain) :clap:
366312

367313
[![Stars](https://img.shields.io/github/stars/bsv-blockchain/go-chaincfg?label=Please%20like%20us&style=social&v=1)](https://github.com/bsv-blockchain/go-chaincfg/stargazers)
368314

0 commit comments

Comments
 (0)