def noun

bend-lint-rules@0.2.0.0 · layout/case.bend:204

import bend-lint-rules@0.2.0.0/layout/case.bend as Case
import Base
import bend-lint-api@0.2.0.0/linter/lint.bend as Lint

204# A name of `syntax`, in a message. `sort`: whether it is a type.
205def noun(syntax: Lint.Syntax, sort: Bool) -> String:
206  match syntax sort:
207    case Lint.Import{t} _:
208      "an import alias"
209    case Lint.Datatype{t} _:
210      "a type"
211    case Lint.Constructor{t} _:
212      "a constructor"
213    case Lint.Law{t} _:
214      "a law"
215    case Lint.Definition{t, u} True{}:
216      "a def that returns a type"
217    case Lint.Definition{t, u} False{}:
218      "a def that does not return a type"
219    case Lint.Parameter{b, q} True{}:
220      "a parameter that is a type"
221    case Lint.Parameter{b, q} False{}:
222      "a parameter that is not a type"
223    case Lint.Field{b, q} True{}:
224      "a field that is a type"
225    case Lint.Field{b, q} False{}:
226      "a field that is not a type"
227    case _ _:
228      "a variable"

Uses (3)

Used by (1)