whitespace

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2025 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsecutiveBlankLinesRule

type ConsecutiveBlankLinesRule struct {
	linter.BaseRule
	// contains filtered or unexported fields
}

ConsecutiveBlankLinesRule checks for multiple consecutive blank lines

func NewConsecutiveBlankLinesRule

func NewConsecutiveBlankLinesRule(maxConsecutive int) *ConsecutiveBlankLinesRule

NewConsecutiveBlankLinesRule creates a new L003 rule instance

func (*ConsecutiveBlankLinesRule) Check

Check performs the consecutive blank lines check

func (*ConsecutiveBlankLinesRule) Fix

func (r *ConsecutiveBlankLinesRule) Fix(content string, violations []linter.Violation) (string, error)

Fix removes excess consecutive blank lines

type IndentationDepthRule

type IndentationDepthRule struct {
	linter.BaseRule
	// contains filtered or unexported fields
}

IndentationDepthRule checks for excessive indentation depth

func NewIndentationDepthRule

func NewIndentationDepthRule(maxDepth int, indentSize int) *IndentationDepthRule

NewIndentationDepthRule creates a new L004 rule instance

func (*IndentationDepthRule) Check

Check performs the indentation depth check

func (*IndentationDepthRule) Fix

func (r *IndentationDepthRule) Fix(content string, violations []linter.Violation) (string, error)

Fix is not supported for this rule (requires query restructuring)

type LongLinesRule

type LongLinesRule struct {
	linter.BaseRule
	MaxLength int
}

LongLinesRule checks for lines exceeding maximum length

func NewLongLinesRule

func NewLongLinesRule(maxLength int) *LongLinesRule

NewLongLinesRule creates a new L005 rule instance

func (*LongLinesRule) Check

func (r *LongLinesRule) Check(ctx *linter.Context) ([]linter.Violation, error)

Check performs the long lines check

func (*LongLinesRule) Fix

func (r *LongLinesRule) Fix(content string, violations []linter.Violation) (string, error)

Fix is not supported for long lines (requires semantic understanding)

type MixedIndentationRule

type MixedIndentationRule struct {
	linter.BaseRule
}

MixedIndentationRule checks for mixed tabs and spaces in indentation

func NewMixedIndentationRule

func NewMixedIndentationRule() *MixedIndentationRule

NewMixedIndentationRule creates a new L002 rule instance

func (*MixedIndentationRule) Check

Check performs the mixed indentation check

func (*MixedIndentationRule) Fix

func (r *MixedIndentationRule) Fix(content string, violations []linter.Violation) (string, error)

Fix converts all indentation to spaces (4 spaces per tab)

type RedundantWhitespaceRule

type RedundantWhitespaceRule struct {
	linter.BaseRule
}

RedundantWhitespaceRule checks for redundant/excessive whitespace

func NewRedundantWhitespaceRule

func NewRedundantWhitespaceRule() *RedundantWhitespaceRule

NewRedundantWhitespaceRule creates a new L010 rule instance

func (*RedundantWhitespaceRule) Check

Check performs the redundant whitespace check

func (*RedundantWhitespaceRule) Fix

func (r *RedundantWhitespaceRule) Fix(content string, violations []linter.Violation) (string, error)

Fix removes redundant whitespace

type TrailingWhitespaceRule

type TrailingWhitespaceRule struct {
	linter.BaseRule
}

TrailingWhitespaceRule checks for unnecessary trailing whitespace

func NewTrailingWhitespaceRule

func NewTrailingWhitespaceRule() *TrailingWhitespaceRule

NewTrailingWhitespaceRule creates a new L001 rule instance

func (*TrailingWhitespaceRule) Check

Check performs the trailing whitespace check

func (*TrailingWhitespaceRule) Fix

func (r *TrailingWhitespaceRule) Fix(content string, violations []linter.Violation) (string, error)

Fix removes trailing whitespace from all lines

Jump to

Keyboard shortcuts

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