Versions in this module Expand all Collapse all v1 v1.1.0 Oct 30, 2024 Changes in this version + type ConstErrorDeclarationRule struct + func (r *ConstErrorDeclarationRule) Check(filename string, node *ast.File, fset *token.FileSet) ([]tt.Issue, error) + func (r *ConstErrorDeclarationRule) Name() string + func (r *ConstErrorDeclarationRule) SetSeverity(severity tt.Severity) + func (r *ConstErrorDeclarationRule) Severity() tt.Severity + type CyclomaticComplexityRule struct + Threshold int + func (r *CyclomaticComplexityRule) Check(filename string, node *ast.File, fset *token.FileSet) ([]tt.Issue, error) + func (r *CyclomaticComplexityRule) Name() string + func (r *CyclomaticComplexityRule) SetSeverity(severity tt.Severity) + func (r *CyclomaticComplexityRule) Severity() tt.Severity + type DeferRule struct + func (r *DeferRule) Check(filename string, node *ast.File, fset *token.FileSet) ([]tt.Issue, error) + func (r *DeferRule) Name() string + func (r *DeferRule) SetSeverity(severity tt.Severity) + func (r *DeferRule) Severity() tt.Severity + type DeprecateFuncRule struct + func (r *DeprecateFuncRule) Check(filename string, node *ast.File, fset *token.FileSet) ([]tt.Issue, error) + func (r *DeprecateFuncRule) Name() string + func (r *DeprecateFuncRule) SetSeverity(severity tt.Severity) + func (r *DeprecateFuncRule) Severity() tt.Severity + type DetectCycleRule struct + func (r *DetectCycleRule) Check(filename string, node *ast.File, fset *token.FileSet) ([]tt.Issue, error) + func (r *DetectCycleRule) Name() string + func (r *DetectCycleRule) SetSeverity(severity tt.Severity) + func (r *DetectCycleRule) Severity() tt.Severity + type EarlyReturnOpportunityRule struct + func (r *EarlyReturnOpportunityRule) Check(filename string, node *ast.File, fset *token.FileSet) ([]tt.Issue, error) + func (r *EarlyReturnOpportunityRule) Name() string + func (r *EarlyReturnOpportunityRule) SetSeverity(severity tt.Severity) + func (r *EarlyReturnOpportunityRule) Severity() tt.Severity + type EmitFormatRule struct + func (r *EmitFormatRule) Check(filename string, node *ast.File, fset *token.FileSet) ([]tt.Issue, error) + func (r *EmitFormatRule) Name() string + func (r *EmitFormatRule) SetSeverity(severity tt.Severity) + func (r *EmitFormatRule) Severity() tt.Severity + type Engine struct + func NewEngine(rootDir string, source []byte, rules map[string]tt.ConfigRule) (*Engine, error) + func (e *Engine) IgnoreRule(rule string) + func (e *Engine) Run(filename string) ([]tt.Issue, error) + func (e *Engine) RunSource(source []byte) ([]tt.Issue, error) + type GnoSpecificRule struct + func (r *GnoSpecificRule) Check(filename string, _ *ast.File, _ *token.FileSet) ([]tt.Issue, error) + func (r *GnoSpecificRule) Name() string + func (r *GnoSpecificRule) SetSeverity(severity tt.Severity) + func (r *GnoSpecificRule) Severity() tt.Severity + type GolangciLintRule struct + func (r *GolangciLintRule) Check(filename string, _ *ast.File, _ *token.FileSet) ([]tt.Issue, error) + func (r *GolangciLintRule) Name() string + func (r *GolangciLintRule) SetSeverity(severity tt.Severity) + func (r *GolangciLintRule) Severity() tt.Severity + type LintRule interface + Check func(filename string, node *ast.File, fset *token.FileSet) ([]tt.Issue, error) + Name func() string + SetSeverity func(tt.Severity) + Severity func() tt.Severity + func NewConstErrorDeclarationRule() LintRule + func NewCyclomaticComplexityRule(threshold int) LintRule + func NewDeferRule() LintRule + func NewDeprecateFuncRule() LintRule + func NewDetectCycleRule() LintRule + func NewEarlyReturnOpportunityRule() LintRule + func NewEmitFormatRule() LintRule + func NewGnoSpecificRule() LintRule + func NewGolangciLintRule() LintRule + func NewLoopAllocationRule() LintRule + func NewMissingModPackageRule() LintRule + func NewRepeatedRegexCompilationRule() LintRule + func NewSimplifySliceExprRule() LintRule + func NewSliceBoundCheckRule() LintRule + func NewUnnecessaryConversionRule() LintRule + func NewUselessBreakRule() LintRule + type LoopAllocationRule struct + func (r *LoopAllocationRule) Check(filename string, node *ast.File, fset *token.FileSet) ([]tt.Issue, error) + func (r *LoopAllocationRule) Name() string + func (r *LoopAllocationRule) SetSeverity(severity tt.Severity) + func (r *LoopAllocationRule) Severity() tt.Severity + type MissingModPackageRule struct + func (r *MissingModPackageRule) Check(filename string, node *ast.File, fset *token.FileSet) ([]tt.Issue, error) + func (r *MissingModPackageRule) Name() string + func (r *MissingModPackageRule) SetSeverity(severity tt.Severity) + func (r *MissingModPackageRule) Severity() tt.Severity + type ModRule interface + CheckMod func(filename string) ([]tt.Issue, error) + type RepeatedRegexCompilationRule struct + func (r *RepeatedRegexCompilationRule) Check(filename string, node *ast.File, fset *token.FileSet) ([]tt.Issue, error) + func (r *RepeatedRegexCompilationRule) Name() string + func (r *RepeatedRegexCompilationRule) SetSeverity(severity tt.Severity) + func (r *RepeatedRegexCompilationRule) Severity() tt.Severity + type SimplifySliceExprRule struct + func (r *SimplifySliceExprRule) Check(filename string, node *ast.File, fset *token.FileSet) ([]tt.Issue, error) + func (r *SimplifySliceExprRule) Name() string + func (r *SimplifySliceExprRule) SetSeverity(severity tt.Severity) + func (r *SimplifySliceExprRule) Severity() tt.Severity + type SliceBoundCheckRule struct + func (r *SliceBoundCheckRule) Check(filename string, node *ast.File, fset *token.FileSet) ([]tt.Issue, error) + func (r *SliceBoundCheckRule) Name() string + func (r *SliceBoundCheckRule) SetSeverity(severity tt.Severity) + func (r *SliceBoundCheckRule) Severity() tt.Severity + type SourceCode struct + Lines []string + func ReadSourceCode(filename string) (*SourceCode, error) + type UnnecessaryConversionRule struct + func (r *UnnecessaryConversionRule) Check(filename string, node *ast.File, fset *token.FileSet) ([]tt.Issue, error) + func (r *UnnecessaryConversionRule) Name() string + func (r *UnnecessaryConversionRule) SetSeverity(severity tt.Severity) + func (r *UnnecessaryConversionRule) Severity() tt.Severity + type UselessBreakRule struct + func (r *UselessBreakRule) Check(filename string, node *ast.File, fset *token.FileSet) ([]tt.Issue, error) + func (r *UselessBreakRule) Name() string + func (r *UselessBreakRule) SetSeverity(severity tt.Severity) + func (r *UselessBreakRule) Severity() tt.Severity