modernize

package
v0.3.27 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package modernize detects and fixes known YAML config anti-patterns in workflow configuration files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Change

type Change struct {
	RuleID      string `json:"rule_id"`
	Line        int    `json:"line"`
	Description string `json:"description"`
}

Change represents a modification applied by a rule's Fix function.

type Finding

type Finding struct {
	RuleID  string `json:"rule_id"`
	Line    int    `json:"line"`
	Message string `json:"message"`
	Fixable bool   `json:"fixable"`
}

Finding represents a single issue detected by a modernize rule.

type Rule

type Rule struct {
	ID          string
	Description string
	Severity    string // "error" or "warning"
	Check       func(root *yaml.Node, raw []byte) []Finding
	Fix         func(root *yaml.Node) []Change
}

Rule defines a modernize transformation rule.

func AllRules

func AllRules() []Rule

AllRules returns all registered modernize rules.

func FilterRules

func FilterRules(rules []Rule, include, exclude string) []Rule

FilterRules filters the rule list based on include/exclude flags.

Jump to

Keyboard shortcuts

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