aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/breml
diff options
context:
space:
mode:
authorTaras Madan <tarasmadan@google.com>2024-11-11 11:41:38 +0100
committerTaras Madan <tarasmadan@google.com>2024-11-11 11:10:48 +0000
commit27e76fae2ee2d84dc7db63af1d9ed7358ba35b7a (patch)
treeed19c0e35e272b3c4cc5a2f2c595e035b2428337 /vendor/github.com/breml
parent621e84e063b0e15b23e17780338627c509e1b9e8 (diff)
vendor: update
Diffstat (limited to 'vendor/github.com/breml')
-rw-r--r--vendor/github.com/breml/bidichk/pkg/bidichk/bidichk.go33
-rw-r--r--vendor/github.com/breml/errchkjson/.goreleaser.yml7
-rw-r--r--vendor/github.com/breml/errchkjson/README.md2
-rw-r--r--vendor/github.com/breml/errchkjson/errchkjson.go2
4 files changed, 24 insertions, 20 deletions
diff --git a/vendor/github.com/breml/bidichk/pkg/bidichk/bidichk.go b/vendor/github.com/breml/bidichk/pkg/bidichk/bidichk.go
index f1bf20fab..39d3cd44e 100644
--- a/vendor/github.com/breml/bidichk/pkg/bidichk/bidichk.go
+++ b/vendor/github.com/breml/bidichk/pkg/bidichk/bidichk.go
@@ -14,7 +14,7 @@ import (
)
const (
- doc = "bidichk detects dangerous unicode character sequences"
+ doc = "Checks for dangerous unicode character sequences"
disallowedDoc = `comma separated list of disallowed runes (full name or short name)
Supported runes
@@ -142,25 +142,28 @@ func NewAnalyzer() *analysis.Analyzer {
}
func (b bidichk) run(pass *analysis.Pass) (interface{}, error) {
- var err error
+ readFile := pass.ReadFile
+ if readFile == nil {
+ readFile = os.ReadFile
+ }
- pass.Fset.Iterate(func(f *token.File) bool {
- if strings.HasPrefix(f.Name(), "$GOROOT") {
- return true
+ for _, astFile := range pass.Files {
+ f := pass.Fset.File(astFile.FileStart)
+ if f == nil {
+ continue
}
- return b.check(f.Name(), f.Pos(0), pass) == nil
- })
-
- return nil, err
-}
+ body, err := readFile(f.Name())
+ if err != nil {
+ return nil, err
+ }
-func (b bidichk) check(filename string, pos token.Pos, pass *analysis.Pass) error {
- body, err := os.ReadFile(filename)
- if err != nil {
- return err
+ b.check(body, f.Pos(0), pass)
}
+ return nil, nil
+}
+func (b bidichk) check(body []byte, pos token.Pos, pass *analysis.Pass) {
for name, r := range b.disallowedRunes {
start := 0
for {
@@ -175,6 +178,4 @@ func (b bidichk) check(filename string, pos token.Pos, pass *analysis.Pass) erro
start += utf8.RuneLen(r)
}
}
-
- return nil
}
diff --git a/vendor/github.com/breml/errchkjson/.goreleaser.yml b/vendor/github.com/breml/errchkjson/.goreleaser.yml
index a05c172cb..111369053 100644
--- a/vendor/github.com/breml/errchkjson/.goreleaser.yml
+++ b/vendor/github.com/breml/errchkjson/.goreleaser.yml
@@ -1,3 +1,6 @@
+---
+version: 2
+
# This is an example .goreleaser.yml file with some sane defaults.
# Make sure to check the documentation at http://goreleaser.com
before:
@@ -23,9 +26,9 @@ archives:
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end -}}
snapshot:
- name_template: "{{ .Tag }}-next"
+ version_template: "{{ .Tag }}-next"
changelog:
- skip: true
+ disable: true
release:
github:
owner: breml
diff --git a/vendor/github.com/breml/errchkjson/README.md b/vendor/github.com/breml/errchkjson/README.md
index 197959738..a387ea23d 100644
--- a/vendor/github.com/breml/errchkjson/README.md
+++ b/vendor/github.com/breml/errchkjson/README.md
@@ -55,7 +55,7 @@ response type, the linter will warn you.
Download `errchkjson` from the [releases](https://github.com/breml/errchkjson/releases) or get the latest version from source with:
```shell
-go get github.com/breml/errchkjson/cmd/errchkjson
+go install github.com/breml/errchkjson/cmd/errchkjson@latest
```
## Usage
diff --git a/vendor/github.com/breml/errchkjson/errchkjson.go b/vendor/github.com/breml/errchkjson/errchkjson.go
index 4a23929cf..7c8cd82e9 100644
--- a/vendor/github.com/breml/errchkjson/errchkjson.go
+++ b/vendor/github.com/breml/errchkjson/errchkjson.go
@@ -25,7 +25,7 @@ func NewAnalyzer() *analysis.Analyzer {
a := &analysis.Analyzer{
Name: "errchkjson",
- Doc: "Checks types passed to the json encoding functions. Reports unsupported types and reports occations, where the check for the returned error can be omitted.",
+ Doc: "Checks types passed to the json encoding functions. Reports unsupported types and reports occurrences where the check for the returned error can be omitted.",
Run: errchkjson.run,
}