Thanks for considering contributing to Roact! This guide has a few tips and guidelines to make contributing to the project as easy as possible.
Any bugs (or things that look like bugs) can be reported on the GitHub issue tracker.
Make sure you check to see if someone has already reported your bug first! Don't fret about it; if we notice a duplicate we'll send you a link to the right issue!
If there are any features you think are missing from Roact, you can post a request in the GitHub issue tracker.
Just like bug reports, take a peak at the issue tracker for duplicates before opening a new feature request.
Roact's documentation is built using MkDocs, a fairly simple documentation generator.
All of the dependencies that we use to generate the documentation website are located in requirements.txt; once they're set up, use mkdocs serve
to test the documentation locally.
To get started working on Roact, you'll need:
- Git
- Lua 5.1 with LuaRocks
- LuaFileSystem (
luarocks install luafilesystem
) - Luacheck (
luarocks install luacheck
) - LuaCov (
luarocks install luacov
)
Make sure you have all of the Git submodules for Roact downloaded, which include a couple extra dependencies used for testing.
Finally, you can run all of Roact's tests with:
lua spec.lua
Or, to generate a LuaCov coverage report:
lua -lluacov spec.lua
luacov
Before starting a pull request, open an issue about the feature or bug. This helps us prevent duplicated and wasted effort. These issues are a great place to ask for help if you run into problems!
Before you submit a new pull request, check:
- Code Style: Match the existing code!
- Changelog: Add an entry to CHANGELOG.md
- Luacheck: Run Luacheck on your code, no warnings allowed!
- Tests: They all need to pass!
Try to match the existing code style! In short:
- Tabs for indentation
- Double quotes
- One statement per line
Eventually we'll have a tool to check these things automatically.
Adding an entry to CHANGELOG.md alongside your commit makes it easier for everyone to keep track of what's been changed.
Add a line under the "Current master" heading. When we make a new release, all of those bullet points will be attached to a new version and the "Current master" section will become empty again.
We use Luacheck for static analysis of Lua on all of our projects.
From the command line, just run luacheck lib
to check the Roact source.
You should get it working on your system, and then get a plugin for the editor you use. There are plugins available for most popular editors!
When submitting a bug fix, create a test that verifies the broken behavior and that the bug fix works. This helps us avoid regressions!
When submitting a new feature, add tests for all functionality.
We use LuaCov for keeping track of code coverage. We'd like it to be as close to 100% as possible, but it's not always easy.