Skip to content

Latest commit

 

History

History
40 lines (25 loc) · 970 Bytes

code-style.md

File metadata and controls

40 lines (25 loc) · 970 Bytes

Code Style Guide

This project enforces consistent code style across both Kotlin and C++ codebases.

Kotlin Style

This project uses ktlint to maintain Kotlin code style.

To check Kotlin code style:

./gradlew ktlintCheck

To format Kotlin code automatically:

./gradlew ktlintFormat

C++ Style

This project uses clang-format to maintain C++ code style based on the project's .clang-format configuration file.

To format C++ code, you need to have clang-format installed:

Automatic Formatting

For convenience, a script is provided to format both Kotlin and C++ code in a single command:

# From the project root directory
./scripts/format.sh

The script will:

  1. Format all Kotlin code using ktlint
  2. Format all C++ code in app/src/main/cpp using clang-format
  3. Report any files that were modified during formatting