This guide is aimed at developers wishing to modify or contribute to the program.
In addition to the requirements listed in the User Guide, you'll also need to install Git.
- Open a terminal in a desired folder and run
git clone https://github.com/luphysics/MODA.git
. - The code will download as a folder named
MODA
.
Git hooks are used to automatically perform tasks when a commit is made. MODA uses doctoc
to add the table of contents to markdown files.
Commit your current work, if there are changes. Then open a terminal in the MODA
folder and run:
pip install pre-commit --user # Installs the pre-commit tool.
python -m pre-commit install # Adds the Git hooks to the repository.
On Windows, also run git config core.safecrlf false
in the MODA
folder. This prevents a circular problem where Git cannot commit because it converts line endings to CRLF but doctoc
converts line endings back to LF.
Now that the Git hooks are installed, they will automatically run every time a commit changes relevant files.
⚠️ When a pre-commit hook changes files, you'll need to add files and commit again.