Contributing to hackney
View SourceThank you for your interest in contributing to hackney!
Getting Started
- Fork the repository
- Clone your fork:
git clone https://github.com/YOUR_USERNAME/hackney.git - Create a branch:
git checkout -b my-feature - Make your changes
- Run tests:
rebar3 eunit - Push and open a pull request
Pull Request Guidelines
Title Format
We use Conventional Commits for PR titles:
<type>: <description>Types:
| Type | Description |
|---|---|
feat | New feature |
fix | Bug fix |
docs | Documentation only |
refactor | Code change that neither fixes a bug nor adds a feature |
perf | Performance improvement |
test | Adding or updating tests |
chore | Maintenance tasks, dependencies |
security | Security fix |
Examples:
feat: add HTTP/3 connection poolingfix: handle timeout in async responsesdocs: update WebSocket guiderefactor: simplify connection state machineperf: reduce memory allocation in header parsingsecurity: update SSL certificate bundle
Description
Include in your PR description:
- What the change does
- Why the change is needed
- How to test it (if applicable)
Development Setup
Requirements
- Erlang/OTP 27+
- rebar3
Building
rebar3 compile
Building with QUIC support
QUIC/HTTP3 requires lsquic and BoringSSL (vendored in c_src/):
HACKNEY_QUIC_OPTS="-DCMAKE_BUILD_TYPE=Release" rebar3 compile
Running Tests
# All tests
rebar3 eunit
# Specific test module
rebar3 eunit --module=hackney_conn_tests
# With verbose output
rebar3 eunit --verbose
Running Dialyzer
rebar3 dialyzer
Code Style
- Follow existing code conventions
- Keep functions short and focused
- Add specs for exported functions
- Update documentation for API changes
Reporting Issues
When reporting bugs, include:
- Erlang/OTP version (
erl -version) - hackney version
- Minimal reproduction case
- Expected vs actual behavior
Questions?
Open an issue or reach out to the maintainers.