Contributing
Development Setup
Section titled “Development Setup”The project uses Nix for reproducible builds. Enter the development shell:
nix developThis provides Go, gopls, golangci-lint, and goreleaser.
Build Commands
Section titled “Build Commands”nix build .# # Build the packagenix flake check # Run all checks (format, build, test)go build ./cmd/md-go-validator # Build the CLI directlygo test ./... # Run testsgolangci-lint run ./... # LintProject Structure
Section titled “Project Structure”cmd/md-go-validator/— CLI entry pointpkg/— Library codeparser.go— Go validation entry pointextractor.go— Code block extraction from Markdown/MDXvalidator.go— FileValidator with concurrent processinglanguages/— Language validators (Go, Tree-sitter)types/— Branded domain typesconfig/— YAML config file supportbaseline/— Baseline regression modeoutput/— Multi-format outputcode/— Go code utilities (indent, parse, normalize)
Adding a New Language
Section titled “Adding a New Language”- Implement the
Validatorinterface inpkg/languages/ - Register the language in the default registry
- Add the language identifier to
Language.Validate() - Add tests in
*_test.go - Update the Supported Languages docs
Testing
Section titled “Testing”All tests use t.Parallel(). Run the full suite:
go test -race ./...go test -cover ./...Pull Requests
Section titled “Pull Requests”- Fork the repository
- Create a feature branch
- Ensure
golangci-lint run ./...passes with 0 issues - Ensure all tests pass
- Open a pull request
Reporting Issues
Section titled “Reporting Issues”Use the GitHub issue tracker for bug reports and feature requests.