workspace

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FileIsAutoGenerated

func FileIsAutoGenerated(contents []byte) bool

func ParseGitignoreFromDir

func ParseGitignoreFromDir(path string) (gitignore.IgnoreMatcher, error)

ParseGitignoreFromDir tries to parse a gitignore file at path/.gitignore. If no such file exists, <nil, nil> is returned.

Types

type File

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

File is a structure for storing information about a file at the stage of indexing and analysis.

Note: It is guaranteed that each field has a value.

func NewFile

func NewFile(name string, contents []byte) *File

func (*File) AutoGenerated

func (f *File) AutoGenerated() bool

func (*File) Contents

func (f *File) Contents() []byte

func (*File) Line

func (f *File) Line(index int) []byte

func (*File) LinePosition

func (f *File) LinePosition(index int) int

func (*File) Name

func (f *File) Name() string

func (*File) NumLines

func (f *File) NumLines() int

func (*File) NumLinesPosition

func (f *File) NumLinesPosition() int

type FileInfo

type FileInfo struct {
	Name       string
	Contents   []byte
	LineRanges []git.LineRange
}

FileInfo is a structure for storing information about a file during file system traversal.

Note: Contents do not always contain data.

type FilenameFilter

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

func NewFilenameFilter

func NewFilenameFilter(exclude *regexp.Regexp) *FilenameFilter

func (*FilenameFilter) EnableGitignore

func (filter *FilenameFilter) EnableGitignore()

func (*FilenameFilter) GitignoreIsEnabled

func (filter *FilenameFilter) GitignoreIsEnabled() bool

func (*FilenameFilter) GitignorePop

func (filter *FilenameFilter) GitignorePop(path string)

func (*FilenameFilter) GitignorePush

func (filter *FilenameFilter) GitignorePush(path string, matcher gitignore.IgnoreMatcher)

func (*FilenameFilter) IgnoreDir

func (filter *FilenameFilter) IgnoreDir(path string) bool

func (*FilenameFilter) IgnoreFile

func (filter *FilenameFilter) IgnoreFile(path string) bool

func (*FilenameFilter) InitialGitignorePush

func (filter *FilenameFilter) InitialGitignorePush(path string, matcher gitignore.IgnoreMatcher)

type ReadCallback

type ReadCallback func(ch chan FileInfo)

func ReadChangesFromWorkTree

func ReadChangesFromWorkTree(dir string, changes []git.Change, phpExtensions []string) ReadCallback

ReadChangesFromWorkTree returns callback that reads files from workTree dir that are changed

func ReadFilenames

func ReadFilenames(filenames []string, filter *FilenameFilter, phpExtensions []string) ReadCallback

ReadFilenames returns callback that reads filenames into channel

func ReadFilesFromGit

func ReadFilesFromGit(repo, commitSHA1 string, ignoreRegex *regexp.Regexp, phpExtensions []string) ReadCallback

ReadFilesFromGit parses file contents in the specified commit

func ReadFilesFromGitWithChanges

func ReadFilesFromGitWithChanges(repo, commitSHA1 string, changes []git.Change, phpExtensions []string) ReadCallback

ReadFilesFromGitWithChanges parses file contents in the specified commit, but only specified ranges

func ReadOldFilesFromGit

func ReadOldFilesFromGit(repo, commitSHA1 string, changes []git.Change, phpExtensions []string) ReadCallback

ReadOldFilesFromGit parses file contents in the specified commit, the old version

Jump to

Keyboard shortcuts

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