Explorar el Código

build(deps): bump github.com/awalterschulze/gographviz

Bumps [github.com/awalterschulze/gographviz](https://github.com/awalterschulze/gographviz) from 0.0.0-20181013152038-b2885df04310 to 2.0.3+incompatible.
- [Release notes](https://github.com/awalterschulze/gographviz/releases)
- [Commits](https://github.com/awalterschulze/gographviz/commits/v2.0.3)

---
updated-dependencies:
- dependency-name: github.com/awalterschulze/gographviz
  dependency-version: 2.0.3+incompatible
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
dependabot[bot] hace 2 meses
padre
commit
777e48d729

+ 1 - 1
go.mod

@@ -3,7 +3,7 @@ module github.com/squat/kilo
 go 1.25.0
 
 require (
-	github.com/awalterschulze/gographviz v0.0.0-20181013152038-b2885df04310
+	github.com/awalterschulze/gographviz v2.0.3+incompatible
 	github.com/containernetworking/cni v1.3.0
 	github.com/containernetworking/plugins v1.1.1
 	github.com/coreos/go-iptables v0.8.0

+ 2 - 2
go.sum

@@ -8,8 +8,8 @@ github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuy
 github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
 github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
 github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
-github.com/awalterschulze/gographviz v0.0.0-20181013152038-b2885df04310 h1:t+qxRrRtwNiUYA+Xh2jSXhoG2grnMCMKX4Fg6lx9X1U=
-github.com/awalterschulze/gographviz v0.0.0-20181013152038-b2885df04310/go.mod h1:GEV5wmg4YquNw7v1kkyoX9etIk8yVmXj+AkDHuuETHs=
+github.com/awalterschulze/gographviz v2.0.3+incompatible h1:9sVEXJBJLwGX7EQVhLm2elIKCm7P2YHFC8v6096G09E=
+github.com/awalterschulze/gographviz v2.0.3+incompatible/go.mod h1:GEV5wmg4YquNw7v1kkyoX9etIk8yVmXj+AkDHuuETHs=
 github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
 github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
 github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=

+ 0 - 10
vendor/github.com/awalterschulze/gographviz/.travis.yml

@@ -1,10 +0,0 @@
-before_install:
-  - ./install-godeps.sh
-
-script:
-  - make travis
-
-language: go
-
-go:
-  - 1.8

+ 24 - 7
vendor/github.com/awalterschulze/gographviz/Makefile

@@ -1,16 +1,33 @@
-regenerate:
+.PHONY: help regenerate test dependencies build checkers action
+
+# Prefer tools that we've installed
+export PATH := $(HOME)/go/bin:$(PATH)
+
+help:
+	@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
+
+regenerate: ## Re-generate lexers and parsers and pass through goimports
+	go get github.com/goccmack/gocc
 	go install github.com/goccmack/gocc
-	gocc -zip -o ./internal/ dot.bnf 
+	gocc -zip -o ./internal/ dot.bnf
 	find . -type f -name '*.go' | xargs goimports -w
 
-test:
+test: ## Perform package tests
 	go test ./...
 
-travis:
-	make regenerate
-	go build ./...
-	go test ./...
+dependencies: ## Grab necessary dependencies for checkers
+	go version
+	go get golang.org/x/tools/cmd/goimports
+	go get github.com/kisielk/errcheck
+	go get -u golang.org/x/lint/golint
+
+build: ## Perform build process
+	go build .
+
+checkers: ## Run all checkers (errcheck, gofmt and golint)
 	errcheck -ignore 'fmt:[FS]?[Pp]rint*' ./...
 	gofmt -l -s -w .
 	golint -set_exit_status
 	git diff --exit-code
+
+action: dependencies regenerate build test checkers ## Run steps of github action

+ 8 - 3
vendor/github.com/awalterschulze/gographviz/Readme.md

@@ -18,14 +18,16 @@ output := graph.String()
 
 ### Documentation ###
 
-The [godoc](https://godoc.org/github.com/awalterschulze/gographviz) includes some more examples.
+  - The [godoc](https://godoc.org/github.com/awalterschulze/gographviz) includes some more examples.
+  - [How to implement an anonymous subgraph](https://github.com/awalterschulze/gographviz/issues/59)
 
 ### Installation ###
 go get github.com/awalterschulze/gographviz
 
-### Tests ###
+### Build and Tests ###
+
+[![Build Status](https://github.com/awalterschulze/gographviz/workflows/build/badge.svg)](https://github.com/awalterschulze/gographviz/actions)
 
-[![Build Status](https://travis-ci.org/awalterschulze/gographviz.svg?branch=master)](https://travis-ci.org/awalterschulze/gographviz)
 
 ### Users ###
 
@@ -33,6 +35,9 @@ go get github.com/awalterschulze/gographviz
   - [gorgonia](https://github.com/chewxy/gorgonia) - A Library that helps facilitate machine learning in Go
   - [imagemonkey](https://imagemonkey.io/graph?editor=true) - Let's create our own image dataset
   - [depviz](https://github.com/moul/depviz) - GitHub dependency visualizer (auto-roadmap)
+  - [kustomize-graph](https://github.com/jpreese/kustomize-graph) - A tool to visualize Kustomize dependencies
+  - [inframap](https://github.com/cycloidio/inframap) - Read your tfstate or HCL to generate a graph specific for each Terraform provider
+  - [Antrea Traceflow](https://github.com/vmware-tanzu/antrea/blob/master/docs/traceflow-guide.md) supports using Traceflow for network diagnosis for Antrea, a Kubernetes networking solution intended to be Kubernetes native
 
 ### Mentions ###
 

+ 18 - 7
vendor/github.com/awalterschulze/gographviz/ast/ast.go

@@ -21,12 +21,14 @@ import (
 	"math/rand"
 	"sort"
 	"strings"
+	"sync"
 
 	"github.com/awalterschulze/gographviz/internal/token"
 )
 
 var (
-	r = rand.New(rand.NewSource(1234))
+	r        = rand.New(rand.NewSource(1234))
+	randLock sync.Mutex
 )
 
 type Visitor interface {
@@ -183,12 +185,14 @@ type SubGraph struct {
 	StmtList StmtList
 }
 
-func NewSubGraph(id, l Attrib) (*SubGraph, error) {
-	g := &SubGraph{ID: ID(fmt.Sprintf("anon%d", r.Int63()))}
-	if id != nil {
-		if len(id.(ID)) > 0 {
-			g.ID = id.(ID)
-		}
+func NewSubGraph(maybeId, l Attrib) (*SubGraph, error) {
+	g := &SubGraph{}
+	if id, ok := maybeId.(ID); maybeId == nil || (ok && len(id) == 0) {
+		g.ID = ID(fmt.Sprintf("anon%d", randInt63()))
+	} else if ok && (len(id) > 0) {
+		g.ID = id
+	} else {
+		return nil, fmt.Errorf("expected maybeId.(ID) got=%v", maybeId)
 	}
 	if l != nil {
 		g.StmtList = l.(StmtList)
@@ -196,6 +200,13 @@ func NewSubGraph(id, l Attrib) (*SubGraph, error) {
 	return g, nil
 }
 
+func randInt63() int64 {
+	randLock.Lock()
+	result := r.Int63()
+	randLock.Unlock()
+	return result
+}
+
 func (this *SubGraph) GetID() ID {
 	return this.ID
 }

+ 3 - 0
vendor/github.com/awalterschulze/gographviz/attr.go

@@ -141,6 +141,8 @@ const (
 	Image Attr = "image"
 	// ImagePath http://graphviz.gitlab.io/_pages/doc/info/attrs.html#d:imagepath
 	ImagePath Attr = "imagepath"
+	// ImagePos https://graphviz.org/doc/info/attrs.html#d:imagepos
+	ImagePos Attr = "imagepos"
 	// ImageScale http://graphviz.gitlab.io/_pages/doc/info/attrs.html#d:imagescale
 	ImageScale Attr = "imagescale"
 	// InputScale http://graphviz.gitlab.io/_pages/doc/info/attrs.html#d:inputscale
@@ -437,6 +439,7 @@ var validAttrs = map[string]Attr{
 	string(ID):                 ID,
 	string(Image):              Image,
 	string(ImagePath):          ImagePath,
+	string(ImagePos):           ImagePos,
 	string(ImageScale):         ImageScale,
 	string(InputScale):         InputScale,
 	string(Label):              Label,

+ 3 - 0
vendor/github.com/awalterschulze/gographviz/escape.go

@@ -78,6 +78,9 @@ func isID(s string) bool {
 		if c == '/' {
 			return false
 		}
+		if c == '.' {
+			return false
+		}
 		i++
 	}
 	return pos

+ 0 - 7
vendor/github.com/awalterschulze/gographviz/install-godeps.sh

@@ -1,7 +0,0 @@
-#!/usr/bin/env bash
-set -xe
-mkdir -p $GOPATH/src/githbub.com/goccmack
-git clone https://github.com/goccmack/gocc $GOPATH/src/github.com/goccmack/gocc
-go get golang.org/x/tools/cmd/goimports
-go get github.com/kisielk/errcheck
-go get -u golang.org/x/lint/golint

+ 3 - 3
vendor/github.com/awalterschulze/gographviz/internal/errors/errors.go

@@ -3,8 +3,8 @@
 package errors
 
 import (
-	"bytes"
 	"fmt"
+	"strings"
 
 	"github.com/awalterschulze/gographviz/internal/token"
 )
@@ -21,7 +21,7 @@ type Error struct {
 }
 
 func (e *Error) String() string {
-	w := new(bytes.Buffer)
+	w := new(strings.Builder)
 	fmt.Fprintf(w, "Error")
 	if e.Err != nil {
 		fmt.Fprintf(w, " %s\n", e.Err)
@@ -42,7 +42,7 @@ func (e *Error) String() string {
 }
 
 func (e *Error) Error() string {
-	w := new(bytes.Buffer)
+	w := new(strings.Builder)
 	fmt.Fprintf(w, "Error in S%d: %s, %s", e.StackTop, token.TokMap.TokenString(e.ErrorToken), e.ErrorToken.Pos.String())
 	if e.Err != nil {
 		fmt.Fprintf(w, ": %+v", e.Err)

+ 2 - 2
vendor/github.com/awalterschulze/gographviz/internal/parser/parser.go

@@ -3,8 +3,8 @@
 package parser
 
 import (
-	"bytes"
 	"fmt"
+	"strings"
 
 	parseError "github.com/awalterschulze/gographviz/internal/errors"
 	"github.com/awalterschulze/gographviz/internal/token"
@@ -66,7 +66,7 @@ func (s *stack) popN(items int) []Attrib {
 }
 
 func (s *stack) String() string {
-	w := new(bytes.Buffer)
+	w := new(strings.Builder)
 	fmt.Fprintf(w, "stack:\n")
 	for i, st := range s.state {
 		fmt.Fprintf(w, "\t%d: %d , ", i, st)

+ 60 - 0
vendor/github.com/awalterschulze/gographviz/internal/token/token.go

@@ -4,6 +4,8 @@ package token
 
 import (
 	"fmt"
+	"strconv"
+	"unicode/utf8"
 )
 
 type Token struct {
@@ -57,6 +59,64 @@ func (m TokenMap) StringType(typ Type) string {
 	return fmt.Sprintf("%s(%d)", m.Id(typ), typ)
 }
 
+// CharLiteralValue returns the string value of the char literal.
+func (t *Token) CharLiteralValue() string {
+	return string(t.Lit[1 : len(t.Lit)-1])
+}
+
+// Float32Value returns the float32 value of the token or an error if the token literal does not
+// denote a valid float32.
+func (t *Token) Float32Value() (float32, error) {
+	if v, err := strconv.ParseFloat(string(t.Lit), 32); err != nil {
+		return 0, err
+	} else {
+		return float32(v), nil
+	}
+}
+
+// Float64Value returns the float64 value of the token or an error if the token literal does not
+// denote a valid float64.
+func (t *Token) Float64Value() (float64, error) {
+	return strconv.ParseFloat(string(t.Lit), 64)
+}
+
+// IDValue returns the string representation of an identifier token.
+func (t *Token) IDValue() string {
+	return string(t.Lit)
+}
+
+// Int32Value returns the int32 value of the token or an error if the token literal does not
+// denote a valid float64.
+func (t *Token) Int32Value() (int32, error) {
+	if v, err := strconv.ParseInt(string(t.Lit), 10, 64); err != nil {
+		return 0, err
+	} else {
+		return int32(v), nil
+	}
+}
+
+// Int64Value returns the int64 value of the token or an error if the token literal does not
+// denote a valid float64.
+func (t *Token) Int64Value() (int64, error) {
+	return strconv.ParseInt(string(t.Lit), 10, 64)
+}
+
+// UTF8Rune decodes the UTF8 rune in the token literal. It returns utf8.RuneError if
+// the token literal contains an invalid rune.
+func (t *Token) UTF8Rune() (rune, error) {
+	r, _ := utf8.DecodeRune(t.Lit)
+	if r == utf8.RuneError {
+		err := fmt.Errorf("Invalid rune")
+		return r, err
+	}
+	return r, nil
+}
+
+// StringValue returns the string value of the token literal.
+func (t *Token) StringValue() string {
+	return string(t.Lit[1 : len(t.Lit)-1])
+}
+
 var TokMap = TokenMap{
 	typeMap: []string{
 		"INVALID",

+ 1 - 1
vendor/modules.txt

@@ -2,7 +2,7 @@
 ## explicit; go 1.16
 github.com/BurntSushi/toml
 github.com/BurntSushi/toml/internal
-# github.com/awalterschulze/gographviz v0.0.0-20181013152038-b2885df04310
+# github.com/awalterschulze/gographviz v2.0.3+incompatible
 ## explicit
 github.com/awalterschulze/gographviz
 github.com/awalterschulze/gographviz/ast