Skip to content

Commit 0f6d424

Browse files
committed
Add aliases for typos in enum values
Signed-off-by: Pierre R. Mai <[email protected]>
1 parent 8a25677 commit 0f6d424

File tree

3 files changed

+37
-1
lines changed

3 files changed

+37
-1
lines changed

osi_featuredata.proto

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -916,6 +916,10 @@ message CameraDetection
916916
//
917917
enum Color
918918
{
919+
// Allow aliases in enum
920+
//
921+
option allow_alias = true;
922+
919923
// Color of the shape is unknown (must not be used in ground
920924
// truth).
921925
//
@@ -931,6 +935,12 @@ message CameraDetection
931935

932936
// Shape with gray color.
933937
//
938+
COLOR_GRAY = 3;
939+
940+
// Shape with gray color.
941+
//
942+
// \note Deprecated variant spelling of COLOR_GRAY
943+
//
934944
COLOR_GREY = 3;
935945

936946
// Shape with white color.

osi_object.proto

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,10 @@ message StationaryObject
223223
//
224224
enum Material
225225
{
226+
// Allow aliases in enum
227+
//
228+
option allow_alias = true;
229+
226230
// Type of the material is unknown (must not be used in ground
227231
// truth).
228232
//
@@ -254,6 +258,12 @@ message StationaryObject
254258

255259
// Glass structure.
256260
//
261+
MATERIAL_GLASS = 7;
262+
263+
// Glass structure.
264+
//
265+
// \note Deprecated variant spelling of MATERIAL_GLASS
266+
//
257267
MATERIAL_GLAS = 7;
258268

259269
// Mud structure.
@@ -303,6 +313,10 @@ message StationaryObject
303313
//
304314
enum Color
305315
{
316+
// Allow aliases in enum
317+
//
318+
option allow_alias = true;
319+
306320
// Color is unknown (must not be used in ground truth).
307321
//
308322
COLOR_UNKNOWN = 0;
@@ -339,7 +353,13 @@ message StationaryObject
339353
//
340354
COLOR_BLACK = 8;
341355

342-
// GREY.
356+
// GRAY.
357+
//
358+
COLOR_GRAY = 9;
359+
360+
// GRAY.
361+
//
362+
// \note Deprecated variant spelling of COLOR_GRAY
343363
//
344364
COLOR_GREY = 9;
345365

tests/test_invalid_enum.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ def test_correct_enum_name(self):
2525
if matchComment is not None:
2626
statement = line[: matchComment.start()]
2727
comment = line[matchComment.end() :]
28+
elif re.search("option allow_alias", line):
29+
statement = ""
30+
comment = ""
2831
else:
2932
statement = line
3033
comment = ""
@@ -123,6 +126,9 @@ def test_invalid_enum(self):
123126
if matchComment is not None:
124127
statement = line[: matchComment.start()]
125128
comment = line[matchComment.end() :]
129+
elif re.search("option allow_alias", line):
130+
statement = ""
131+
comment = ""
126132
else:
127133
statement = line
128134
comment = ""

0 commit comments

Comments
 (0)