formatters

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 18, 2017 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Coverage

type Coverage []nulls.Int

func (Coverage) MarshalJSON

func (c Coverage) MarshalJSON() ([]byte, error)

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

func (c *Coverage) UnmarshalJSON(text []byte) error

type Environment added in v0.1.2

type Environment struct {
	GemVersion      string `json:"gem_version"`
	PackageVersion  string `json:"package_version"`
	PWD             string `json:"pwd"`
	Prefix          string `json:"prefix"`
	RailsRoot       string `json:"rails_root"`
	ReporterVersion string `json:"reporter_version"`
	SimplecovRoot   string `json:"simplecov_root"`
}

type Formatter

type Formatter interface {
	Search(...string) (string, error)
	Parse() error
	Format() (Report, error)
}

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 NewReport

func NewReport() (Report, error)

func (*Report) AddSourceFile

func (rep *Report) AddSourceFile(sf SourceFile) error

func (*Report) Merge

func (a *Report) Merge(reps ...*Report) error

func (Report) Save

func (r Report) Save(w io.Writer) 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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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