import-no-public
What it does
Section titled “What it does”Reports import public.
Why it matters
Section titled “Why it matters”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.
Example
Section titled “Example”import public "google/protobuf/empty.proto";
message Old {...Configuration
Section titled “Configuration”protobuf: lint: rules: import-no-public: warn # off (default), warn, errorEnabled 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.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools; Sudsy reports what each upstream rule reports.
| Tool | Rule | Match |
|---|---|---|
| buf | IMPORT_NO_PUBLIC |
full |