versions

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2020 License: MIT Imports: 9 Imported by: 0

README

versions

Go Report Card Circle CI

Dependencies report generator for Go projects.

Installing

versions requires Go 1.14 or greater, install it using:

go install github.com/MarioCarrion/versions/cmd/versions

For projects depending on versions you could use the tools.go paradigm:

// +build tools

package tools

import (
	_ "github.com/MarioCarrion/versions/cmd/versions"
)

Using

After installing you can use:

versions <full path to 1 go.mod> <full path to 2 go.mod> <full path to N go.mod>

Example

⚠ New outputs are currently in development, at the moment Flavored Markdown is the only supported one.

Using:

versions ~/Repositories/versions/go.mod ~/Repositories/nit/go.mod

The following output will be generated:

|                                                              |    github.com/MarioCarrion/nit    |                                    github.com/MarioCarrion/versions                                    |
|--------------------------------------------------------------|-----------------------------------|--------------------------------------------------------------------------------------------------------|
| :white_check_mark: Go                                        |                              1.14 |                                                                                                   1.14 |
| :white_check_mark: github.com/MarioCarrion/nit               |                                   | v0.6.5                                                                                                 |
| :white_check_mark: github.com/go-enry/go-license-detector/v4 |                                   | v4.0.0<br>Apache License 2.0 permissive                                                                |
| :white_check_mark: github.com/golangci/golangci-lint         | v1.23.8                           | v1.23.8                                                                                                |
| :white_check_mark: github.com/google/go-cmp                  | v0.4.0<br>BSD-3-Clause permissive | v0.4.0<br>BSD-3-Clause permissive                                                                      |
| :white_check_mark: github.com/olekukonko/tablewriter         |                                   | v0.0.4<br>MIT License permissive                                                                       |
| :white_check_mark: github.com/pkg/errors                     | v0.9.1<br>BSD-2-Clause permissive |                                                                                                        |
| :white_check_mark: github.com/senseyeio/diligent             |                                   | v0.0.0-20191014201558-431d9a760f2d github.com/MarioCarrion/diligent v0.0.0-20200617184744-03fbc970a7f7 |
| :white_check_mark: golang.org/x/mod                          |                                   | v0.2.0<br>BSD-3-Clause permissive                                                                      |

Which renders like this in Markdown

github.com/MarioCarrion/nit github.com/MarioCarrion/versions
✅ Go 1.14 1.14
✅ github.com/MarioCarrion/nit v0.6.5
✅ github.com/go-enry/go-license-detector/v4 v4.0.0
Apache License 2.0 permissive
✅ github.com/golangci/golangci-lint v1.23.8 v1.23.8
✅ github.com/google/go-cmp v0.4.0
BSD-3-Clause permissive
v0.4.0
BSD-3-Clause permissive
✅ github.com/olekukonko/tablewriter v0.0.4
MIT License permissive
✅ github.com/pkg/errors v0.9.1
BSD-2-Clause permissive
✅ github.com/senseyeio/diligent v0.0.0-20191014201558-431d9a760f2d github.com/MarioCarrion/diligent v0.0.0-20200617184744-03fbc970a7f7
✅ golang.org/x/mod v0.2.0
BSD-3-Clause permissive

Features

  • Packages: license support.
  • Packages: update availables support.
    • Merge Requests creation for Gitlab.
    • Pull Requests creation for Github.
  • Packages: efferent and afferent metrics support.
  • Output: Graphviz .
  • Output: JSON.

Development requirements

Go >= 1.14

Project dependencies

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GoVersion added in v0.1.0

type GoVersion string

GoVersion defines the module version of Go used by the Module.

type GoVersions added in v0.1.0

type GoVersions struct {
	// contains filtered or unexported fields
}

GoVersions handles Go versions used by different Modules.

func (*GoVersions) IsSame added in v0.1.0

func (g *GoVersions) IsSame() bool

IsSame returns true when all Modules use the same Go Version.

func (*GoVersions) Set added in v0.1.0

func (g *GoVersions) Set(name ModuleName, version GoVersion)

Set sets the Go Version being used by the defined Module.

func (*GoVersions) Values added in v0.1.0

func (g *GoVersions) Values() []ModuleGoVersion

Values returns a copy of currently set modules and their Go versions.

type License added in v0.1.0

type License struct {
	Identifier string
	Name       string
	ShortName  string
	Type       diligent.Type
	Category   diligent.Category
}

License represents the LICENSE used by a Package.

type Module

type Module struct {
	ModuleGoVersion
	DependencyRequirements map[PackageName]Package
}

Module represents the contents of a go.mod file.

type ModuleGoVersion added in v0.1.0

type ModuleGoVersion struct {
	Name      ModuleName
	GoVersion GoVersion
}

ModuleGoVersion represents a module and its Go version.

type ModuleName added in v0.1.0

type ModuleName string

ModuleName defines the name of the module.

type Package

type Package struct {
	Name            PackageName
	Version         string
	IsIndirect      bool
	ReplacedPath    string
	ReplacedVersion string
	License         License
}

Package represents an imported Go packaged in a Module.

func (Package) Path added in v0.1.0

func (p Package) Path() string

Path returns the full filesystem path pointing to the package

type PackageName added in v0.1.0

type PackageName string

PackageName defines the name of the package.

type Packages added in v0.1.0

type Packages struct {
	// contains filtered or unexported fields
}

Packages handles Packages used by different modules.

func (*Packages) IsSame added in v0.1.0

func (p *Packages) IsSame(value PackageName) bool

IsSame returns true when all Modules use the same Package Version.

func (*Packages) Names added in v0.1.0

func (p *Packages) Names() []PackageName

Names returns a slice of all package names used in total.

func (*Packages) Set added in v0.1.0

func (p *Packages) Set(name ModuleName, pkg Package)

Set sets the Package being used by the defined Module.

func (*Packages) Values added in v0.1.0

func (p *Packages) Values(value PackageName) map[ModuleName]Package

Values returns a copy of currently set modules and their packages by package.

type Versions

type Versions struct {
	Modules    map[ModuleName]Module
	GoVersions GoVersions
	Packages   Packages
}

Versions contains the parsed go.mod files.

func New added in v0.1.0

func New(files []string) (Versions, error)

New returns the parsed versions used by all the mod files.

Directories

Path Synopsis
cmd
Package markdown allows versions to be rendered as basic Flavored Markdown, supported by GitLab and GitHub.
Package markdown allows versions to be rendered as basic Flavored Markdown, supported by GitLab and GitHub.

Jump to

Keyboard shortcuts

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