Skip to content

Commit

Permalink
Update CONTRIBUTING.md to include grammar validation
Browse files Browse the repository at this point in the history
Summary: Explicitly mention that the grammar is used as the front-end for ELP, and that any change must not break the ability to run `cargo xtask codegen` in ELP.

Reviewed By: perehonchuk

Differential Revision: D50004829

fbshipit-source-id: f9525423922ebec69c366594a936f0c573a01ec2
  • Loading branch information
alanz authored and facebook-github-bot committed Oct 6, 2023
1 parent 4ec4aad commit bb06a83
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,33 @@ We actively welcome your pull requests.
3. Ensure the test suite passes.
4. If you haven't already, complete the Contributor License Agreement ("CLA").

### Grammar Validation

This grammar is used as the front end for the [Erlang Language Platform (ELP)](https://github.com/WhatsApp/erlang-language-platform).

As part of this process, we generate an ELP AST structure from the generated `grammar.json` file.

So a pull request will not be landed until it has matching changes in ELP.

The most important thing is to check that the code generation does not
fail, as it imposes additional constraints on the shape of the grammar.

Thes can be checked by

1. Setting up an ELP development environment according it [CONTRIBUTING](https://github.com/WhatsApp/erlang-language-platform/blob/main/CONTRIBUTING.md)

2. Updating
[Cargo.toml](https://github.com/WhatsApp/erlang-language-platform/blob/c4d3602e08418432a020abb734723727a8374549/Cargo.toml#L94)
to get the `tree-sitter-erlang` crate from your checked out changed `tree-sitter-erlang` repository.

3. In the `ELP` repository, running `cargo xtask codegen`. If it succeeds
without errors, the grammar change is acceptable.

4. For bonus points you can then `cargo build` ELP and deal with
changes induced by the grammar, but that is not necessary.
However, the change will not land until a matching change is made
to ELP by a contributor.

## Contributor License Agreement ("CLA")

In order to accept your pull request, we need you to submit a CLA. You only need
Expand Down

0 comments on commit bb06a83

Please sign in to comment.