formatignore

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package formatignore matches formatter ignore files against paths.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MatchPath

func MatchPath(fs afero.Fs, path string, isDir bool) (bool, error)

MatchPath reports whether path is ignored by the nearest formatter root.

Types

type Matcher

type Matcher struct {
	// contains filtered or unexported fields
}

Matcher matches file paths against formatter ignore files.

func ForPath

func ForPath(fs afero.Fs, path string) (Matcher, bool, error)

ForPath returns a matcher rooted at the nearest formatter root for path.

The root is the first parent directory containing .git, .prettierignore, or .scutignore. If no root is found, the returned bool is false.

func (Matcher) Match

func (m Matcher) Match(path string, isDir bool) (bool, error)

Match reports whether path is ignored.

Jump to

Keyboard shortcuts

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