Thank you for your interest in contributing to the MinZ programming language! This guide will help you get started.
- Fork the repository
- Clone your fork:
git clone https://github.com/yourusername/minz.git - Create a feature branch:
git checkout -b feature/your-feature-name - Make your changes
- Test your changes (see Testing section)
- Commit with meaningful messages
- Push to your fork:
git push origin feature/your-feature-name - Open a Pull Request
- Node.js (for tree-sitter)
- Go 1.21+ (for compiler)
- tree-sitter CLI:
npm install -g tree-sitter-cli
# Generate tree-sitter parser
npm install
tree-sitter generate
# Build the compiler
cd minzc && make build
# Run tests
cd minzc && make testAll MinZ command-line tools MUST follow these standards for consistency:
- REQUIRED: Use
github.com/spf13/cobrafor all CLI tools - RATIONALE: Cobra provides standard Unix-style CLI conventions automatically
- DO NOT: Use Go's standard
flagpackage directly
All options must follow standard Unix/POSIX conventions:
- Single dash:
-v,-o,-h - Single character only
- Can be combined:
-vcequals-v -c
- Double dash:
--verbose,--output,--help - Use kebab-case:
--enable-smc, not--enableSMC - Should be self-documenting
| Short | Long | Purpose |
|---|---|---|
-h |
--help |
Show help text |
-v |
--version or --verbose |
Version or verbose output |
-o |
--output |
Output file |
-t |
--target |
Target platform |
-d |
--debug |
Debug mode |
var rootCmd = &cobra.Command{
Use: "tool [input]",
Short: "Brief description",
Long: `Detailed help text...`,
}
func init() {
rootCmd.Flags().StringVarP(&output, "output", "o", "", "output file")
rootCmd.Flags().BoolVarP(&verbose, "verbose", "v", false, "verbose")
}- Go code follows standard Go formatting (
gofmt) - Use meaningful variable and function names
- Add comments for complex logic
- Keep functions focused and small
- CLI tools must use Cobra for consistency
- Add tests for new features
- Ensure all existing tests pass:
cd minzc && make test - Test with example programs:
cd minzc && make run
- Update README.md if adding new features
- Add examples demonstrating new functionality
- Update relevant documentation in docs/
- One feature per PR - Keep PRs focused
- Clear description - Explain what and why
- Tests required - Include tests for new code
- Documentation - Update docs as needed
- Clean history - Squash commits if needed
- Compiler optimizations - Improve code generation
- Language features - Implement planned features
- Documentation - Improve guides and examples
- Testing - Add more test coverage
- Tools - IDE support, debuggers, etc.
Feel free to open an issue for questions or discussions about potential contributions.
Thank you for helping make MinZ better!