Skip to content

Non-conformance with protolint and protoc #9

@ksemelka

Description

@ksemelka

Something I've been having trouble with is not seeing the same syntax enforcement between protolint, protoc, and the pbtools C code generator.

For example, the following .proto definition will cause an error enforced by protolint and protoc, but not by pbtools:

Enum value defined multiple times in the same message

syntax = "proto3";

message foo
{
  enum bar 
  {
    UNSPECIFIED = 0;
  }
  enum zoo
  {
    UNSPECIFIED = 0;
  }
}

Error:

$ protoc --python_out=.  foo.proto
foo.proto:11:5: "UNSPECIFIED" is already defined in "foo".
foo.proto:11:5: Note that enum values use C++ scoping rules, meaning that enum values are siblings of their type, not children of it.  Therefore, "UNSPECIFIED" must be unique within "foo", not just within "zoo".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions