-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Go module aware scan #1991
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Go module aware scan #1991
Conversation
Signed-off-by: Ivan Porto Carrero <ivan@flanders.co.nz>
Signed-off-by: Ivan Porto Carrero <ivan@flanders.co.nz>
Signed-off-by: Ivan Porto Carrero <ivan@flanders.co.nz>
Signed-off-by: Ivan Porto Carrero <ivan@flanders.co.nz>
install tools in gopath on appveyor ` Signed-off-by: Ivan Porto Carrero <ivan@flanders.co.nz>
Codecov Report
@@ Coverage Diff @@
## master #1991 +/- ##
==========================================
- Coverage 80.91% 80.34% -0.58%
==========================================
Files 47 46 -1
Lines 8066 8161 +95
==========================================
+ Hits 6527 6557 +30
- Misses 1043 1099 +56
- Partials 496 505 +9
Continue to review full report at Codecov.
|
codescan/parser.go
Outdated
} | ||
if req { | ||
su.schema.Discriminator = su.field | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
elseif: can replace 'else {if cond {}}' with 'else if cond {}' (from gocritic
)
codescan/parser.go
Outdated
} | ||
} | ||
} | ||
return len(includeTags) <= 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sloppyLen: len(includeTags) <= 0 can be len(includeTags) == 0 (from gocritic
)
codescan/route_params.go
Outdated
if current.Type == TypeBool { | ||
current.Type = TypeBoolean | ||
} | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
elseif: can replace 'else {if cond {}}' with 'else if cond {}' (from gocritic
)
} | ||
} | ||
|
||
return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
naked return in func collectScannerTitleDescription
with 32 lines of code (from nakedret
)
|
||
// all parsed, returning... | ||
sp.yamlSpec = nil // spec is now consumed, so let's erase the parsed lines | ||
return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
naked return in func UnmarshalSpec
with 43 lines of code (from nakedret
)
} | ||
|
||
//TODO: Maybe do, if !parsedModelOrResponse {return some error} | ||
return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
naked return in func parseTags
with 70 lines of code (from nakedret
)
codescan/application.go
Outdated
type scanCtx struct { | ||
pkgs []*packages.Package | ||
app *typeIndex | ||
builder *specBuilder |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
builder
is unused (from structcheck
)
codescan/parameters.go
Outdated
} | ||
|
||
func (pt paramTypable) AddExtension(key string, value interface{}) { | ||
pt.AddExtension(key, value) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SA5007: infinite recursive call (from staticcheck
)
fix some linting issues Signed-off-by: Ivan Porto Carrero <ivan@flanders.co.nz>
Signed-off-by: Ivan Porto Carrero <ivan@flanders.co.nz>
Signed-off-by: Ivan Porto Carrero <ivan@flanders.co.nz>
Signed-off-by: Ivan Porto Carrero <ivan@flanders.co.nz>
Signed-off-by: Ivan Porto Carrero <ivan@flanders.co.nz>
Signed-off-by: Ivan Porto Carrero <ivan@flanders.co.nz>
@@ -436,6 +436,10 @@ func TestShared_Issue1429(t *testing.T) { | |||
log.SetOutput(ioutil.Discard) | |||
defer log.SetOutput(os.Stdout) | |||
|
|||
if runtime.GOOS == "windows" { | |||
t.Skip("on windows till the bug is resolved for ref resolution") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok this one is on my plate. I introduced a regression in go-openapi/analysis when running on windows.
Implements a scanner that is go module aware.
It also loosens the restriction on requiring a main package. Now it accepts the same package syntax other go tools support eg.
./...
fixes #1970
fixes #1911
fixes #1786
fixes #1784
fixes #1681
fixes #1671
contributes to #1724