Welcome! As a Cactus IO project, you can follow the Cactus contributor guide.
JupyterHub requires PHP >= 7.4
As a PHP project, a development install of php follows standard practices for the basics (steps 1-2).
-
clone the repo
git clone https://github.com/cactus-io/mammillaria
-
do a development install with php composer
cd mammillaria composer install
-
install the development requirements, which include things like docker tools
Cactus has adopted automatic code formatting so you shouldn't need to worry too much about your code style. As long as your code is valid, the pre-commit hook should take care of how it should look. You can invoke the pre-commit hook by hand at any time with:
vendor/php/pre-commit run
which should run any autoformatting on your code and tell you about any errors it couldn't fix automatically. You may also install black integration into your text editor to format code automatically.
If you have already committed files before setting up the pre-commit
hook with pre-commit install
, you can fix everything up using
pre-commit run --all-files
. You need to make the fixing commit
yourself after that.
It's a good idea to write tests to exercise any new features, or that trigger any bugs that you have fixed to catch regressions.
You can run the tests with:
vendor/bin/phpunit