lint

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package lint provides static analysis for database migration directories. It checks for ordering gaps, duplicate versions, naming convention violations, dangerous SQL operations, and missing down migrations.

Index

Constants

View Source
const (
	SeverityError   = "error"
	SeverityWarning = "warning"
)

Severity levels for lint issues.

Variables

This section is empty.

Functions

This section is empty.

Types

type Issue

type Issue struct {
	File     string `json:"file"`
	Version  string `json:"version,omitempty"`
	Severity string `json:"severity"`
	Code     string `json:"code"`
	Message  string `json:"message"`
}

Issue describes a single lint finding.

type Result

type Result struct {
	Dir    string  `json:"dir"`
	Issues []Issue `json:"issues"`
	Clean  bool    `json:"clean"`
}

Result is the outcome of linting a migration directory.

func Lint

func Lint(dir string) (*Result, error)

Lint analyses the migration directory at dir and returns a Result.

Jump to

Keyboard shortcuts

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