import-used
What it does
Section titled “What it does”Reports an import of a file none of whose names the file uses. A public import is left alone. It needs the imported files, found from the folder with the module’s buf.yaml; an import it cannot read is not reported.
Why it matters
Section titled “Why it matters”An import that nothing uses makes the file depend on another one for no reason: a change there can break this file, and tools load it for nothing.
To fix, remove the import.
Configuration
Section titled “Configuration”protobuf: lint: rules: import-used: warn # off (default), warn, errorEnabled by the presets: protobuf/buf-standard.
Suppress one line with sudsy-disable-next-line import-used 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_USED |
full |