Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ linters:
disable:
- depguard
- funlen
- goconst
- godox
- gomoddirectives
- gomodguard
- gomodguard_v2
- exhaustruct
- nlreturn
- nonamedreturns
Expand Down
2 changes: 1 addition & 1 deletion flatten.go
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ func stripOAIGenForRef(opts *FlattenOpts, k string, r *newRef) (bool, error) {
}

// rewrite other parents to point to first parent
if len(pr) > 1 {
if len(pr) > 1 { //nolint:nestif // should be refactored at a later time
for _, p := range pr[1:] {
replacingRef := spec.MustCreateRef(pr[0])

Expand Down
4 changes: 2 additions & 2 deletions flatten_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ type FlattenOpts struct {
RemoveUnused bool // When true, remove unused parameters, responses and definitions after expansion/flattening
ContinueOnError bool // Continue when spec expansion issues are found
KeepNames bool // Do not attempt to jsonify names from references when flattening
ManglerOpts []mangling.Option // Options for the name mangler used to jsonify names
ManglerOpts []mangling.Option `json:"-"` // Options for the name mangler used to jsonify names

// PathLoaderWithOptions injects the document loader used to resolve remote and relative $ref
// while flattening or expanding the specification. It matches the option-aware loader signature
Expand All @@ -43,7 +43,7 @@ type FlattenOpts struct {
// confined loader — for example one built with loading.WithRoot (to confine local reads) and
// loading.WithHTTPClient (to restrict remote fetches), or a restricted loader from
// go-openapi/loads. Left nil, the spec package default (unsandboxed) loader is used.
PathLoaderWithOptions func(string, ...loading.Option) (json.RawMessage, error)
PathLoaderWithOptions func(string, ...loading.Option) (json.RawMessage, error) `json:"-"`

/* Extra keys */
_ struct{} // require keys
Expand Down
2 changes: 1 addition & 1 deletion internal/antest/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ info:
}

require.NoError(t,
os.WriteFile(file, data, 0o600), //nolint:gosec // false positive on temp test dir: G703: Path traversal via taint analysis.
os.WriteFile(file, data, 0o600),
)

return file, func() {}
Expand Down
6 changes: 3 additions & 3 deletions internal/debug/debug_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
// SPDX-License-Identifier: Apache-2.0

package debug //nolint:revive // this package is called debug and there is no confusion with the standard library for that.
package debug

import (
"os"
Expand Down Expand Up @@ -32,7 +32,7 @@ func TestDebug(t *testing.T) {
tmpFile.Close()
tmpFileClosed = true

flushed, err := os.ReadFile(tmpName) //nolint:gosec // false positive on temp test dir: G703: Path traversal via taint analysis.
flushed, err := os.ReadFile(tmpName)
require.NoError(t, err)

assert.StringContainsT(t, string(flushed), "A debug: a string")
Expand All @@ -53,7 +53,7 @@ func TestDebug(t *testing.T) {
tmpEmptyFile.Close()
tmpEmptyFileClosed = true

flushed, err = os.ReadFile(tmpEmpty) //nolint:gosec // false positive on temp test dir: G703: Path traversal via taint analysis.
flushed, err = os.ReadFile(tmpEmpty)
require.NoError(t, err)

assert.Empty(t, flushed)
Expand Down
Loading