Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultAnalyzer = NewAnalyzer()
Functions ¶
func NewAnalyzer ¶
func NewAnalyzerWithConfig ¶
func NewAnalyzerWithConfig(cfg *AnalyzerConfig) *analysis.Analyzer
Types ¶
type AnalyzerConfig ¶
type AnalyzerConfig struct { // LookAtTests is flag controlling whether the lints are going to look at // test files, despite other config knobs of the Go analysis tooling // framework telling us otherwise. // // By default gosmopolitan does not look at test files, because i18n-aware // apps most probably have many unmarked strings in test cases, and names // and descriptions *of* test cases are probably in the program's original // natural language too. LookAtTests bool // EscapeHatches is optionally a list of fully qualified names, in the // `(full/pkg/path).name` form, to act as "i18n escape hatches". Inside // call-like expressions to those names, the string literal script check // is ignored. // // With this functionality in place, you can use type aliases like // `type R = string` as markers, or have explicitly i18n-aware functions // exempt from the checks. EscapeHatches []string // WatchForScripts is optionally a list of Unicode script names to watch // for any usage in string literals. The range of supported scripts is // determined by the [unicode.Scripts] map and values are case-sensitive. WatchForScripts []string // AllowTimeLocal is flag controlling whether usages of [time.Local] are // allowed (i.e. not reported). AllowTimeLocal bool }
Click to show internal directories.
Click to hide internal directories.