~/bend-docscommunity

lib/linter/directives/impl.bend checks

raw source on the hub · import bend-lint-rules@0.3.3.0/lib/linter/directives/impl.bend as Impl

7 imports
import Base
import bend-lint-api@0.3.3.0/shared.bend as Shared
import bend-lint-api@0.3.3.0/linter/api/impl.bend as LintImpl
import bend-lint-api@0.3.3.0/linter/api/spec.bend as Lint
import ../shared/text/impl.bend as TextImpl
import ../shared/text/spec.bend as Text
import ./spec.bend as Spec

Types

type Action source · line 9 · raw

Data

type Scope source · line 13 · raw

Data

type Linted source · line 20 · raw

Data

type Glyph source · line 37 · raw

Data

Scanning ========

type Mode source · line 48 · raw

Data

Where the scan is: in code, a comment, or a string or char literal (string), maybe just after a \ in it.

type Scan source · line 55 · raw

Data

The scan so far: where it is, its offset and line, whether its line holds code, the comment it is in (its body last first), the comments before (last first), and whether each line before holds code (last first).

type Directive source · line 260 · raw

Data

A directive: what it does, how far, the rule it names, the severity it pins, its comment, and its place among the file's comments.

type Said source · line 271 · raw

Data

A comment that says bend-lint: a directive, or what is wrong with it.

type Words source · line 312 · raw

Data

The words of a text, split at blanks: the word so far, last first, and the words before it, last first.

type Closed source · line 622 · raw

Data

Where a begin was closed: its index, and the line of its end.

type Pairing source · line 626 · raw

Data

The begins open so far (latest first), the begins closed, and what is wrong (last first).

type Covering source · line 735 · raw

Data

A directive and the lines it covers, both ends included (from 1 to 0 covers none).

type Applied source · line 877 · raw

Data

The findings so far: those that stay, those a directive covers (both last first), and the directives that covered one.

Definitions

def Glyph.of source · line 66 · raw

@+c:Char -> Glyph

def Comment.none source · line 100 · raw

0x8cd234c63d1502eb971c1e6f87bd0770/lib/linter/directives/spec.Comment

No comment: what the scan holds as its open comment outside one.

def Comment.closed source · line 104 · raw

@open:0x8cd234c63d1502eb971c1e6f87bd0770/lib/linter/directives/spec.Comment -> @at:U32 -> 0x8cd234c63d1502eb971c1e6f87bd0770/lib/linter/directives/spec.Comment

The comment open, ended at at, its body in order.

def Comment.push source · line 109 · raw

@open:0x8cd234c63d1502eb971c1e6f87bd0770/lib/linter/directives/spec.Comment -> @c:Char -> 0x8cd234c63d1502eb971c1e6f87bd0770/lib/linter/directives/spec.Comment

def Scan.in_code source · line 114 · raw

@glyph:Glyph -> @+at:U32 -> @+line:U32 -> @+code:Bool -> @open:0x8cd234c63d1502eb971c1e6f87bd0770/lib/linter/directives/spec.Comment -> @comments:List<&2, 0x8cd234c63d1502eb971c1e6f87bd0770/lib/linter/directives/spec.Comment> -> @lines:List<&2, Bool> -> Scan

def Scan.in_comment source · line 147 · raw

@glyph:Glyph -> @c:Char -> @+at:U32 -> @line:U32 -> @code:Bool -> @open:0x8cd234c63d1502eb971c1e6f87bd0770/lib/linter/directives/spec.Comment -> @comments:List<&2, 0x8cd234c63d1502eb971c1e6f87bd0770/lib/linter/directives/spec.Comment> -> @lines:List<&2, Bool> -> Scan

def Scan.quote source · line 182 · raw

@string:Bool -> @double:Bool -> Mode

Where a quote leaves the scan: a string's " and a char's ' close it; the other quote does not.

def Scan.in_quote source · line 193 · raw

@string:Bool -> @escaped:Bool -> @glyph:Glyph -> @at:U32 -> @line:U32 -> @code:Bool -> @open:0x8cd234c63d1502eb971c1e6f87bd0770/lib/linter/directives/spec.Comment -> @comments:List<&2, 0x8cd234c63d1502eb971c1e6f87bd0770/lib/linter/directives/spec.Comment> -> @lines:List<&2, Bool> -> Scan

A step in a string or a char literal (string): a \ escapes the next character, its closing quote ends it, and a line it spans holds code.

def Scan.step source · line 226 · raw

@glyph:Glyph -> @c:Char -> @s:Scan -> Scan

def Scan.go source · line 235 · raw

@text:String -> @s:Scan -> Scan

def Scan.done source · line 242 · raw

@s:Scan -> 0x8cd234c63d1502eb971c1e6f87bd0770/lib/linter/directives/spec.Scanned

def Action.names source · line 295 · raw

List<&2, 0x94bdd21968f0b8ad8c1be0e7e2b606a0/shared.Names.Named<Action>>

def Scope.names source · line 298 · raw

List<&2, 0x94bdd21968f0b8ad8c1be0e7e2b606a0/shared.Names.Named<Scope>>

def Severity.pinned source · line 305 · raw

@severity:Maybe<&2, 0x94bdd21968f0b8ad8c1be0e7e2b606a0/linter/api/spec.Severity> -> String

def Severity.is_eq source · line 308 · raw

@a:Maybe<&2, 0x94bdd21968f0b8ad8c1be0e7e2b606a0/linter/api/spec.Severity> -> @b:Maybe<&2, 0x94bdd21968f0b8ad8c1be0e7e2b606a0/linter/api/spec.Severity> -> Bool

def Words.step source · line 315 · raw

@blank:Bool -> @c:Char -> @w:Words -> Words

def Words.go source · line 324 · raw

@s:String -> @w:Words -> Words

def Words.done source · line 331 · raw

@w:Words -> List<&2, String>

def Words.of source · line 338 · raw

@s:String -> List<&2, String>

def Draft.kind source · line 341 · raw

@parts:List<&2, String> -> Maybe<&2, 0x8cd234c63d1502eb971c1e6f87bd0770/lib/linter/directives/spec.Keyword>

def Draft.is_rule_id source · line 352 · raw

@parts:List<&2, String> -> Bool

Whether a rule id is one or more non-empty parts, split by /: its path in bend-lint-rules/.

def Draft.target source · line 360 · raw

@parts:List<&2, String> -> Maybe<&2, 0x8cd234c63d1502eb971c1e6f87bd0770/lib/linter/directives/spec.Target>

rule@severity, split at its @s.

def Draft.label source · line 378 · raw

String

The word that starts a disable's second reason: why it is not an expect.

def Draft.part source · line 381 · raw

@part:List<&2, String> -> @out:List<&2, String> -> List<&2, String>

def Draft.reasons.step source · line 385 · raw

@dash:Bool -> @word:String -> @read:Pair(List<&2, String>, List<&2, String>) -> Pair(List<&2, String>, List<&2, String>)

The reason so far (last first) and those before it (last first), with word read: the label starts another.

def Draft.reasons source · line 398 · raw

@words:List<&2, String> -> @read:Pair(List<&2, String>, List<&2, String>) -> List<&2, String>

The reasons in words, split at each label, in order, after what is read.

def Draft.reason source · line 409 · raw

@rest:List<&2, String> -> Maybe<&2, List<&2, String>>

What comes after the rule: nothing, or -- and the reasons.

def Draft.of source · line 417 · raw

@words:List<&2, String> -> Maybe<&2, 0x8cd234c63d1502eb971c1e6f87bd0770/lib/linter/directives/spec.Draft>

The draft of a directive's words, after bend-lint:.

def Problem.pinned source · line 428 · raw

@pinned:Maybe<&2, String> -> Maybe<&2, String>

def Problem.severity source · line 443 · raw

@action:Action -> @pinned:Bool -> @rule:String -> Maybe<&2, String>

def Problem.reason source · line 452 · raw

@scope:Scope -> @reasons:List<&2, String> -> Maybe<&2, String>

def Problem.because source · line 463 · raw

@action:Action -> @scope:Scope -> @reasons:List<&2, String> -> Maybe<&2, String>

def Problem.line source · line 480 · raw

@scope:Scope -> @trailing:Bool -> Maybe<&2, String>

def Problem.first source · line 487 · raw

@problems:List<&2, Maybe<&2, String>> -> Maybe<&2, String>

def Rule.is_reserved source · line 496 · raw

@namespace:String -> Bool

def Said.checked source · line 499 · raw

@why:Maybe<&2, String> -> @draft:0x8cd234c63d1502eb971c1e6f87bd0770/lib/linter/directives/spec.Draft -> @comment:0x8cd234c63d1502eb971c1e6f87bd0770/lib/linter/directives/spec.Comment -> @index:U32 -> Said

def Said.of source · line 527 · raw

@draft:Maybe<&2, 0x8cd234c63d1502eb971c1e6f87bd0770/lib/linter/directives/spec.Draft> -> @trailing:Bool -> @comment:0x8cd234c63d1502eb971c1e6f87bd0770/lib/linter/directives/spec.Comment -> @known:List<&2, String> -> @index:U32 -> Said

What a comment that holds draft (or not) says, checked against the rules there are.

def Draft.read.if source · line 568 · raw

@marked:Bool -> @text:String -> Maybe<&2, Maybe<&2, 0x8cd234c63d1502eb971c1e6f87bd0770/lib/linter/directives/spec.Draft>>

def Said.read.of source · line 578 · raw

@draft:Maybe<&2, Maybe<&2, 0x8cd234c63d1502eb971c1e6f87bd0770/lib/linter/directives/spec.Draft>> -> @+comment:0x8cd234c63d1502eb971c1e6f87bd0770/lib/linter/directives/spec.Comment -> @known:List<&2, String> -> @index:U32 -> Maybe<&2, Said>

def Said.read source · line 590 · raw

@+comment:0x8cd234c63d1502eb971c1e6f87bd0770/lib/linter/directives/spec.Comment -> @known:List<&2, String> -> @index:U32 -> Maybe<&2, Said>

def Said.all source · line 601 · raw

@comments:List<&2, 0x8cd234c63d1502eb971c1e6f87bd0770/lib/linter/directives/spec.Comment> -> @+known:List<&2, String> -> @+index:U32 -> @out:List<&2, Said> -> List<&2, Said>

What the comments say, in order, each numbered; out holds those so far, last first.

def Open.latest source · line 630 · raw

@open:List<&2, Directive> -> @found:Maybe<&2, Directive> -> @+action:String -> @+rule:String -> Maybe<&2, Directive>

The latest open begin of an action and a rule.

def Open.keep source · line 653 · raw

@drop:Bool -> @d:Directive -> @rest:List<&2, Directive> -> List<&2, Directive>

def Open.without source · line 660 · raw

@open:List<&2, Directive> -> @+index:U32 -> List<&2, Directive>

def Pairing.closing source · line 667 · raw

@same:Bool -> @+index:U32 -> @line:U32 -> @rule:String -> @comment:0x8cd234c63d1502eb971c1e6f87bd0770/lib/linter/directives/spec.Comment -> @p:Pairing -> Pairing

def Pairing.close source · line 681 · raw

@begin:Maybe<&2, Directive> -> @end:Directive -> @p:Pairing -> Pairing

def Pairing.step source · line 704 · raw

@said:Said -> @p:Pairing -> Pairing

def Pairing.go source · line 717 · raw

@saids:List<&2, Said> -> @p:Pairing -> Pairing

def Pairing.unclosed source · line 724 · raw

@open:List<&2, Directive> -> @wrong:List<&2, Said> -> List<&2, Said>

def Lines.next_code source · line 739 · raw

@lines:List<&2, Bool> -> @found:Maybe<&2, U32> -> @+i:U32 -> @+after:U32 -> Maybe<&2, U32>

The first line after after that holds code; i is the line of the head of lines.

def Closed.find source · line 758 · raw

@closed:List<&2, Closed> -> @found:Maybe<&2, U32> -> @+index:U32 -> Maybe<&2, U32>

def Covering.next source · line 767 · raw

@d:Directive -> @found:Maybe<&2, U32> -> Covering

def Covering.of source · line 775 · raw

@said:Said -> @lines:List<&2, Bool> -> @closed:List<&2, Closed> -> @last:U32 -> Maybe<&2, Covering>

The lines a directive covers; last is the file's last line.

def Covering.all source · line 804 · raw

@saids:List<&2, Said> -> @+lines:List<&2, Bool> -> @+closed:List<&2, Closed> -> @+last:U32 -> @out:List<&2, Covering> -> List<&2, Covering>

def Covering.pins source · line 823 · raw

@action:Action -> @pinned:Maybe<&2, 0x94bdd21968f0b8ad8c1be0e7e2b606a0/linter/api/spec.Severity> -> @severity:0x94bdd21968f0b8ad8c1be0e7e2b606a0/linter/api/spec.Severity -> Bool

def Covering.covers source · line 835 · raw

@rule:String -> @severity:0x94bdd21968f0b8ad8c1be0e7e2b606a0/linter/api/spec.Severity -> @+row:U32 -> @covering:Covering -> Bool

Whether a covering covers a finding of rule and severity on line row.

def Covering.hit source · line 846 · raw

@hit:Bool -> @c:Covering -> @out:List<&2, U32> -> List<&2, U32>

def Covering.hits source · line 853 · raw

@coverings:List<&2, Covering> -> @+rule:String -> @+severity:0x94bdd21968f0b8ad8c1be0e7e2b606a0/linter/api/spec.Severity -> @+row:U32 -> @out:List<&2, U32> -> List<&2, U32>

def Applied.add source · line 880 · raw

@hits:List<&2, U32> -> @found:0x94bdd21968f0b8ad8c1be0e7e2b606a0/linter/api/spec.Found -> @a:Applied -> Applied

def Applied.go source · line 888 · raw

@founds:List<&2, 0x94bdd21968f0b8ad8c1be0e7e2b606a0/linter/api/spec.Found> -> @at:List<&2, 0x8cd234c63d1502eb971c1e6f87bd0770/lib/linter/shared/text/spec.Position> -> @+coverings:List<&2, Covering> -> @a:Applied -> Applied

The findings, each with where it starts (at, in order), sorted by the directives that cover their lines.

def Unmet.add source · line 912 · raw

@used:Bool -> @action:Action -> @rule:String -> @pinned:Maybe<&2, 0x94bdd21968f0b8ad8c1be0e7e2b606a0/linter/api/spec.Severity> -> @span:0x94bdd21968f0b8ad8c1be0e7e2b606a0/linter/api/spec.Span -> @out:List<&2, 0x94bdd21968f0b8ad8c1be0e7e2b606a0/linter/api/spec.Found> -> List<&2, 0x94bdd21968f0b8ad8c1be0e7e2b606a0/linter/api/spec.Found>

def Unmet.go source · line 951 · raw

@coverings:List<&2, Covering> -> @+used:List<&2, U32> -> @+path:String -> @out:List<&2, 0x94bdd21968f0b8ad8c1be0e7e2b606a0/linter/api/spec.Found> -> List<&2, 0x94bdd21968f0b8ad8c1be0e7e2b606a0/linter/api/spec.Found>

The findings about the directives that nothing used: an expect not met, a disable that covered nothing.

def Wrong.found source · line 968 · raw

@saids:List<&2, Said> -> @+path:String -> @out:List<&2, 0x94bdd21968f0b8ad8c1be0e7e2b606a0/linter/api/spec.Found> -> List<&2, 0x94bdd21968f0b8ad8c1be0e7e2b606a0/linter/api/spec.Found>

def Found.offsets source · line 993 · raw

@founds:List<&2, 0x94bdd21968f0b8ad8c1be0e7e2b606a0/linter/api/spec.Found> -> @out:List<&2, U32> -> List<&2, U32>

Where each of founds starts, in order, onto out (last first).

def Linted.path source · line 1003 · raw

@linted:Linted -> String

def Linted.text source · line 1008 · raw

@linted:Linted -> String

def Linted.known source · line 1013 · raw

@linted:Linted -> List<&2, String>

def Linted.ran source · line 1018 · raw

@linted:Linted -> List<&2, String>

def Covering.keep source · line 1023 · raw

@ran:Bool -> @c:Covering -> @out:List<&2, Covering> -> List<&2, Covering>

def Covering.ran source · line 1030 · raw

@coverings:List<&2, Covering> -> @+ran:List<&2, String> -> @out:List<&2, Covering> -> List<&2, Covering>

def done source · line 1049 · raw

@a:Applied -> @coverings:List<&2, Covering> -> @unpaired:List<&2, Said> -> @saids:List<&2, Said> -> @+linted:Linted -> 0x8cd234c63d1502eb971c1e6f87bd0770/lib/linter/directives/spec.Suppressed

def covered source · line 1072 · raw

@+coverings:List<&2, Covering> -> @unpaired:List<&2, Said> -> @saids:List<&2, Said> -> @+linted:Linted -> @+founds:List<&2, 0x94bdd21968f0b8ad8c1be0e7e2b606a0/linter/api/spec.Found> -> 0x8cd234c63d1502eb971c1e6f87bd0770/lib/linter/directives/spec.Suppressed

def paired source · line 1092 · raw

@p:Pairing -> @+saids:List<&2, Said> -> @+lines:List<&2, Bool> -> @linted:Linted -> @founds:List<&2, 0x94bdd21968f0b8ad8c1be0e7e2b606a0/linter/api/spec.Found> -> 0x8cd234c63d1502eb971c1e6f87bd0770/lib/linter/directives/spec.Suppressed

def said source · line 1115 · raw

@+saids:List<&2, Said> -> @lines:List<&2, Bool> -> @linted:Linted -> @founds:List<&2, 0x94bdd21968f0b8ad8c1be0e7e2b606a0/linter/api/spec.Found> -> 0x8cd234c63d1502eb971c1e6f87bd0770/lib/linter/directives/spec.Suppressed

def scanned source · line 1123 · raw

@scanned:0x8cd234c63d1502eb971c1e6f87bd0770/lib/linter/directives/spec.Scanned -> @+linted:Linted -> @founds:List<&2, 0x94bdd21968f0b8ad8c1be0e7e2b606a0/linter/api/spec.Found> -> 0x8cd234c63d1502eb971c1e6f87bd0770/lib/linter/directives/spec.Suppressed

def when source · line 1132 · raw

@has:Bool -> @+linted:Linted -> @founds:List<&2, 0x94bdd21968f0b8ad8c1be0e7e2b606a0/linter/api/spec.Found> -> 0x8cd234c63d1502eb971c1e6f87bd0770/lib/linter/directives/spec.Suppressed