directive

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2026 License: MIT Imports: 4 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 directive 解析 appkit-lint 统一的行级带理由豁免注释:

//appkit:ignore <analyzer> -- <理由>

支持同行尾注释或紧邻上一行注释,也允许逗号分隔多个检查器名 (例如 //appkit:ignore nogoroutine,authheader -- <理由>)。 缺少理由时会在注释行报告诊断,防止静默绕过约束(与 nolintlint 对齐)。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Index

type Index struct {
	// contains filtered or unexported fields
}

Index 记录某检查器在各个文件中被合法豁免的行号集合。

func Parse

func Parse(pass *analysis.Pass, files []*ast.File, analyzerName string) *Index

Parse 扫描 files 中针对 analyzerName 的 appkit:ignore 注释。 若存在命中 analyzerName 但缺少理由的注释,通过 pass.Reportf 在注释处报错。

func (*Index) Ignored

func (idx *Index) Ignored(fset *token.FileSet, pos token.Pos) bool

Ignored 返回 pos 所在行是否被合法豁免。

Jump to

Keyboard shortcuts

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