countcode

package
v0.0.0-...-df1b20f Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CountCode

func CountCode(projectPath, except string) (codeCounts map[string][]int)

Types

type Commenter

type Commenter struct {
	LineComment  string
	StartComment string
	EndComment   string
	Nesting      bool
}

type LData

type LData []LResult

func (LData) Len

func (d LData) Len() int

func (LData) Less

func (d LData) Less(i, j int) bool

func (LData) Swap

func (d LData) Swap(i, j int)

type LResult

type LResult struct {
	Name         string
	FileCount    int
	CodeLines    int
	CommentLines int
	BlankLines   int
	TotalLines   int
}

func (*LResult) Add

func (r *LResult) Add(a LResult)

type Language

type Language struct {
	Namer
	Matcher
	Commenter
}

func (Language) Update

func (l Language) Update(c []byte, s *Stats)

TODO work properly with unicode

type Matcher

type Matcher func(string) bool

func (Matcher) Match

func (m Matcher) Match(fname string) bool

type Namer

type Namer string

func (Namer) Name

func (l Namer) Name() string

type Stats

type Stats struct {
	FileCount    int
	TotalLines   int
	CodeLines    int
	BlankLines   int
	CommentLines int
}

Notes

Bugs

  • lines with comment don't count towards code Note that lines with both code and comment count towards each, but are not counted twice in the total.

Jump to

Keyboard shortcuts

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