no_unused/imports.bend checks
raw source on the hub · import bend-lint-rules@0.3.4.0/no_unused/imports.bend as Imports
no_unused/imports: an import that nothing in its file uses. Fix: deletes the import's line. Heuristics: a use is a name written through the import's alias, or, for Base, a name that only Base declares (Imported in the rule API). An import of an impl.bend whose file also imports the spec.bend beside it is used: it fills the spec's laws, which the file uses through the spec's names (see the experimental-bend-spec skill).
4 imports
import Base import bend-lint-api@0.3.4.0/linter/api/impl.bend as LintImpl import bend-lint-api@0.3.4.0/linter/api/spec.bend as Lint import bend-lint-api@0.3.4.0/shared.bend as Shared
Definitions
def deleted source · line 12 · raw
@+text:String -> @path:String -> @at:U32 -> List<&2, 0x94bdd21968f0b8ad8c1be0e7e2b606a0/linter/api/spec.Fix>
The fix that deletes the import's line.
def stem source · line 22 · raw
@+target:String -> String
An import's target without .bend, if the check names it so.
def targets source · line 31 · raw
@declarations:List<&2, 0x94bdd21968f0b8ad8c1be0e7e2b606a0/linter/api/spec.Declaration> -> @out:List<&2, String> -> List<&2, String>
The targets of the imports among declarations, without .bend, onto out.
def has source · line 41 · raw
@targets:List<&2, String> -> @+x:String -> @found:Bool -> Bool
Whether x is one of targets, or found.
def links.if source · line 50 · raw
@impl:Bool -> @+s:String -> @targets:List<&2, String> -> Bool
def links source · line 59 · raw
@target:String -> @targets:List<&2, String> -> Bool
Whether the import of target fills laws its file uses: it is an impl.bend, and the file imports the spec.bend
beside it, among targets.
def reported source · line 63 · raw
@linked:Bool -> @text:String -> @+path:String -> @+beg:U32 -> @end:U32 -> @name:String -> List<&2, 0x94bdd21968f0b8ad8c1be0e7e2b606a0/linter/api/spec.Finding>
def unused source · line 84 · raw
@text:String -> @targets:List<&2, String> -> @d:0x94bdd21968f0b8ad8c1be0e7e2b606a0/linter/api/spec.Declaration -> List<&2, 0x94bdd21968f0b8ad8c1be0e7e2b606a0/linter/api/spec.Finding>
def findings source · line 94 · raw
@declarations:List<&2, 0x94bdd21968f0b8ad8c1be0e7e2b606a0/linter/api/spec.Declaration> -> @+text:String -> @+targets:List<&2, String> -> @out:List<&2, 0x94bdd21968f0b8ad8c1be0e7e2b606a0/linter/api/spec.Finding> -> List<&2, 0x94bdd21968f0b8ad8c1be0e7e2b606a0/linter/api/spec.Finding>
def run source · line 111 · raw
@+here:0x94bdd21968f0b8ad8c1be0e7e2b606a0/linter/api/spec.Here -> 0x94bdd21968f0b8ad8c1be0e7e2b606a0/linter/api/spec.Ask(List<&2, 0x94bdd21968f0b8ad8c1be0e7e2b606a0/linter/api/spec.Finding>)
def rule source · line 115 · raw
0x94bdd21968f0b8ad8c1be0e7e2b606a0/linter/api/spec.Rule