mirror of
https://github.com/containers/skopeo.git
synced 2025-09-06 09:12:25 +00:00
Update c/image after https://github.com/containers/image/pull/2408
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This commit is contained in:
49
vendor/github.com/go-openapi/loads/.golangci.yml
generated
vendored
49
vendor/github.com/go-openapi/loads/.golangci.yml
generated
vendored
@@ -4,41 +4,58 @@ linters-settings:
|
||||
golint:
|
||||
min-confidence: 0
|
||||
gocyclo:
|
||||
min-complexity: 30
|
||||
min-complexity: 45
|
||||
maligned:
|
||||
suggest-new: true
|
||||
dupl:
|
||||
threshold: 100
|
||||
threshold: 200
|
||||
goconst:
|
||||
min-len: 2
|
||||
min-occurrences: 4
|
||||
min-occurrences: 3
|
||||
|
||||
linters:
|
||||
enable-all: true
|
||||
disable:
|
||||
- maligned
|
||||
- unparam
|
||||
- lll
|
||||
- gochecknoglobals
|
||||
- gochecknoinits
|
||||
- gochecknoglobals
|
||||
- funlen
|
||||
- godox
|
||||
- gocognit
|
||||
- whitespace
|
||||
- wsl
|
||||
- funlen
|
||||
- gochecknoglobals
|
||||
- gochecknoinits
|
||||
- scopelint
|
||||
- wrapcheck
|
||||
- exhaustivestruct
|
||||
- exhaustive
|
||||
- nlreturn
|
||||
- testpackage
|
||||
- gci
|
||||
- gofumpt
|
||||
- goerr113
|
||||
- nlreturn
|
||||
- gomnd
|
||||
- tparallel
|
||||
- exhaustivestruct
|
||||
- goerr113
|
||||
- errorlint
|
||||
- nestif
|
||||
- godot
|
||||
- errorlint
|
||||
- gofumpt
|
||||
- paralleltest
|
||||
- tparallel
|
||||
- thelper
|
||||
- ifshort
|
||||
- exhaustruct
|
||||
- varnamelen
|
||||
- gci
|
||||
- depguard
|
||||
- errchkjson
|
||||
- inamedparam
|
||||
- nonamedreturns
|
||||
- musttag
|
||||
- ireturn
|
||||
- forcetypeassert
|
||||
- cyclop
|
||||
# deprecated linters
|
||||
- deadcode
|
||||
- interfacer
|
||||
- scopelint
|
||||
- varcheck
|
||||
- structcheck
|
||||
- golint
|
||||
- nosnakecase
|
||||
|
2
vendor/github.com/go-openapi/loads/README.md
generated
vendored
2
vendor/github.com/go-openapi/loads/README.md
generated
vendored
@@ -1,4 +1,4 @@
|
||||
# Loads OAI specs [](https://travis-ci.org/go-openapi/loads) [](https://codecov.io/gh/go-openapi/loads) [](https://slackin.goswagger.io) [](https://github.com/go-openapi/loads/actions?query=workflow%3A"Go+Test")
|
||||
# Loads OAI specs [](https://github.com/go-openapi/loads/actions?query=workflow%3A"go+test") [](https://codecov.io/gh/go-openapi/loads)
|
||||
|
||||
[](https://raw.githubusercontent.com/go-openapi/loads/master/LICENSE) [](http://godoc.org/github.com/go-openapi/loads)
|
||||
[](https://goreportcard.com/report/github.com/go-openapi/loads)
|
||||
|
9
vendor/github.com/go-openapi/loads/doc.go
generated
vendored
9
vendor/github.com/go-openapi/loads/doc.go
generated
vendored
@@ -12,10 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
/*
|
||||
Package loads provides document loading methods for swagger (OAI) specifications.
|
||||
|
||||
It is used by other go-openapi packages to load and run analysis on local or remote spec documents.
|
||||
|
||||
*/
|
||||
// Package loads provides document loading methods for swagger (OAI) specifications.
|
||||
//
|
||||
// It is used by other go-openapi packages to load and run analysis on local or remote spec documents.
|
||||
package loads
|
||||
|
9
vendor/github.com/go-openapi/loads/loaders.go
generated
vendored
9
vendor/github.com/go-openapi/loads/loaders.go
generated
vendored
@@ -21,7 +21,7 @@ var (
|
||||
func init() {
|
||||
jsonLoader := &loader{
|
||||
DocLoaderWithMatch: DocLoaderWithMatch{
|
||||
Match: func(pth string) bool {
|
||||
Match: func(_ string) bool {
|
||||
return true
|
||||
},
|
||||
Fn: JSONDoc,
|
||||
@@ -86,7 +86,7 @@ func (l *loader) Load(path string) (json.RawMessage, error) {
|
||||
return nil, erp
|
||||
}
|
||||
|
||||
var lastErr error = errors.New("no loader matched") // default error if no match was found
|
||||
lastErr := errors.New("no loader matched") // default error if no match was found
|
||||
for ldr := l; ldr != nil; ldr = ldr.Next {
|
||||
if ldr.Match != nil && !ldr.Match(path) {
|
||||
continue
|
||||
@@ -118,9 +118,8 @@ func JSONDoc(path string) (json.RawMessage, error) {
|
||||
// This sets the configuration at the package level.
|
||||
//
|
||||
// NOTE:
|
||||
// * this updates the default loader used by github.com/go-openapi/spec
|
||||
// * since this sets package level globals, you shouln't call this concurrently
|
||||
//
|
||||
// - this updates the default loader used by github.com/go-openapi/spec
|
||||
// - since this sets package level globals, you shouln't call this concurrently
|
||||
func AddLoader(predicate DocMatcher, load DocLoader) {
|
||||
loaders = loaders.WithHead(&loader{
|
||||
DocLoaderWithMatch: DocLoaderWithMatch{
|
||||
|
35
vendor/github.com/go-openapi/loads/spec.go
generated
vendored
35
vendor/github.com/go-openapi/loads/spec.go
generated
vendored
@@ -38,8 +38,8 @@ type Document struct {
|
||||
specFilePath string
|
||||
origSpec *spec.Swagger
|
||||
schema *spec.Schema
|
||||
raw json.RawMessage
|
||||
pathLoader *loader
|
||||
raw json.RawMessage
|
||||
}
|
||||
|
||||
// JSONSpec loads a spec from a json document
|
||||
@@ -49,7 +49,14 @@ func JSONSpec(path string, options ...LoaderOption) (*Document, error) {
|
||||
return nil, err
|
||||
}
|
||||
// convert to json
|
||||
return Analyzed(data, "", options...)
|
||||
doc, err := Analyzed(data, "", options...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
doc.specFilePath = path
|
||||
|
||||
return doc, nil
|
||||
}
|
||||
|
||||
// Embedded returns a Document based on embedded specs. No analysis is required
|
||||
@@ -71,7 +78,6 @@ func Embedded(orig, flat json.RawMessage, options ...LoaderOption) (*Document, e
|
||||
|
||||
// Spec loads a new spec document from a local or remote path
|
||||
func Spec(path string, options ...LoaderOption) (*Document, error) {
|
||||
|
||||
ldr := loaderFromOptions(options)
|
||||
|
||||
b, err := ldr.Load(path)
|
||||
@@ -84,12 +90,10 @@ func Spec(path string, options ...LoaderOption) (*Document, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if document != nil {
|
||||
document.specFilePath = path
|
||||
document.pathLoader = ldr
|
||||
}
|
||||
document.specFilePath = path
|
||||
document.pathLoader = ldr
|
||||
|
||||
return document, err
|
||||
return document, nil
|
||||
}
|
||||
|
||||
// Analyzed creates a new analyzed spec document for a root json.RawMessage.
|
||||
@@ -117,7 +121,7 @@ func Analyzed(data json.RawMessage, version string, options ...LoaderOption) (*D
|
||||
}
|
||||
|
||||
d := &Document{
|
||||
Analyzer: analysis.New(swspec),
|
||||
Analyzer: analysis.New(swspec), // NOTE: at this moment, analysis does not follow $refs to documents outside the root doc
|
||||
schema: spec.MustLoadSwagger20Schema(),
|
||||
spec: swspec,
|
||||
raw: raw,
|
||||
@@ -152,9 +156,8 @@ func trimData(in json.RawMessage) (json.RawMessage, error) {
|
||||
return d, nil
|
||||
}
|
||||
|
||||
// Expanded expands the ref fields in the spec document and returns a new spec document
|
||||
// Expanded expands the $ref fields in the spec document and returns a new spec document
|
||||
func (d *Document) Expanded(options ...*spec.ExpandOptions) (*Document, error) {
|
||||
|
||||
swspec := new(spec.Swagger)
|
||||
if err := json.Unmarshal(d.raw, swspec); err != nil {
|
||||
return nil, err
|
||||
@@ -163,6 +166,9 @@ func (d *Document) Expanded(options ...*spec.ExpandOptions) (*Document, error) {
|
||||
var expandOptions *spec.ExpandOptions
|
||||
if len(options) > 0 {
|
||||
expandOptions = options[0]
|
||||
if expandOptions.RelativeBase == "" {
|
||||
expandOptions.RelativeBase = d.specFilePath
|
||||
}
|
||||
} else {
|
||||
expandOptions = &spec.ExpandOptions{
|
||||
RelativeBase: d.specFilePath,
|
||||
@@ -194,7 +200,7 @@ func (d *Document) Expanded(options ...*spec.ExpandOptions) (*Document, error) {
|
||||
return dd, nil
|
||||
}
|
||||
|
||||
// BasePath the base path for this spec
|
||||
// BasePath the base path for the API specified by this spec
|
||||
func (d *Document) BasePath() string {
|
||||
return d.spec.BasePath
|
||||
}
|
||||
@@ -242,8 +248,11 @@ func (d *Document) ResetDefinitions() *Document {
|
||||
|
||||
// Pristine creates a new pristine document instance based on the input data
|
||||
func (d *Document) Pristine() *Document {
|
||||
dd, _ := Analyzed(d.Raw(), d.Version())
|
||||
raw, _ := json.Marshal(d.Spec())
|
||||
dd, _ := Analyzed(raw, d.Version())
|
||||
dd.pathLoader = d.pathLoader
|
||||
dd.specFilePath = d.specFilePath
|
||||
|
||||
return dd
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user