Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Coverage ¶
func (Coverage) MarshalJSON ¶
MarshalJSON marshals the coverage into JSON. Since the Code Climate API requires this as a string "[1,2,null]" and not just a straight JSON array we have to do a bunch of work to coerce into that format
func (*Coverage) UnmarshalJSON ¶
type Environment ¶ added in v0.1.2
type LineCounts ¶
type LineCounts struct {
Missed int `json:"missed"`
Covered int `json:"covered"`
Total int `json:"total"`
Strength int `json:"-"`
}
func (LineCounts) CoveredPercent ¶
func (lc LineCounts) CoveredPercent() float64
func (LineCounts) CoveredStrength ¶ added in v0.1.4
func (lc LineCounts) CoveredStrength() float64
type Report ¶
type Report struct {
CIService ccCIService `json:"ci_service"`
Environment Environment `json:"environment"`
Git ccGit `json:"git"`
CoveredPercent float64 `json:"covered_percent"`
CoveredStrength int `json:"covered_strength"`
LineCounts LineCounts `json:"line_counts"`
SourceFiles SourceFiles `json:"source_files"`
RepoToken string `json:"repo_token"`
}
func (*Report) AddSourceFile ¶
func (rep *Report) AddSourceFile(sf SourceFile) error
type SourceFile ¶
type SourceFile struct {
BlobID string `json:"blob_id"`
Coverage Coverage `json:"coverage"`
CoveredPercent float64 `json:"covered_percent"`
CoveredStrength float64 `json:"covered_strength"`
LineCounts LineCounts `json:"line_counts"`
Name string `json:"name"`
}
func NewSourceFile ¶
func NewSourceFile(name string, commit *object.Commit) (SourceFile, error)
func (*SourceFile) CalcLineCounts ¶
func (sf *SourceFile) CalcLineCounts()
func (SourceFile) Merge ¶
func (a SourceFile) Merge(b SourceFile) (SourceFile, error)
type SourceFiles ¶
type SourceFiles map[string]SourceFile
func (SourceFiles) MarshalJSON ¶
func (sf SourceFiles) MarshalJSON() ([]byte, error)
func (SourceFiles) UnmarshalJSON ¶
func (sf SourceFiles) UnmarshalJSON(text []byte) error
Click to show internal directories.
Click to hide internal directories.