Skip to content

import-no-public

Protobufsuspiciousno fixdefault: offprotobuf/buf-standard

Reports import public.

A public import makes the imported file’s names visible to every file that imports this one. The dependency spreads without being written down, and a change in the imported file breaks files that never mention it.

To fix, import the files where their names are used.

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

Enabled by the presets: protobuf/buf-standard.

Suppress one line with sudsy-disable-next-line import-no-public 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 IMPORT_NO_PUBLIC full