You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
+
97
102
<br/>
98
103
99
104
## 📚 Documentation
@@ -111,13 +116,13 @@ go get -u github.com/bsv-blockchain/go-chaincfg
111
116
112
117
***Continuous Integration on Autopilot** with [GitHub Actions](https://github.com/features/actions) – every push is built, tested, and reported in minutes.
113
118
***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.
115
120
***First‑Class Dependency Management** using native [Go Modules](https://github.com/golang/go/wiki/Modules).
116
121
***Uniform Code Style** via [gofumpt](https://github.com/mvdan/gofumpt) plus zero‑noise linting with [golangci‑lint](https://github.com/golangci/golangci-lint).
117
122
***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/).
118
123
***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).
121
126
***Automatic Syndication** to [pkg.go.dev](https://pkg.go.dev/) on every release for instant godoc visibility.
122
127
***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).
123
128
***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
129
134
***Instant Cloud Workspaces** via [Gitpod](https://gitpod.io/) – spin up a fully configured dev environment with automatic linting and tests.
130
135
***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.
131
136
***Optional Release Broadcasts** to your community via [Slack](https://slack.com), [Discord](https://discord.com), or [Twitter](https://twitter.com) – plug in your webhook.
***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).
***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).
135
140
***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.
136
141
137
142
</details>
@@ -148,119 +153,64 @@ brew install goreleaser
148
153
149
154
The release process is defined in the [.goreleaser.yml](.goreleaser.yml) configuration file.
150
155
151
-
To generate a snapshot (non-versioned) release for testing purposes, run:
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.
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
> **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!
|[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/). |
256
208
|[dependabot-auto-merge.yml](.github/workflows/dependabot-auto-merge.yml)| Automatically merges [Dependabot](https://github.com/dependabot) PRs that meet all requirements. |
257
209
|[fortress.yml](.github/workflows/fortress.yml)| Runs the GoFortress security and testing workflow, including linting, testing, releasing, and vulnerability checks. |
258
210
|[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. |
259
211
|[scorecard.yml](.github/workflows/scorecard.yml)| Runs [OpenSSF](https://openssf.org/) Scorecard to assess supply chain security. |
260
212
|[stale.yml](.github/workflows/stale-check.yml)| Warns about (and optionally closes) inactive issues and PRs on a schedule or manual trigger. |
261
213
|[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 |
264
214
265
215
</details>
266
216
@@ -271,26 +221,23 @@ This magical file controls everything from:
271
221
To update all dependencies (Go modules, linters, and related tools), run:
272
222
273
223
```bash
274
-
make update
224
+
magex deps:update
275
225
```
276
226
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.
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
286
236
287
-
```bash
288
-
pip install pre-commit
289
-
pre-commit install
237
+
```bash script
238
+
magex help
290
239
```
291
240
292
-
The hooks are configured in [.pre-commit-config.yaml](.pre-commit-config.yaml) and mirror the CI pipeline.
293
-
294
241
</details>
295
242
296
243
<br/>
@@ -302,12 +249,12 @@ All unit tests and [examples](examples) run via [GitHub Actions](https://github.
302
249
Run all tests (fast):
303
250
304
251
```bash script
305
-
maketest
252
+
magextest
306
253
```
307
254
308
255
Run all tests with race detector (slower):
309
256
```bash script
310
-
make test-race
257
+
magex test:race
311
258
```
312
259
313
260
<br/>
@@ -317,7 +264,7 @@ make test-race
317
264
Run the Go [benchmarks](chaincfg_benchmark_test.go):
318
265
319
266
```bash script
320
-
make bench
267
+
magex bench
321
268
```
322
269
323
270
<br/>
@@ -350,9 +297,9 @@ Edit `AGENTS.md` first when adjusting these policies, and keep the other files i
0 commit comments