Contributing to gringotts
There are many ways to contribute to gringotts
,
- Integrate a new Payment Gateway.
- Expanding the feature coverage of (partially) supported gateways.
- Moving forward on the roadmap or on tasks being tracked in the milestones.
We manage our development using milestones and issues so if you're
a first time contributor, look out for the good first issue
and the hotlist: community-help
labels on the issues
page.
The docs are hosted on hexdocs.pm and are updated for each
release. You must build the docs locally using mix docs
to get the bleeding
edge developer docs.
The article on Gringott's Architecture explains how API calls are processed.
❗ Please base your work on the dev
branch.
We follow lexmag/elixir-style-guide and rrrene/elixir-style-guide (both overlap a lot), and use the elixir formatter.
To enforce these, and also to make it easier for new contributors to adhere to
our style, we've provided a collection of handy git-hooks
under the .scripts/
directory.
.scripts/pre-commit
Runs theformat --check-formatted
task..scripts/post-commit
Runs a customisedcredo
check.
While we do not force you to use these hooks, you could write your very own by taking inspiration from ours 😄
To set the git-hooks
as provided, go to the repo root,
cd path/to/gringotts/
and make these symbolic links:
ln -s .scripts/pre-commit .git/hooks/pre-commit
ln -s .scripts/post-commit .git/hooks/post-commit
Note that our CI will fail your PR if you dont run
mix format
in the project root.
- Keep line length below 100 characters.
- Complex anonymous functions should be extracted into named functions.
- One line functions, should only take up one line!
- Pipes are great, but don't use them if they are less readable than brackets!
All our docs are inline and built using ExDocs
. Please take a look
at how the docs are structured for the MONEI gateway for
inspiration.
This is WIP.
gringotts
has mock and integration tests. We have currently used
bypass
and mock
for mock tests, but we don't recommed
using mock
as it constrains tests to run serially. Use mox
instead.
Take a look at MONEI's mock tests for inspiration.
Each PR should introduce a focussed set of changes, and ideally not span over unrelated modules.
- Format the project with the Elixir formatter.
cd path/to/gringotts/ mix format
- Run the edited files through credo with the
--strict
flag.cd path/to/gringotts/ mix credo --strict
- Check the test coverage by running
mix coveralls
. 100% coverage is not strictly required. - If the PR introduces a new Gateway or just Gateway specific changes,
please format the title like so,
[<gateway-name>] <the-title>
Note You can skip the first two steps if you have set up
git-hooks
as we have provided!
Where to next? Wanna add a new gateway? Head to our guide for that.