def Unmet.add

bend-lint-rules@0.2.0.0 · lib/linter/directives.bend:870

import bend-lint-rules@0.2.0.0/lib/linter/directives.bend as Directives
import Base
import bend-lint-api@0.2.0.0/linter/lint.bend as Lint

870def Unmet.add(
871  used: Bool,
872  action: Action,
873  rule: String,
874  pinned: Maybe<&2, Lint.Severity>,
875  span: Lint.Span,
876  out: List<&2, Lint.Found>
877) -> List<&2, Lint.Found>:
878  match used action:
879    case True{} _:
880      out
881    case False{} Expect{}:
882      Lint.Found{
883        "bend-lint/unmet-expectation",
884        Lint.Finding{
885          Lint.Error{},
886          span,
887          "Expected a "
888            ++ rule
889            ++ "@"
890            ++ Severity.pinned(pinned)
891            ++ " finding on the lines this covers; none.",
892          []
893        }
894      }
895        <> out
896    case False{} Disable{}:
897      Lint.Found{
898        "bend-lint/unused-disable",
899        Lint.Finding{
900          Lint.Warning{},
901          span,
902          "This disables " ++ rule ++ ", but nothing on the lines it covers needs it.",
903          []
904        }
905      }
906        <> out

Uses (11)

Used by (1)