Skip to main content

Development guidelines

Contributing workflow​

  1. Check open issues and pull requests before starting. Discuss larger features and refactors first.
  2. Fork the repository, create a focused branch from nx2, and follow the coding guidelines.
  3. Build and test the affected behavior. For platform setup and dependencies, see Building.
  4. Review your diff, then open a pull request to Djihads80/Eglantine with nx2 as its base. Explain the problem, the change, and how you tested it; link related issues.
  5. Keep the branch up to date with nx2 and respond to review feedback. Maintainers may modify submitted patches.
AI-assisted contributions

Follow the AI policy: disclose AI use in both the commit message and pull request description, review and test the changes yourself, and be prepared to explain and revise every line. Commit messages and pull request descriptions must be written by you. AI agents must not add sign-off or co-author trailers.

Build and test​

Configure and build a release configuration with CMake and Ninja:

cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release
cmake --build build --parallel

For a change that affects tests, enable test targets when configuring. YUZU_TESTS defaults to BUILD_TESTING; building production binaries in CI disables both.

cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON
cmake --build build --target tests --parallel
ctest --test-dir build --output-on-failure

To run a Catch2 test by tag directly:

./build/bin/tests "[ampere]"
note

Choose tests that exercise the changed code, and manually verify behavior that automated tests do not cover. CI builds binaries for supported platforms; it does not replace testing the affected behavior.

Formatting and spelling​

The Qt frontend formatting helper formats C++ files under src/qt_common and src/yuzu using src/.clang-format. Run it from the repository root:

tools/clang-format.sh

For a single C++ file, use clang-format with the project style:

clang-format -i -style=file:src/.clang-format path/to/file.cpp

The repository has .codespellrc configuration, but current GitHub workflows do not define a codespell check or a project-wide linter command. Do not treat the formatting helper as a whole-repository formatter.

Commits and pull request review​

Use a concise, human-written commit subject that describes the intent. The legacy examples below show the project's optional namespace and type-prefix convention; keep namespaces focused and generally no deeper than two levels (with hle as the stated exception).

[desktop] feat: implement firmware install from ZIP
[core] test: raise maximum CPU cores to 6
[cmake, core] Unbreak FreeBSD building process

Commit messages inside a pull request are not required to use namespaces, but it is recommended. Maintainers may change namespaces. Follow the AI policy's commit-message disclosure requirements when applicable.

Before requesting review

Review the complete diff, check for unrelated changes, and include concise reproduction or verification steps in the pull request. Test the changes yourself; reviewers may ask for revisions, and maintainers may update patches.

Adding settings​

When adding a setting, use tr("Setting:") for a field label and tr("Setting") for a yes/no or checkbox label. Prefer sensible defaults, keep debug settings off by default, set reasonable bounds, and use a short description. Consider whether the behavior can be detected automatically before adding a setting.

Assets​

Before adding assets, consider optimizing them:

FormatSuggested tool
PNGoptipng
SVGsvgo
OGGOptiVorbis
Videoffmpeg (AV1 is preferred where suitable)