glinter/annotation

Types

pub type Annotation {
  Annotation(
    rules: List(String),
    comment_line: Int,
    target_line: Int,
    scope: Scope,
    inline: Bool,
  )
}

Constructors

  • Annotation(
      rules: List(String),
      comment_line: Int,
      target_line: Int,
      scope: Scope,
      inline: Bool,
    )

    Arguments

    inline

    True when the nolint comment trails real code on the same line, e.g. panic as "x" // nolint: avoid_panic. Inline placement is disallowed because gleam format may move the comment off the line when wrapping, silently breaking the suppression. Inline annotations do NOT suppress; the runner emits a nolint_inline warning instead.

pub type Scope {
  LineScope
  FunctionScope
  Stale
}

Constructors

  • LineScope
  • FunctionScope
  • Stale

Values

pub fn is_inline(line: String) -> Bool

True when there’s real code before the nolint comment on the same line.

pub fn parse(source: String) -> List(Annotation)

Parse source text for // nolint: comments and return annotations.

Search Document