Documentation ¶
Index ¶
- func AbsPath(path string) string
- func CountPercentage(issues int) float64
- func DirList(projectPath string, suffix, except string) (dirs map[string]string, err error)
- func ExceptPkg(pkg string) bool
- func FileList(projectPath string, suffix, except string) (files []string, err error)
- func GetProcessUnit(sumProcessNumber int64, number int) int64
- func PackageAbsPath(path string) (packagePath string)
- func PackageAbsPathExceptSuffix(path string) (packagePath string)
- func PackageNameFromGoPath(path string) string
- func ProjectName(projectPath string) (project string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CountPercentage ¶
CountPercentage will count all linters' percentage.And rule is
+--------------------------------------------------+ | issues | score | +==================================================+ | 5 | 100-issues*2 | +--------------------------------------------------+ | [5,10) | 100 - 10 - (issues-5)*4 | +--------------------------------------------------+ | [10,20) | 100 - 10 - 20 - (issues-10)*5 | +--------------------------------------------------+ | [20,40) | 100 - 10 - 20 - 50 - (issues-20)*1 | +--------------------------------------------------+ | [40,*) | 0 | +--------------------------------------------------+
It will return a float64 type score.
func DirList ¶
DirList is a function that traverse the file directory containing the specified file format according to the specified rule.
func FileList ¶
FileList is a function that traverse the file is the specified file format according to the specified rule.
func GetProcessUnit ¶
GetProcessUnit provides function that will get sumProcessNumber of linter's weight and the number of current linter's case.It will return 1 if sumProcessNumber/int64(number) <= 0 or sumProcessNumber / int64(number). Just for communication.
func PackageAbsPath ¶
PackageAbsPath will gets the absolute path of the specified package from GOPATH's [src].
func PackageAbsPathExceptSuffix ¶
PackageAbsPath will gets the absolute directory path of the specified file from GOPATH's [src].
func PackageNameFromGoPath ¶
PackageNameFromGoPath is a function that will get package's name from GOPATH.
func ProjectName ¶
ProjectName is a function that gets project's name.
Types ¶
This section is empty.