diff --git a/file.go b/file.go index f6b5190..0297b53 100644 --- a/file.go +++ b/file.go @@ -9,7 +9,7 @@ import ( "unicode" ) -// ClocFile is collecting to line count result +// ClocFile is collecting to line count result. type ClocFile struct { Code int32 `xml:"code,attr" json:"code"` Comments int32 `xml:"comment,attr" json:"comment"` @@ -18,7 +18,7 @@ type ClocFile struct { Lang string `xml:"language,attr" json:"language"` } -// ClocFiles is gocloc result set +// ClocFiles is gocloc result set. type ClocFiles []ClocFile func (cf ClocFiles) Len() int { diff --git a/gocloc.go b/gocloc.go index 0a5c60b..84282c0 100644 --- a/gocloc.go +++ b/gocloc.go @@ -1,12 +1,12 @@ package gocloc -// Processor is gocloc analyzing processor +// Processor is gocloc analyzing processor. type Processor struct { langs *DefinedLanguages opts *ClocOptions } -// Result defined processing result +// Result defined processing result. type Result struct { Total *Language Files map[string]*ClocFile @@ -14,7 +14,7 @@ type Result struct { MaxPathLength int } -// NewProcessor returns Processor +// NewProcessor returns Processor. func NewProcessor(langs *DefinedLanguages, options *ClocOptions) *Processor { return &Processor{ langs: langs, diff --git a/json.go b/json.go index a5c1436..ce55562 100644 --- a/json.go +++ b/json.go @@ -1,18 +1,18 @@ package gocloc -// JSONLanguagesResult defines the result of the analysis in JSON format +// JSONLanguagesResult defines the result of the analysis in JSON format. type JSONLanguagesResult struct { Languages []ClocLanguage `json:"languages"` Total ClocLanguage `json:"total"` } -// JSONFilesResult defines the result of the analysis(by files) in JSON format +// JSONFilesResult defines the result of the analysis(by files) in JSON format. type JSONFilesResult struct { Files []ClocFile `json:"files"` Total ClocLanguage `json:"total"` } -// NewJSONLanguagesResultFromCloc returns JSONLanguagesResult with default data set +// NewJSONLanguagesResultFromCloc returns JSONLanguagesResult with default data set. func NewJSONLanguagesResultFromCloc(total *Language, sortedLanguages Languages) JSONLanguagesResult { var langs []ClocLanguage for _, language := range sortedLanguages { @@ -38,7 +38,7 @@ func NewJSONLanguagesResultFromCloc(total *Language, sortedLanguages Languages) } } -// NewJSONFilesResultFromCloc returns JSONFilesResult with default data set +// NewJSONFilesResultFromCloc returns JSONFilesResult with default data set. func NewJSONFilesResultFromCloc(total *Language, sortedFiles ClocFiles) JSONFilesResult { t := ClocLanguage{ FilesCount: total.Total, diff --git a/language.go b/language.go index 848612b..6e83bd1 100644 --- a/language.go +++ b/language.go @@ -15,7 +15,7 @@ import ( enry "github.com/go-enry/go-enry/v2" ) -// ClocLanguage is provide for xml-cloc and json format +// ClocLanguage is provide for xml-cloc and json format. type ClocLanguage struct { Name string `xml:"name,attr" json:"name,omitempty"` FilesCount int32 `xml:"files_count,attr" json:"files"` @@ -377,7 +377,7 @@ func getFileType(path string, opts *ClocOptions) (ext string, ok bool) { return ext, ok } -// NewLanguage create language data store +// NewLanguage create language data store. func NewLanguage(name string, lineComments []string, multiLines [][]string) *Language { return &Language{ Name: name, @@ -428,7 +428,7 @@ func (langs *DefinedLanguages) GetFormattedString() string { return buf.String() } -// NewDefinedLanguages create DefinedLanguages +// NewDefinedLanguages create DefinedLanguages. func NewDefinedLanguages() *DefinedLanguages { return &DefinedLanguages{ Langs: map[string]*Language{ diff --git a/option.go b/option.go index 73adc75..619a033 100644 --- a/option.go +++ b/option.go @@ -2,7 +2,7 @@ package gocloc import "regexp" -// ClocOptions is gocloc processor options +// ClocOptions is gocloc processor options. type ClocOptions struct { Debug bool SkipDuplicated bool @@ -19,7 +19,7 @@ type ClocOptions struct { OnComment func(line string) } -// NewClocOptions create new ClocOptions with default values +// NewClocOptions create new ClocOptions with default values. func NewClocOptions() *ClocOptions { return &ClocOptions{ Debug: false,