utils

package
v0.8.6 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: BSD-2-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AnalyzersData    DeepSourceAnalyzersData
	TransformersData DeepSourceTransformersData
)

Functions

func ConfirmFromUser

func ConfirmFromUser(msg, helpText string) (bool, error)

Used for (Yes/No) questions

func Cyan added in v0.3.8

func Cyan(format string, a ...interface{}) string

func ExactArgs

func ExactArgs(count int) cobra.PositionalArgs

Validates if the number of args passed to a command is exactly same as that required

func GetAnalyzersAndTransformersData

func GetAnalyzersAndTransformersData(ctx context.Context, deepsource deepsource.Client) (err error)

Get the list of all the supported analyzers and transformers with their corresponding data like shortcode, metaschema etc.

func GetSingleLineInput

func GetSingleLineInput(msg, helpText string) (string, error)

Used for Single Line Text Input Being used for getting "Import root" of user for configuring meta of Go analyzer

func ListRemotes

func ListRemotes() (map[string][]string, error)

Returns a map of remotes to their urls { "origin":["reponame","owner","provider"]} { "upstream":["reponame","owner","provider"]}

func MaxNArgs

func MaxNArgs(count int) cobra.PositionalArgs

func NoArgs

func NoArgs(cmd *cobra.Command, args []string) error

Validates if there is any arg passed to a command which doesn't require any

func RepoArgumentResolver

func RepoArgumentResolver(arg string) ([]string, error)

Utility to parse the --repo flag

func SelectFromMultipleOptions

func SelectFromMultipleOptions(msg, helpText string, options []string) ([]string, error)

Used for multiple inputs from the displayed options Example: ? Which languages/tools does your project use? > [ ] Shell

[ ]  Rust
[ ]  Test Coverage
[ ]  Python
[ ]  Go

func SelectFromOptions

func SelectFromOptions(msg, helpText string, opts []string) (string, error)

Used for Single Option Selection from Multiple Options Being used for selecting Java version for configuring meta of Java analyzer > * 1

  • 2
  • 3

func Yellow added in v0.3.8

func Yellow(format string, a ...interface{}) string

Types

type DeepSourceAnalyzersData

type DeepSourceAnalyzersData struct {
	AnalyzerNames      []string
	AnalyzerShortcodes []string
	AnalyzersMap       map[string]string // Map for {analyzer name : shortcode}
	AnalyzersMeta      []string
	AnalyzersMetaMap   map[string]string // Map for {analyzer name: analyzer meta-schema}
}

type DeepSourceTransformersData

type DeepSourceTransformersData struct {
	TransformerNames      []string
	TransformerShortcodes []string
	TransformerMap        map[string]string // Map for {transformer name:shortcode}
}

type RemoteData

type RemoteData struct {
	Owner       string
	RepoName    string
	VCSProvider string
}

func ResolveRemote

func ResolveRemote(repoArg string) (*RemoteData, error)

Jump to

Keyboard shortcuts

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