marker

package
v0.7.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 19, 2026 License: Apache-2.0 Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package marker implements the single shared grammar for the `formwork:allow <rule-id> <reason>` exemption marker (spec §5). The engine (suppression) and `formwork lint` (reasonless-marker hygiene) both consume Classify so the two consumers can never disagree about what counts as a valid marker.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Kind

type Kind int

Kind classifies a formwork:allow marker occurrence for one rule id on one line.

const (
	// None: no formwork:allow marker naming this rule id is present on the
	// line at all.
	None Kind = iota
	// Reasonless: a marker naming this rule id is present, but nothing that
	// counts as a real reason follows it.
	Reasonless
	// Reasoned: a marker naming this rule id is present with a valid
	// reason — the exemption is honored.
	Reasoned
)

func Classify

func Classify(line, ruleID string) Kind

Classify scans line for a formwork:allow marker naming ruleID. If more than one such marker occurs on the line, Reasoned wins if any occurrence is reasoned.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL