Thank you for your interest in contributing to machineid! This document provides guidelines and best practices for contributing to the project.
- Go 1.26 or higher
- Git
- Make
-
Fork the repository on GitHub
-
Clone your fork locally:
git clone https://github.com/YOUR_USERNAME/machineid.git cd machineid -
Add the upstream repository:
git remote add upstream https://github.com/slashdevops/machineid.git
-
Create a new branch for your changes:
git checkout -b feature/your-feature-name
Build the project using the provided Makefile:
make buildRun the test suite:
make testRun tests with coverage:
make test-coverageRun the linter to ensure code quality:
make lintThis project follows Semantic Versioning 2.0.0. Version numbers follow the format MAJOR.MINOR.PATCH:
- MAJOR: Incompatible API changes
- MINOR: Backwards-compatible functionality additions
- PATCH: Backwards-compatible bug fixes
Important: Tags must follow semantic versioning order. You cannot create a tag with an older version number than existing tags.
If you try to create v0.0.1 when v0.0.2 already exists, you'll get:
! [remote rejected] v0.0.1 -> v0.0.1 (push declined due to repository rule violations)
error: failed to push some refs to 'github.com:slashdevops/machineid.git'
This is a GitHub repository rule that prevents version rollback and ensures proper version ordering.
-
Check existing tags:
git tag -l
-
Create the next appropriate version tag:
# If the latest tag is v0.0.2, create v0.0.3 or higher git tag -a "v0.0.3" -m "Release v0.0.3"
-
Push the tag:
git push origin v0.0.3
Choose the appropriate version increment based on your changes:
- Patch (e.g.,
v0.0.2→v0.0.3): Bug fixes, documentation updates - Minor (e.g.,
v0.0.2→v0.1.0): New features, backwards-compatible changes - Major (e.g.,
v0.0.2→v1.0.0): Breaking changes, incompatible API modifications
-
Ensure all tests pass:
make test -
Update documentation if needed
-
Create and push a tag with the next appropriate version:
git tag -a "vX.Y.Z" -m "Release vX.Y.Z" git push origin vX.Y.Z
-
The GitHub Actions workflow will automatically create a release with binaries
Follow Go's idiomatic style as defined in:
- Use meaningful names for variables, functions, and packages
- Keep functions small and focused on a single task
- Use comments to explain complex logic or decisions
- Prefer
anyoverinterface{}for better readability - Use dependency injection for services to facilitate testing
- Update documentation for any new features or changes
- Ensure all tests pass
- Ensure code passes linting
- Update the README.md if needed
- Submit a pull request with a clear description of changes
Use conventional commit format:
feat:for new featuresfix:for bug fixesdocs:for documentation changestest:for test-related changeschore:for maintenance tasks
Example: feat: add support for custom MAC address filters
If you have questions or need help, please:
- Open an issue on GitHub
- Check existing issues for similar questions
- Review the README.md for usage examples
Thank you for contributing to machineid!