lint

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package lint provides PSL code style checking.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckSnakeCase

func CheckSnakeCase(name string) bool

CheckSnakeCase checks if a name follows snake_case convention.

func FormatIssues

func FormatIssues(issues []Issue) string

FormatIssues formats lint issues for display.

Types

type Config

type Config struct {
	Rules []Rule `json:"rules"`
}

Config holds linter configuration.

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns the default linter configuration.

type Issue

type Issue struct {
	File     string   `json:"file"`
	Line     int      `json:"line"`
	Severity Severity `json:"severity"`
	Rule     string   `json:"rule"`
	Message  string   `json:"message"`
}

Issue represents a lint issue.

type Linter

type Linter struct {
	Config          *Config
	TransportLoader *pdl.TransportLoader
}

Linter performs PSL code style checks.

func NewLinter

func NewLinter(cfg *Config) *Linter

NewLinter creates a new linter.

func NewLinterWithTransport

func NewLinterWithTransport(cfg *Config, embedFS fs.FS) *Linter

NewLinterWithTransport creates a new linter with transport support.

func (*Linter) LintContent

func (l *Linter) LintContent(filename, content string) []Issue

LintContent lints PSL content and returns issues.

type Rule

type Rule struct {
	Name    string `json:"name"`
	Enabled bool   `json:"enabled"`
}

Rule represents a lint rule.

type Severity

type Severity string

Severity represents lint issue severity.

const (
	SeverityError   Severity = "error"
	SeverityWarning Severity = "warning"
	SeverityInfo    Severity = "info"
)

Jump to

Keyboard shortcuts

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