# Contributing If you want to contribute code to the HELIPORT repository, please make sure to follow these guidelines. ## Code Formatting The Python code should be formatted by running the following [Ruff](https://docs.astral.sh/ruff/) commands: ```bash # fix lint violations ruff check --fix . # format code ruff format . ``` Django templates should be formatted using [djLint](https://djlint.com/): ```bash djlint --lint --reformat . ``` The programs `ruff` and `djlint` can be installed from PyPI, e.g. via `pipx`. JavaScript, CSS, YAML, and various other types of files should be formatted using [Prettier](https://prettier.io/). A Yarn command is provided for this purpose: ```bash yarnpkg format ``` ## Licensing Please make sure to add a license header to all new files. The [REUSE](https://reuse.software/) tool can help you with this: ```bash reuse annotate --license GPL-3.0-or-later --copyright "Your institution" path/to/file ``` You can check if the code is up to the [REUSE](https://reuse.software/) spec like this: ```bash reuse lint ``` `reuse` can be installed from PyPI, e.g. via `pipx`. ## Git Hooks For automated checks during `git commit`, the pre-commit hook provided in the repository can be used. You can activate it by copying or linking it into the `.git/hooks` directory: ```bash ln -rs .gitlab/bin/pre-commit.py .git/hooks/pre-commit ``` If you use set up HELIPORT as a git submodule, the hooks need to be linked via the parent git directory: ```bash ln -rs .gitlab/bin/pre-commit.py ../.git/modules/heliport/hooks/pre-commit ``` The checks prevent the creation of a commit if the code does not follow the conventions. They can be skipped using `git commit --no-verify`.