mainis the stable/integration branch.- Feature work happens on dedicated branches (e.g.
Game,gui,gui-network) and is merged back via pull requests.
This project follows Conventional Commits:
<type>(<scope>): <short summary>
Allowed types: feat, fix, docs, style, refactor, perf, test,
build, ci, chore, revert.
The scope is usually server, gui, or a sub-area
(e.g. server/game, gui/audio, make, nix).
Following @commitlint/config-conventional,
the header line must also respect:
typeandscopeare lowercase- the description doesn't start with an uppercase letter (no Sentence-case/Start-case/PascalCase/UPPER-CASE)
- the description doesn't end with a
. - the whole header is at most 100 characters
Examples from the repository's history:
fix(server/game): improve debug messages in GameLogic
feat(make): move to vcpkg to download gui's required packages
fix(gui/audio): use the system's miniaudio header file
A commit-msg git hook (.githooks/commit-msg)
rejects commits whose first line doesn't match the rules above. Enable it
once per clone:
make hooksThis runs git config core.hooksPath .githooks, so the hook applies to every
commit you make in this repository going forward. Merge/Revert commits
generated by git are exempted automatically.
-
C++20, formatted with
clang-format. Run before committing:make format
-
Compiler warnings are treated strictly (
-Wall -Wextra -Wpedanticplus a curated set of-Werror=...flags, seeserver/CMakeLists.txtandgui/CMakeLists.txt). New code must build warning-clean.
- Create
server/src/Commands/<Name>.{hpp,cpp}(orserver/src/Commands/Gui/<name>.{hpp,cpp}for GUI-facing commands) implementingICommand. - Implement the actual game-state mutation in
game::GameLogicif needed. - Register the command in
Client::registerCommands()(server/src/Client.cpp), in_aiCommandsor_guiCommandsas appropriate.
- Create
gui/src/Scene/<Name>.hppimplementingIScene(onEnter,update,draw,onExit). - Add a matching value to
Zappy::SceneState(gui/src/IScene/IScene.hpp). - Handle the transition in
SceneManager::update.
Only add new third-party C++ dependencies to the GUI via vcpkg
(gui/vcpkg.json) — see INSTALLATION.md. Do not vendor
single-header libraries into gui/src/Utils/ or add ad-hoc
file(DOWNLOAD ...) steps to CMake.
Every component has an automated suite — see TESTING.md for the full picture. Run them all with:
make tests_runWhen you change behavior, add or update the matching test:
- Server game logic → a Criterion case in
server/tests/unit/(link-time access toGameLogic,Player,Map,Team, ...). KeepTest(...)names unique. - Server protocol → a pytest case in
server/tests/functional/, driving a real server withzappy_client.py. - AI → a pytest case in
ai/tests/, using the async fakes infakes.py(no real socket needed). - GUI → a Criterion case in
gui/tests/: math helpers, or protocol parsing via a fakeINetworkClient.
New tests must keep the suites green and add no compiler warnings.
- Keep PRs scoped to one area (
server,guiorai) when possible. - Ensure
makesucceeds forzappy_server,zappy_guiandzappy_ai, and thatmake tests_runpasses, before opening a PR. - Run
make formatto avoid noisy formatting diffs.