Documentation
¶
Index ¶
- Constants
- Variables
- func ExcludeWithGitignore(gitignorePath string, paths []string) ([]string, error)
- func IsMetadataType(mdValueStr string) bool
- func ReadMetadata(content []byte, path string) (collections.Set[Metadata], collections.Errors)
- type BasicContentAnalyzer
- type ContentAnalyzer
- type DoublestarCollector
- type Engine
- type Factory
- type Feature
- type FeatureApplyError
- type FeatureApplyMode
- type FeatureFunc
- type FeatureList
- type FileDiff
- type FileDiffs
- type FilepathCollector
- type FormatDiff
- type Formatter
- type LineBreakStyle
- type Metadata
- type MetadataError
- type MetadataType
- type Operation
- type PathCollector
- type Registry
- type UnsupportedLineBreakError
Constants ¶
View Source
const MetadataIdentifier = "!yamlfmt!"
Variables ¶
View Source
var ( ErrMalformedMetadata = errors.New("metadata: malformed string") ErrUnrecognizedMetadata = errors.New("metadata: unrecognized type") )
Functions ¶
func ExcludeWithGitignore ¶
func IsMetadataType ¶
func ReadMetadata ¶
func ReadMetadata(content []byte, path string) (collections.Set[Metadata], collections.Errors)
Types ¶
type BasicContentAnalyzer ¶
func NewBasicContentAnalyzer ¶
func NewBasicContentAnalyzer(patterns []string) (BasicContentAnalyzer, error)
func (BasicContentAnalyzer) ExcludePathsByContent ¶
func (a BasicContentAnalyzer) ExcludePathsByContent(paths []string) ([]string, []string, error)
type ContentAnalyzer ¶
type DoublestarCollector ¶
func (*DoublestarCollector) CollectPaths ¶
func (c *DoublestarCollector) CollectPaths() ([]string, error)
type Feature ¶
type Feature struct {
Name string
BeforeAction FeatureFunc
AfterAction FeatureFunc
}
type FeatureApplyError ¶
type FeatureApplyError struct {
// contains filtered or unexported fields
}
func (*FeatureApplyError) Error ¶
func (e *FeatureApplyError) Error() string
func (*FeatureApplyError) Unwrap ¶
func (e *FeatureApplyError) Unwrap() error
type FeatureApplyMode ¶
type FeatureApplyMode string
var ( FeatureApplyBefore FeatureApplyMode = "Before" FeatureApplyAfter FeatureApplyMode = "After" )
type FeatureFunc ¶
type FeatureList ¶
type FeatureList []Feature
func (FeatureList) ApplyFeatures ¶
func (fl FeatureList) ApplyFeatures(input []byte, mode FeatureApplyMode) ([]byte, error)
type FileDiff ¶
type FileDiff struct {
Path string
Diff *FormatDiff
}
func (*FileDiff) StrOutputQuiet ¶
type FilepathCollector ¶
func (*FilepathCollector) CollectPaths ¶
func (c *FilepathCollector) CollectPaths() ([]string, error)
type FormatDiff ¶
func (*FormatDiff) Changed ¶
func (d *FormatDiff) Changed() bool
func (*FormatDiff) MultilineDiff ¶
func (d *FormatDiff) MultilineDiff() (string, int)
type LineBreakStyle ¶
type LineBreakStyle string
const ( LineBreakStyleLF LineBreakStyle = "lf" LineBreakStyleCRLF LineBreakStyle = "crlf" )
func (LineBreakStyle) Separator ¶
func (s LineBreakStyle) Separator() (string, error)
type Metadata ¶
type Metadata struct {
Type MetadataType
LineNum int
}
type MetadataError ¶
type MetadataError struct {
// contains filtered or unexported fields
}
func (*MetadataError) Error ¶
func (e *MetadataError) Error() string
func (*MetadataError) Unwrap ¶
func (e *MetadataError) Unwrap() error
type PathCollector ¶
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func NewFormatterRegistry ¶
func (*Registry) GetDefaultFactory ¶
type UnsupportedLineBreakError ¶
type UnsupportedLineBreakError struct {
// contains filtered or unexported fields
}
func (UnsupportedLineBreakError) Error ¶
func (e UnsupportedLineBreakError) Error() string
Source Files
¶
Click to show internal directories.
Click to hide internal directories.