we gladly accept contributions via github pull requests.
- a git client (used for source version control).
- a github account (to contribute changes).
- an ssh client (used to authenticate with github).
- ensure all the dependencies described in the previous section are installed.
- fork
https://github.com/monome/nornsinto your own github account (more on forking here). - if you haven't configured your machine with an ssh key that's known to github then follow these directions.
- navigate to a local directory to hold your sources.
git clone https://github.com/<your_name_here>/norns.gitcd nornsgit remote add upstream https://github.com/monome/norns.git(so that you fetch from the main repository, not your clone, when runninggit fetchet al.)
to start working on a patch:
git fetch upstreamgit checkout upstream/main -b name_of_your_branch- hack away
git commit -a -m "<your brief but informative commit message>"git push origin name_of_your_branch
to send us a pull request (pr):
- go to
https://github.com/monome/nornsand click the "Compare & pull request" button. - be sure and include a description of the proposed change and reference any related issues or folks; note that if the change is significant, consider opening a corresponding github issue to discuss. (for some basic advice on writing a pr, see the github's notes on writing a perfect pr.)
once everyone is happy, a maintainer will merge your pr for you.
to view the api docs for the main branch,
visit https://monome.org/docs/norns/api.
run all tests:
./test.shrun specific test:
# example: run matron `clock.h` tests
./test.sh --targets=test_matron_clocksee tests/README.md for infrastructure details, advanced patterns, and comprehensive examples.
tests mirror source structure. create test_*.cpp files, and they get picked up by the test runner automatically:
tests/matron/test_args.cpp → matron/src/args.c
tests/crone/test_window.cpp → crone/src/Window.cpp
test C code:
#include <doctest/doctest.h>
extern "C" {
#include "args.h"
}
TEST_CASE("args_parse handles local port") {
char *argv[] = {"matron", "-l", "8888", nullptr};
args_parse(3, argv);
CHECK(std::string(args_local_port()) == "8888");
}test C++ code:
#include <doctest/doctest.h>
#include "Window.h"
TEST_CASE("window starts at zero") {
CHECK(Window::raisedCosShort[0] == doctest::Approx(0.0f));
}assertions:
CHECK(expr)— non-fatalREQUIRE(expr)— fatal, stops testCHECK(value == doctest::Approx(expected))— floating point