Thank you for your interest in contributing to NanoID for Go! Your contributions help make this project better for everyone. This guide outlines the process for contributing to the project, including reporting issues, submitting pull requests, and adhering to the project's code of conduct.
This project adheres to the Contributor Covenant Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to [email protected].
This software adheres to the Semantic Versioning 2.0 standard for version numbering as quoted here:
Given a version number MAJOR.MINOR.PATCH, increment the:
- MAJOR version when you make incompatible API changes
- MINOR version when you add functionality in a backward compatible manner
- PATCH version when you make backward compatible bug fixes
Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format.
There are several ways you can contribute to NanoID for Go:
If you encounter a bug or unexpected behavior:
- Search Existing Issues: Check if the issue has already been reported here.
- Open a New Issue: If not, open a new issue describing the bug in detail.
- Provide a Clear Title: Summarize the problem.
- Describe the Behavior: Explain what you expected to happen versus what actually happened.
- Steps to Reproduce: Include code snippets or commands that can help reproduce the issue.
- Environment Details: Mention your Go version, operating system, and any other relevant information.
To suggest new features or improvements:
- Search Existing Features: Ensure your idea hasn't been discussed here.
- Open a New Feature Request: Provide a detailed description of the feature.
- Describe the Feature: Explain what the feature is and why it's needed.
- Use Cases: Provide examples of how the feature would be used.
- Potential Implementation: If possible, suggest how it could be implemented.
Contributions in the form of bug fixes, improvements, or new features are welcome!
Fork the repository to your GitHub account by clicking the Fork button at the top right of the repository page.
Clone the forked repository to your local machine:
git clone https://github.com/sixafter/nanoid.git
cd nanoid
Create a new branch for your changes:
git checkout -b feature/your-feature-name
Ensure all tests pass and the code adheres to the style guidelines:
make lint
make test
Commit your changes with a clear and descriptive message:
git add .
git commit -m "Add descriptive commit message"
Push your changes to your forked repository:
git push origin feature/your-feature-name
Navigate to the original repository and click New Pull Request. Provide a clear description of your changes and link any related issues.
Adhering to consistent coding standards ensures the codebase remains clean, readable, and maintainable.
- Formatting: Use
make fmt
to format your code. - Linting: Follow the linting rules defined in
.golangci.yaml
. Ensure that your code passes all linters before submitting. - Documentation: Document public functions, types, and methods using Go's standard documentation conventions.
- Error Handling: Handle errors gracefully and consistently. Use the predefined error types where applicable.
- Randomness: Ensure that all randomness sources use cryptographically secure methods (crypto/rand).
- Data Sanitization: Avoid exposing sensitive data through IDs or logs.
Follow these steps to create a successful pull request (PR):
- Ensure Your Branch is Up-to-Date
- Before opening a PR, make sure your branch is based on the latest main branch.
- Create a Pull Request
- Address Feedback
- Respond Promptly: Engage with reviewers by responding to comments and making necessary changes.
- Update Your PR: Push additional commits to your branch to address feedback.
- Merge the PR
- Once approved and all checks pass, your PR will be merged by a maintainer.
We appreciate your interest in contributing to NanoID for Go! Your efforts help improve the project and support the community. If you have any questions or need assistance, feel free to reach out by opening an issue or contacting the maintainers.
Happy coding! 🎉