Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Coverage ¶
type Coverage []NullInt
func (*Coverage) AppendNulls ¶
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 ¶
type Formatter ¶
type Formatter interface { // Search for the both the "standard" paths for the formatter, // plus any additional paths, for a file that can be parsed // by the formatter. Search(...string) (string, error) // Format the information for Parse into a standardized "Report". // Returns an error if there was a problem formatting the results. Format() (Report, error) }
Formatter needs to be implemented for each new test system
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 ¶
func (lc LineCounts) CoveredStrength() float64
type NullInt ¶
NullInt adds an implementation for int that supports proper JSON encoding/decoding.
func NewNullInt ¶
NewNullInt returns a new, properly instantiated Int object.
func (NullInt) MarshalJSON ¶
MarshalJSON marshals the underlying value to a proper JSON representation.
func (*NullInt) UnmarshalJSON ¶
UnmarshalJSON will unmarshal a JSON value into the propert representation of that value.
func (*NullInt) UnmarshalText ¶
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
Source Files ¶
Click to show internal directories.
Click to hide internal directories.