mirror of
https://gitee.com/mirrors_adrian-thurston/yq.git
synced 2026-01-15 07:53:35 +08:00
Compare commits
4 Commits
v4.25.3-st
...
pr-check
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ee60557951 | ||
|
|
2e7f3a4410 | ||
|
|
66d273d0f3 | ||
|
|
c223df7912 |
4
.github/workflows/go.yml
vendored
4
.github/workflows/go.yml
vendored
@@ -1,5 +1,5 @@
|
||||
name: Build
|
||||
on: [push]
|
||||
on: [push, pull_request]
|
||||
jobs:
|
||||
|
||||
build:
|
||||
@@ -24,7 +24,7 @@ jobs:
|
||||
dep ensure
|
||||
fi
|
||||
|
||||
- name: Download deps
|
||||
- name: Check the build
|
||||
run: |
|
||||
export PATH=${PATH}:`go env GOPATH`/bin
|
||||
scripts/devtools.sh
|
||||
|
||||
11
Makefile
11
Makefile
@@ -81,14 +81,17 @@ vendor: tmp/dev_image_id
|
||||
format: vendor
|
||||
${DOCKRUN} bash ./scripts/format.sh
|
||||
|
||||
.PHONY: check
|
||||
check: format
|
||||
${DOCKRUN} bash ./scripts/check.sh
|
||||
|
||||
.PHONY: secure
|
||||
secure:
|
||||
secure: format
|
||||
${DOCKRUN} bash ./scripts/secure.sh
|
||||
|
||||
.PHONY: check
|
||||
check: secure
|
||||
${DOCKRUN} bash ./scripts/check.sh
|
||||
|
||||
|
||||
|
||||
.PHONY: test
|
||||
test: check
|
||||
${DOCKRUN} bash ./scripts/test.sh
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
set -ex
|
||||
go get golang.org/x/tools/cmd/goimports
|
||||
wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.37.1
|
||||
# wget -O- -nv https://raw.githubusercontent.com/securego/gosec/master/install.sh | sh -s v2.8.1
|
||||
wget -O- -nv https://raw.githubusercontent.com/securego/gosec/master/install.sh | sh -s v2.9.1
|
||||
|
||||
@@ -3,7 +3,6 @@ package test
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"reflect"
|
||||
"strings"
|
||||
@@ -69,24 +68,3 @@ func AssertResultWithContext(t *testing.T, expectedValue interface{}, actualValu
|
||||
t.Error(": expected <", expectedValue, "> but got <", actualValue, ">")
|
||||
}
|
||||
}
|
||||
|
||||
func WriteTempYamlFile(content string) string {
|
||||
tmpfile, _ := ioutil.TempFile("", "testyaml")
|
||||
defer func() {
|
||||
_ = tmpfile.Close()
|
||||
}()
|
||||
|
||||
_, _ = tmpfile.Write([]byte(content))
|
||||
return tmpfile.Name()
|
||||
}
|
||||
|
||||
func ReadTempYamlFile(name string) string {
|
||||
// ignore CWE-22 gosec issue - that's more targetted for http based apps that run in a public directory,
|
||||
// and ensuring that it's not possible to give a path to a file outside thar directory.
|
||||
content, _ := ioutil.ReadFile(name) // #nosec
|
||||
return string(content)
|
||||
}
|
||||
|
||||
func RemoveTempYamlFile(name string) {
|
||||
_ = os.Remove(name)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user