From db6c42ff2bf1636ad31dd133f58e9768e050dfe4 Mon Sep 17 00:00:00 2001 From: Jacob Laursen Date: Fri, 7 Apr 2023 22:49:30 +0200 Subject: [PATCH] Add naming convention Signed-off-by: Jacob Laursen --- developers/guidelines.md | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/developers/guidelines.md b/developers/guidelines.md index c2cf4b7f21..f1f5cd072e 100644 --- a/developers/guidelines.md +++ b/developers/guidelines.md @@ -28,8 +28,8 @@ The structure of a binding follows the structure of a typical OSGi bundle projec |---- java Your Java code |-------- org/openhab/[...] |- src/main/resources/OH-INF -|---- binding -|-------- binding.xml Binding name, description and other meta data +|---- addon +|-------- addon.xml Binding name, description and other meta data |---- config Configuration description files when not in things files |-------- *.xml |---- i18n Your localized binding texts @@ -51,6 +51,20 @@ The structure of a binding follows the structure of a typical OSGi bundle projec ## B. Code formatting rules & style +### Naming Convention + +To ensure consistency for users, new bindings should use the following naming convention: + +- Thing type id: `lower-case-hyphen` +- Channel type id: `lower-case-hyphen` +- Channel group id: `lower-case-hyphen` +- Channel id: `lower-case-hyphen` +- Thing property: `camelCase` +- Config parameter: `camelCase` +- Profile URI: `lower-case-hyphen` +- Profile type id for transformations: `UPPER_CASE` +- XML files in src/*/resources: `lower-case-hyphen.xml` + ### Code format In order to keep the code layout consistent, code formatting rules have been defined. @@ -82,7 +96,6 @@ The rules are defined at