Skip to content

Commit

Permalink
Add aliases for typos in enum values
Browse files Browse the repository at this point in the history
Signed-off-by: Pierre R. Mai <[email protected]>
  • Loading branch information
pmai committed Feb 26, 2024
1 parent 8a25677 commit 0f6d424
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 1 deletion.
10 changes: 10 additions & 0 deletions osi_featuredata.proto
Original file line number Diff line number Diff line change
Expand Up @@ -916,6 +916,10 @@ message CameraDetection
//
enum Color
{
// Allow aliases in enum
//
option allow_alias = true;

// Color of the shape is unknown (must not be used in ground
// truth).
//
Expand All @@ -931,6 +935,12 @@ message CameraDetection

// Shape with gray color.
//
COLOR_GRAY = 3;

// Shape with gray color.
//
// \note Deprecated variant spelling of COLOR_GRAY
//
COLOR_GREY = 3;

// Shape with white color.
Expand Down
22 changes: 21 additions & 1 deletion osi_object.proto
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,10 @@ message StationaryObject
//
enum Material
{
// Allow aliases in enum
//
option allow_alias = true;

// Type of the material is unknown (must not be used in ground
// truth).
//
Expand Down Expand Up @@ -254,6 +258,12 @@ message StationaryObject

// Glass structure.
//
MATERIAL_GLASS = 7;

// Glass structure.
//
// \note Deprecated variant spelling of MATERIAL_GLASS
//
MATERIAL_GLAS = 7;

// Mud structure.
Expand Down Expand Up @@ -303,6 +313,10 @@ message StationaryObject
//
enum Color
{
// Allow aliases in enum
//
option allow_alias = true;

// Color is unknown (must not be used in ground truth).
//
COLOR_UNKNOWN = 0;
Expand Down Expand Up @@ -339,7 +353,13 @@ message StationaryObject
//
COLOR_BLACK = 8;

// GREY.
// GRAY.
//
COLOR_GRAY = 9;

// GRAY.
//
// \note Deprecated variant spelling of COLOR_GRAY
//
COLOR_GREY = 9;

Expand Down
6 changes: 6 additions & 0 deletions tests/test_invalid_enum.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ def test_correct_enum_name(self):
if matchComment is not None:
statement = line[: matchComment.start()]
comment = line[matchComment.end() :]
elif re.search("option allow_alias", line):
statement = ""
comment = ""
else:
statement = line
comment = ""
Expand Down Expand Up @@ -123,6 +126,9 @@ def test_invalid_enum(self):
if matchComment is not None:
statement = line[: matchComment.start()]
comment = line[matchComment.end() :]
elif re.search("option allow_alias", line):
statement = ""
comment = ""
else:
statement = line
comment = ""
Expand Down

0 comments on commit 0f6d424

Please sign in to comment.