|
| 1 | +## Development Setup |
| 2 | + |
| 3 | +```bash |
| 4 | +git clone https://github.com/grishy/go-avahi-cname.git |
| 5 | +cd go-avahi-cname |
| 6 | +go mod download |
| 7 | +go build -o go-avahi-cname . |
| 8 | +``` |
| 9 | + |
| 10 | +## Before Committing |
| 11 | + |
| 12 | +Run formatting, linting, and tests: |
| 13 | + |
| 14 | +```bash |
| 15 | +golangci-lint fmt ./... |
| 16 | +golangci-lint run ./... |
| 17 | +go test -race -shuffle=on -vet=all -failfast ./... |
| 18 | +``` |
| 19 | + |
| 20 | +All three should pass with no errors. |
| 21 | + |
| 22 | +## Testing Locally |
| 23 | + |
| 24 | +You need a Linux machine with Avahi daemon running. |
| 25 | + |
| 26 | +```bash |
| 27 | +# Run with debug logging |
| 28 | +./go-avahi-cname --debug subdomain |
| 29 | + |
| 30 | +# From another terminal or device |
| 31 | +ping anything.yourhostname.local |
| 32 | +``` |
| 33 | + |
| 34 | +## Code Style |
| 35 | + |
| 36 | +This project uses [golangci-lint](https://golangci-lint.run/) with a strict |
| 37 | +config (see `.golangci.yml`). The linter handles formatting via `goimports`, |
| 38 | +`gofumpt`, and `golines`. |
| 39 | + |
| 40 | +A few principles: |
| 41 | + |
| 42 | +- Meaningful variable names — no abbreviations unless standard |
| 43 | +- Comments explain "why," not "what" |
| 44 | +- Keep functions focused and reasonably sized |
| 45 | + |
| 46 | +## Submitting Changes |
| 47 | + |
| 48 | +1. Fork the repository |
| 49 | +2. Create a feature branch: `git checkout -b feature/your-feature` |
| 50 | +3. Make changes, run the checks above |
| 51 | +4. Push to your fork and open a Pull Request |
| 52 | + |
| 53 | +## Reporting Issues |
| 54 | + |
| 55 | +Please include: |
| 56 | + |
| 57 | +- OS and version |
| 58 | +- Avahi daemon version (`avahi-daemon --version`) |
| 59 | +- Output with `--debug` flag |
| 60 | +- Steps to reproduce |
| 61 | + |
| 62 | +## Release Process (Maintainers) |
| 63 | + |
| 64 | +1. Update version references in the project. |
| 65 | + |
| 66 | +2. Create and push a tag: |
| 67 | + |
| 68 | + ```bash |
| 69 | + git tag -a v2.5.0 -m "Release v2.5.0" |
| 70 | + git push origin tag v2.5.0 |
| 71 | + ``` |
| 72 | + |
| 73 | +3. GitHub Actions will: |
| 74 | + - Build binaries for all platforms |
| 75 | + - Create a GitHub release |
| 76 | + - Push Docker images to GHCR |
| 77 | + |
| 78 | +## License |
| 79 | + |
| 80 | +By contributing, you agree that your contributions will be licensed under the MIT License. |
0 commit comments