# Contributing to KOutNet Thanks for taking the time to contribute. This document covers where work happens, how to set up a build, what to check locally, and what CI expects. Please also read the [Code of Conduct](CODE_OF_CONDUCT.md). It applies everywhere in this project, including issues and merge requests. ## Where things happen - Development, code review, and merge requests: - Tasks and bugs: (as linked from the [README](README.md)) If you plan to work on anything beyond a small fix, open or comment on an issue/task first so the approach can be discussed before you spend time on implementation. This is especially important for changes touching security- sensitive or protocol-critical areas such as `CryptoManager`, `NetworkManager`, `FrameRouter`, `SessionTransport`, `TlsChannel`, or file transfer code. ## Setting up a build See the [build](README.md#build) section of the README for dependencies and platform notes. In short: ```bash cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF cmake --build build --parallel ./build/bin/KOutNet ``` To work on tests, configure without `-DBUILD_TESTING=OFF`: ```bash cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release cmake --build build --parallel ``` Windows packaging/build notes are in `build-windows.ps1` and [packaging/windows/README.md](packaging/windows/README.md). ## Running the tests ```bash ctest --test-dir build --output-on-failure ``` The test suite currently contains 23 CTest tests (including `koutnet-crypto-manager`, `koutnet-file-transfer-handler`, network, UI, and other coverage). The tests are intended to run without a display or external network services. When you change packet handling, chunk reassembly, crypto, transport/auth, or other edge-case-heavy logic, add or extend the relevant tests. ## Code style - The build enforces `QT_NO_KEYWORDS` and `QT_NO_CAST_FROM_ASCII`. Use `Q_SIGNALS`, `Q_SLOTS`, and `Q_EMIT`, not the lowercase Qt keywords, and prefer `QStringLiteral` / Qt string APIs over bare C string literals where appropriate. - Formatting follows the repository `.clang-format` and is checked in CI with `clang-format-18`. - If `kde_configure_git_pre_commit_hook` installed a pre-commit hook in your checkout, it can format staged changes for you. - User-visible strings must be translatable and use `i18n`/`i18nc`/`i18np`/ `i18ncp` with clear, descriptive contexts (not placeholders). `Messages.sh` regenerates `po/koutnet.pot` from the sources. ## Licensing Licensing follows [REUSE](https://reuse.software/). `reuse lint` runs in CI, and every new file needs an SPDX header, for example: ```text SPDX-FileCopyrightText: SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL ``` Use the name and email you want attributed publicly. If you bring in code adapted from elsewhere (for example, parts adapted from NeoChat or plasma-welcome, as noted in the README), keep the original attribution in SPDX headers and clearly document the upstream source in the merge request. ## Before opening a merge request A draft merge request is welcome if you want early feedback before polishing. Run relevant local checks before opening or updating a merge request: ```bash reuse lint find src \( -name '*.cpp' -o -name '*.h' \) -print0 \ | xargs -0 clang-format-18 --dry-run --Werror ctest --test-dir build --output-on-failure ``` CI coverage (summary): - **GitHub mirror (`.github/workflows/lint.yml`):** `reuse lint`, AppStream/desktop metadata validation, and `clang-format-18`. - **KDE Invent/GitLab (`.gitlab-ci.yml`):** KDE `sysadmin/ci-utilities` templates for formatting and linting (clang-format, REUSE, YAML/XML/QML lint, cppcheck), Linux/Windows Qt6 build and test jobs, plus AppStream/desktop metadata validation. ## Translations Translatable strings live in `po/`. `Messages.sh` regenerates the template from source. Translation improvements are welcome independently of code changes — open a merge request with updates to the relevant `po//` files.