Skip to content

Commit

Permalink
Merge pull request #72 from OpenSimulationInterface/enum-rules
Browse files Browse the repository at this point in the history
Changed ruleset for Enum types.
  • Loading branch information
pmai authored Mar 11, 2024
2 parents 8ca260f + 68f5224 commit 7214d50
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 shall always use the suffix _UNKNOWN_.
The second enum field shall 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 7214d50

Please sign in to comment.