rpath

find path of the element present at specified position

Stars
0
Committers
2

rpath

❯ ./dist/rpath --help
rpath - find path of the element present at specified position

Usage:

  rpath [flags] CATEGORY [FILE]

Available CATEGORY:
- yaml, yml
- json

Flags:
  -column int
        Column number of target, 1-based
  -debug
        Enable debug logs
  -line int
        Line number of target, 1-based
  -offset int
        Offset of target, 0-based (default -1)
  -verbose
        Verbose output

Examples

 cat - <<EOS | rpath -line 6 -column 10 yaml
apiVersion: v1
kind: Text
metadata:
  name: sometext
spec:
  text1: テキスト
  text2: text
EOS
$.spec.text1
 cat - <<EOS | rpath -line 8 -column 14 json
{
  "apiVersion": "v1",
  "kind": "Text",
  "metadata": {
    "name": "sometext"
  },
  "spec": {
    "text1": "テキスト",
    "text2": "text"
  }
}
EOS
.["spec"]["text1"]

Tasks

all

Requires: lint, test, build

test

Run unit tests and e2e tests.

go test -v -cover -race ./...

build

Build executable binary to dist/rpath.

./xc buildx "" ""

buildx

Build executable binary to dist/rpath.

Inputs: os, arch

goos=${os:-$(go env GOOS)}
goarch=${arch:-$(go env GOARCH)}
GOOS="$goos" GOARCH="$goarch" go build -trimpath -v -o dist/rpath ./cmd/rpath

lint

Run linters.

Requires: vet, vuln

vet

Examine code.

go vet ./...

vuln

Find vulnerabilities.

go run golang.org/x/vuln/cmd/govulncheck ./...

docker

Requires: docker-lint, docker-test, docker-build

docker-build

Build executable binary to dist/rpath.

export os="$(go env GOOS)"
export arch="$(go env GOARCH)"
./xc docker-buildx

docker-buildx

Build executable binary to dist/rpath.

Inputs: os, arch

docker build --progress plain --target build --build-arg os=$os --build-arg arch=$arch -o dist .

docker-test

Run unit tests and e2e tests.

docker build --progress plain --target test .

docker-lint

Run linters.

Requires: docker-vet, docker-vuln

docker-vet

Examine code.

docker build --progress plain --target vet .

docker-vuln

Find vulnerabilities.

docker build --progress plain --target vuln .