Documentation
¶
Overview ¶
Package npmblame captures useful informations and common errors from npm node_modules
Index ¶
- func DefaultClient(authToken string) *github.Client
- type NpmPackage
- type NpmPackages
- func (np NpmPackages) AppendError(pkgName string, err PackageError)
- func (np NpmPackages) Blame(path string, info os.FileInfo, err error) error
- func (np NpmPackages) ExtractPackageInformations() error
- func (np NpmPackages) ExtractPackageName(path string) string
- func (np NpmPackages) String() string
- func (np NpmPackages) TotalErrors(pkgName string) int
- type PackageError
- type Report
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultClient ¶
DefaultClient returns a default GitHub client
Types ¶
type NpmPackage ¶
NpmPackage represents a npm package
type NpmPackages ¶
type NpmPackages map[string]map[PackageError]int
NpmPackages is a map of all the packages and there given errors
func NewNpmPackages ¶
func NewNpmPackages() NpmPackages
NewNpmPackages returns a new npm package instance
func (NpmPackages) AppendError ¶
func (np NpmPackages) AppendError(pkgName string, err PackageError)
AppendError appends an error to a given package
func (NpmPackages) ExtractPackageInformations ¶
func (np NpmPackages) ExtractPackageInformations() error
ExtractPackageInformations extracts the package information from its package.json
func (NpmPackages) ExtractPackageName ¶
func (np NpmPackages) ExtractPackageName(path string) string
ExtractPackageName returns the npm package name from a given path TODO improve to handle nested dependencies
func (NpmPackages) String ¶
func (np NpmPackages) String() string
String returns the printalbe representation of the NpmPackages
func (NpmPackages) TotalErrors ¶
func (np NpmPackages) TotalErrors(pkgName string) int
TotalErrors return the total amount of errors
type PackageError ¶
type PackageError int
PackageError represents common npm packages errors
const ( // ExecError marks a package containing executables ExecError PackageError = iota // TestError marks a package test files TestError // BenchError marks a package benchmark files BenchError // ImageError marks a package images files ImageError // CIError marks a package containing continuous integration files CIError // DotfileError marks a package lint files DotfileError )