formatter

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package formatter provides functionality for formatting lint issues in a human-readable format. It includes various formatters for different types of issues and utility functions for text manipulation.

Index

Constants

View Source
const (
	CycloComplexity   = "high-cyclomatic-complexity"
	SliceBound        = "slice-bounds-check"
	MissingModPackage = "gno-mod-tidy"
	DeprecatedFunc    = "deprecated"
)

rule set

Variables

This section is empty.

Functions

func GenerateFormattedIssue

func GenerateFormattedIssue(issues []tt.Issue, snippet *internal.SourceCode) string

GenerateFormattedIssue formats a slice of issues into a human-readable string. It uses the appropriate formatter for each issue based on its rule.

Types

type CyclomaticComplexityFormatter

type CyclomaticComplexityFormatter struct{}

func (*CyclomaticComplexityFormatter) IssueTemplate

func (f *CyclomaticComplexityFormatter) IssueTemplate() string

type GeneralIssueFormatter

type GeneralIssueFormatter struct{}

func (*GeneralIssueFormatter) IssueTemplate

func (f *GeneralIssueFormatter) IssueTemplate() string

type IssueData

type IssueData struct {
	Category        string
	Severity        string
	Rule            string
	Filename        string
	Padding         string
	StartLine       int
	StartColumn     int
	EndLine         int
	EndColumn       int
	MaxLineNumWidth int
	Message         string
	Suggestion      string
	Note            string
	SnippetLines    []string
	CommonIndent    string
}

type MissingModPackageFormatter

type MissingModPackageFormatter struct{}

func (*MissingModPackageFormatter) IssueTemplate

func (f *MissingModPackageFormatter) IssueTemplate() string

type SliceBoundsCheckFormatter

type SliceBoundsCheckFormatter struct{}

func (*SliceBoundsCheckFormatter) IssueTemplate

func (f *SliceBoundsCheckFormatter) IssueTemplate() string

Jump to

Keyboard shortcuts

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