Skip to content

Latest commit

 

History

History
45 lines (32 loc) · 2.09 KB

STYLE.md

File metadata and controls

45 lines (32 loc) · 2.09 KB

General file style

  • General style guidelines -- like newlines at the end of file -- are linted for using pre-commit
  • The rules enforced are available in the repo's .pre-commit-config.yaml file.
  • You can install pre-commit locally with these instructions.
  • The linter may be run locally using pre-commit run --all-files. Additionally it can be installed as a commit hook with pre-commit install.

C++ coding style

Java coding style

  • Java code is auto-formatted using clang-format with these rules

Objective-C coding style

  • Objective-C code is auto-formatted using clang-format with these rules

Kotlin coding style

  • Kotlin code style is validated using detekt
  • The rules enforced are available in the repo's .kotlinlint.yml file. We build upon the default config provided by detekt

Swift coding style

  • Swift code style is validated using SwiftLint
  • The rules enforced are available in the repo's .swiftlint.yml file
  • The linter may be run locally using swiftlint or auto-corrected with swiftlint autocorrect

Shared constructs

  • There's no directly supported way to universally share an enumeration across platforms. In order to provide some enforced consistency, we've adopted the convention of defining the enum at the lowest applicable layer (core/bridge) of the library, and then declaring public extern const values defined in terms of the enumeration, to be shared across bridge and platform code. See, for example: