Skip to content

package-defined

Protobufstyleno fixdefault: offprotobuf/buf-standard

Reports a file without a package statement.

Without a package every name is global, so two files from different projects that define Order collide, and the generated code puts the types in the default namespace.

To fix, add a package statement.

Reported
import public "google/protobuf/empty.proto";
message Old {
...
protobuf:
lint:
rules:
package-defined: warn # off (default), warn, error

Enabled by the presets: protobuf/buf-standard.

Suppress one line with sudsy-disable-next-line package-defined in a comment of the file’s language.

The same check in other tools; Sudsy reports what each upstream rule reports.

Tool Rule Match
buf PACKAGE_DEFINED full