Thank you for your interest in contributing to Locatr! We appreciate your time and effort in improving the project. Please follow the guidelines below to ensure that your contributions are consistent and valuable.
Start by forking the repository on GitHub. You can do this by clicking the “Fork” button at the top of the repository page.
Once the repository is forked, clone it to your local machine.
git clone https://github.com/YOUR_USERNAME/locatr.git
cd locatr
Make sure you have all the necessary tools and dependencies installed, including Go and pre-commit.
- Go: Install Go from the official site.
- Pre-commit: Install pre-commit to ensure that the hooks run before each commit link.
pip install pre-commit
pre-commit install
Create a new branch for your feature or bugfix.
git checkout -b your-branch-name
Please ensure that your code follows the Go language standards and style. We use the following pre-commit hooks to enforce code quality and style:
- go-fmt: Formats Go code.
- go-imports: Orders and groups imports properly.
- golangci-lint: Runs various linters to ensure code quality.
Install golangcli-lint from this link
The pre-commit hooks will automatically run before each commit. You can also run them manually at any time using:
pre-commit run --all-files
Make sure that any changes you make are properly tested. You can run the test suite with:
go test ./...
If you add a new feature, ensure that it is covered by tests. If you fix a bug, add a test that reproduces the issue.
Please document your code appropriately, especially public functions and methods. If you are adding a new feature, update the relevant documentation (if applicable).
- Push your branch to your fork:
git push origin your-branch-name
- Open a Pull Request (PR) from your branch to the main branch in the original repository. In the PR description, explain the changes you have made and why they are necessary.
- Ensure that your code passes the continuous integration (CI) checks.
- Be responsive to feedback and make necessary updates based on code reviews.