Documentation
¶
Index ¶
- Variables
- func SearchCommit(commit *object.Commit, cb func(*Comment)) error
- func SearchDir(dirPath string, cb func(comment *Comment)) error
- func SearchDirWithOptions(dirPath string, options SearchOptions, cb func(comment *Comment)) error
- func SearchFile(filePath string, reader io.Reader, cb func(*Comment)) error
- type Comment
- type Comments
- type Language
- type SearchOptions
Constants ¶
This section is empty.
Variables ¶
View Source
var CStyleCommentOptions *lege.ParseOptions = &lege.ParseOptions{ Boundaries: []lege.Boundary{ { Start: "//", End: "\n", }, { Start: "/*", End: "*/", }, }, }
CStyleCommentOptions ...
View Source
var DefaultIgnorePatterns = []string{
".git",
".hg",
".svn",
"node_modules",
"vendor",
"dist",
"build",
"target",
"bin",
"obj",
".terraform",
".venv",
"venv",
"__pycache__",
".next",
"coverage",
".github/tickgit-*.csv",
".github/tickgit-candidates.md",
"tickgit-*.csv",
"tickgit-candidates.md",
}
DefaultIgnorePatterns skips common repository metadata, dependency, and build paths.
View Source
var HashStyleCommentOptions *lege.ParseOptions = &lege.ParseOptions{ Boundaries: []lege.Boundary{ { Start: "#", End: "\n", }, }, }
HashStyleCommentOptions ...
View Source
var LanguageParseOptions map[Language]*lege.ParseOptions = map[Language]*lege.ParseOptions{ "C": CStyleCommentOptions, "C#": CStyleCommentOptions, "C++": CStyleCommentOptions, "Common Lisp": LispStyleCommentOptions, "Emacs Lisp": LispStyleCommentOptions, "Go": CStyleCommentOptions, "Groovy": CStyleCommentOptions, "Haskell": {Boundaries: []lege.Boundary{{Start: "--", End: "\n"}, {Start: "{-", End: "-}"}}}, "Java": CStyleCommentOptions, "JavaScript": CStyleCommentOptions, "Objective-C": CStyleCommentOptions, "PHP": {Boundaries: append(CStyleCommentOptions.Boundaries, HashStyleCommentOptions.Boundaries...)}, "Python": HashStyleCommentOptions, "R": HashStyleCommentOptions, "Ruby": HashStyleCommentOptions, "Shell": HashStyleCommentOptions, "Swift": CStyleCommentOptions, "TypeScript": CStyleCommentOptions, "Visual Basic": {Boundaries: []lege.Boundary{{Start: "'", End: "\n"}}}, "Kotlin": CStyleCommentOptions, "Rust": {Boundaries: []lege.Boundary{{Start: "///", End: "\n"}, {Start: "//!", End: "\n"}, {Start: "//", End: "\n"}}}, "Elixir": HashStyleCommentOptions, "Julia": {Boundaries: []lege.Boundary{{Start: "#=", End: "=#"}, {Start: "#", End: "\n"}}}, }
LanguageParseOptions keeps track of source languages and their corresponding comment options
View Source
var LispStyleCommentOptions *lege.ParseOptions = &lege.ParseOptions{ Boundaries: []lege.Boundary{ { Start: ";", End: "\n", }, }, }
LispStyleCommentOptions ..
Functions ¶
func SearchCommit ¶
SearchCommit searches all files in the tree of a given commit
func SearchDirWithOptions ¶ added in v0.0.17
func SearchDirWithOptions(dirPath string, options SearchOptions, cb func(comment *Comment)) error
SearchDirWithOptions searches a directory for comments with explicit options.
Types ¶
type Comment ¶
type Comment struct {
lege.Collection
FilePath string
}
Comment represents a comment in a source code file
type SearchOptions ¶ added in v0.0.17
type SearchOptions struct {
IgnorePatterns []string
}
SearchOptions configures directory comment searches.
Click to show internal directories.
Click to hide internal directories.