Skip to content

Commit

Permalink
doc: first shot at a contributing guide
Browse files Browse the repository at this point in the history
  • Loading branch information
ahamez committed Jan 2, 2025
1 parent 6d34dc2 commit b965104
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 8 deletions.
57 changes: 57 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# How to contribute to protox
First, thank you for your interest in contributing to protox!

Here are some guidelines to follow and some tips when contributing to protox.

## Development Prerequisites
- Erlang/OTP 26 or later
- Elixir 1.15 or later
- (optional) [lefthook](https://evilmartians.github.io/lefthook/installation) for git hooks

## Development Guidelines
To enforce consistent code style and quality, we use the following tools:
- [`mix deps.unlock --check-unused`](https://hexdocs.pm/mix/Mix.Tasks.Deps.Unlock.html) to check for unused dependencies
- [`mix format --check-formatted`](https://hexdocs.pm/mix/Mix.Tasks.Format.html) to check for code formatting issues
- [`mix credo`](https://hexdocs.pm/credo/Mix.Tasks.Credo.html) for code style and consistency checks
- [`mix dialyzer`](https://hexdocs.pm/dialyxir/Mix.Tasks.Dialyzer.html) for type checking
- [`mix muzak`](https://hexdocs.pm/muzak_pro/muzak-pro.html) for mutation testing
- `mix test --include conformance` for testing

> [!NOTE]
>
> These tasks are always run in the CI pipeline.
> [!NOTE]
>
> `lefthook` can be used to run these tasks automatically on each commit or push (except for the `muzak` task which takes a long time to run).
> [!NOTE]
>
> `mix test --include conformance` automatically downloads and compilesthe conformance test suite and runs it against the current version of protox.
### Testing
- Add tests for any new features or bug fixes.
- Ensure all tests pass with `mix test --include conformance`.
- Try to maintain or improve test coverage (check with `mix test --cover`).

### Documentation
- Document public functions using ExDoc format.
- Update module documentation when needed.
- If possible, include examples in documentation.
- Update README.md if needed.

## Pull Request Process
Submit a Pull Request with:
- Clear description of changes
- Reference to any related issues
- Examples of new functionality if applicable

## License
By contributing to Protox, you agree that your contributions will be licensed under MIT License.

## Getting Help
If you have questions or need help, you can:
- Send me a direct message on [Elixir Forum](https://elixirforum.com/u/ahamez).
- Send me an email at alexandre.hamez at gmail.com.
- Open an issue.
- Start a discussion at https://github.com/ahamez/protox/discussions.
13 changes: 5 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ You can find [here](https://github.com/ahamez/protox/blob/master/test/example_te
- [Conformance](#conformance)
- [Types mapping](#types-mapping)
- [Benchmarks](#benchmarks)
- [Development](#development)
- [Contributing](#contributing)
- [Credits](#credits)

## Prerequisites

- Elixir >= 1.12
- Elixir >= 1.15
- protoc >= 3.0 *This dependency is only required at compile-time*
`protox` uses Google's `protoc` (>= 3.0) to parse `.proto` files. It must be available in `$PATH`.

Expand Down Expand Up @@ -540,7 +540,7 @@ mix protox.conformance
### Skipped conformance tests
You may have noticed that there are `21 expected failures`. Indeed, we removed on purpose some conformance tests that `protox` can't currently pass. Here are the reasons why:
You may have noticed that there are `XXX expected failures`. Indeed, we removed on purpose some conformance tests that `protox` can't currently pass. Here are the reasons why:

- [Any](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#any) is not yet supported by `protox`;
- We could not find the specification for the protobuf2 case of field name extensions when decoding from JSON.
Expand Down Expand Up @@ -583,12 +583,9 @@ mix run ./benchmarks/run.exs --lib=./benchmarks/protox.exs
mix run ./benchmarks/load.exs
```
## Development
## Contributing
`protox` uses [`pre-commit`](https://pre-commit.com/#install) to launch git hooks. Thus, it's strongly recommended to install it, and then to install hooks as follows:
```sh
pre-commit install && pre-commit install -t pre-push
```
Please see [CONTRIBUTING.md](CONTRIBUTING.md) for more information.
## Credits
Expand Down

0 comments on commit b965104

Please sign in to comment.