New Upstream Release - golang-github-awalterschulze-gographviz
Ready changes
Summary
Merged new upstream version: 2.0.3 (was: 2.0.1).
Resulting package
Built on 2022-11-09T20:47 (took 5m2s)
The resulting binary packages can be installed (if you have the apt repository enabled) by running one of:
apt install -t fresh-releases golang-github-awalterschulze-gographviz-dev
Lintian Result
Diff
diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
new file mode 100644
index 0000000..42bed18
--- /dev/null
+++ b/.github/workflows/build.yaml
@@ -0,0 +1,47 @@
+name: build
+
+on: [push, pull_request]
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ env:
+ working-directory: ./src/github.com/awalterschulze/gographviz
+
+ steps:
+ - name: Set GOPATH
+ run: |
+ echo "##[set-env name=GOPATH;]$(dirname $GITHUB_WORKSPACE)/gographviz"
+ echo "##[add-path]$(dirname $GITHUB_WORKSPACE)/gographviz/bin"
+ shell: bash
+
+ - name: Setup Go
+ uses: actions/setup-go@v2
+ with:
+ go-version: '1.14'
+
+ - name: Checkout
+ uses: actions/checkout@v2
+ with:
+ fetch-depth: 1
+ path: src/github.com/awalterschulze/gographviz
+
+ - name: Install dependencies
+ run: make dependencies
+ working-directory: ${{env.working-directory}}
+
+ - name: Run regenerate
+ run: make regenerate
+ working-directory: ${{env.working-directory}}
+
+ - name: Run build
+ run: make build
+ working-directory: ${{env.working-directory}}
+
+ - name: Run checkers
+ run: make checkers
+ working-directory: ${{env.working-directory}}
+
+ - name: Run testing
+ run: make test
+ working-directory: ${{env.working-directory}}
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 015aa52..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1,10 +0,0 @@
-before_install:
- - ./install-godeps.sh
-
-script:
- - make travis
-
-language: go
-
-go:
- - 1.x
diff --git a/Makefile b/Makefile
index 0e1bdb4..cf7f9e9 100644
--- a/Makefile
+++ b/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
diff --git a/Readme.md b/Readme.md
index 669c930..967b6c6 100644
--- a/Readme.md
+++ b/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 ###
@@ -34,6 +36,8 @@ go get github.com/awalterschulze/gographviz
- [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 ###
diff --git a/analysewrite_test.go b/analysewrite_test.go
index 43164e7..a867f24 100644
--- a/analysewrite_test.go
+++ b/analysewrite_test.go
@@ -106,6 +106,11 @@ func TestString(t *testing.T) {
`digraph finite_state { rankdir = "LR" }`)
}
+func TestAttrImgPos(t *testing.T) {
+ anal(t,
+ "digraph finite_state { imagepos = tc }")
+}
+
func TestAttrList(t *testing.T) {
anal(t, `
digraph { node [ shape = doublecircle ] }`)
diff --git a/attr.go b/attr.go
index 35004fa..ee6401e 100644
--- a/attr.go
+++ b/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,
diff --git a/debian/changelog b/debian/changelog
index 9ed234b..79be9cf 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+golang-github-awalterschulze-gographviz (2.0.3-1) UNRELEASED; urgency=low
+
+ * New upstream release.
+
+ -- Debian Janitor <janitor@jelmer.uk> Wed, 09 Nov 2022 20:42:34 -0000
+
golang-github-awalterschulze-gographviz (2.0.1-2) unstable; urgency=medium
[ Debian Janitor ]
diff --git a/escape.go b/escape.go
index 91e68d9..3b16c4f 100644
--- a/escape.go
+++ b/escape.go
@@ -78,6 +78,9 @@ func isID(s string) bool {
if c == '/' {
return false
}
+ if c == '.' {
+ return false
+ }
i++
}
return pos
diff --git a/escape_test.go b/escape_test.go
index 856d6fd..b0af266 100644
--- a/escape_test.go
+++ b/escape_test.go
@@ -46,11 +46,23 @@ func TestEscape(t *testing.T) {
if err := g.AddNode("asdf asdf", "a/b", nil); err != nil {
t.Fatal(err)
}
+ if err := g.AddNode("asdf asdf", "c.d", nil); err != nil {
+ t.Fatal(err)
+ }
+ if err := g.AddNode("asdf asdf", "e-f", nil); err != nil {
+ t.Fatal(err)
+ }
+ if err := g.AddNode("asdf asdf", "12_34", nil); err != nil {
+ t.Fatal(err)
+ }
s := g.String()
if !strings.HasPrefix(s, `digraph "asdf adsf" {
"kasdf99 99"->7;
+ "12_34";
"a << b";
"a/b";
+ "c.d";
+ "e-f";
"kasdf99 99" [ URL="<a" ];
7 [ URL="<a" ];
diff --git a/install-godeps.sh b/install-godeps.sh
deleted file mode 100755
index d5878ae..0000000
--- a/install-godeps.sh
+++ /dev/null
@@ -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
\ No newline at end of file
diff --git a/internal/token/token.go b/internal/token/token.go
index 873fe8e..a0f5ff1 100644
--- a/internal/token/token.go
+++ b/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",
Debdiff
File lists identical (after any substitutions)
No differences were encountered in the control files