Skip to content

Commit

Permalink
Clearly spell out rules for enum field values
Browse files Browse the repository at this point in the history
Signed-off-by: Pierre R. Mai <pmai@pmsf.de>
  • Loading branch information
pmai committed Mar 8, 2024
1 parent d9b19c5 commit 68f5224
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions content/contributing/naming_conventions.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,12 @@ message EnvironmentalConditions
}
----

Enum field names shall use _UPPER_SNAKE_CASE_.
Enum fields shall always be prefixed with the name of the corresponding enum.
The first enum field should always use the suffix _UNKNOWN_.
The second enum field should always use the suffix _OTHER_.
Enum field value names shall use _UPPER_SNAKE_CASE_.
Enum field value names shall always be prefixed with the name of the corresponding enum.

For enum fields that are concerned with ground truth or sensor data, the first two enum values shall always be defined with the following rules:
The first enum field value shall always use the suffix _UNKNOWN_.
The second enum field value shall always use the suffix _OTHER_.

[source,protobuf,linenums]
----
Expand All @@ -61,4 +63,6 @@ message EnvironmentalConditions
AMBIENT_ILLUMINATION_LEVEL1 = 2;
}
}
----
----

Other enum fields, especially purely technical fields, can deviate from the rules for the first two field values.

0 comments on commit 68f5224

Please sign in to comment.