Updated formating

Ran through testing individually for vendored Revel applications
This commit is contained in:
notzippy@gmail.com
2020-04-26 22:24:00 -07:00
parent 07d67846c1
commit 86736d6e43
22 changed files with 239 additions and 291 deletions

View File

@@ -12,14 +12,14 @@ import (
type SourceInfo struct {
// StructSpecs lists type info for all structs found under the code paths.
// They may be queried to determine which ones (transitively) embed certain types.
StructSpecs []*TypeInfo
StructSpecs []*TypeInfo
// ValidationKeys provides a two-level lookup. The keys are:
// 1. The fully-qualified function name,
// e.g. "github.com/revel/examples/chat/app/controllers.(*Application).Action"
// 2. Within that func's file, the line number of the (overall) expression statement.
// e.g. the line returned from runtime.Caller()
// The result of the lookup the name of variable being validated.
ValidationKeys map[string]map[int]string
ValidationKeys map[string]map[int]string
// A list of import paths.
// Revel notices files with an init() function and imports that package.
InitImportPaths []string
@@ -28,9 +28,9 @@ type SourceInfo struct {
// app/controllers/... that embed (directly or indirectly) revel.Controller
controllerSpecs []*TypeInfo
// testSuites list the types that constitute the set of application tests.
testSuites []*TypeInfo
testSuites []*TypeInfo
// packageMap a map of import to system directory (if available)
PackageMap map[string]string
PackageMap map[string]string
}
// TypesThatEmbed returns all types that (directly or indirectly) embed the
@@ -76,7 +76,7 @@ func (s *SourceInfo) TypesThatEmbed(targetType, packageFilter string) (filtered
utils.Logger.Info("Debug: Skipping adding spec for unexported type",
"type", filteredItem.StructName,
"package", filteredItem.ImportPath)
filtered = append(filtered[:i], filtered[i+1:]...)
filtered = append(filtered[:i], filtered[i + 1:]...)
exit = false
break
}
@@ -99,8 +99,8 @@ func (s *SourceInfo) TypesThatEmbed(targetType, packageFilter string) (filtered
// Report non controller structures in controller folder.
if !found && !strings.HasPrefix(spec.StructName, "Test") {
utils.Logger.Warn("Type found in package: "+packageFilter+
", but did not embed from: "+filepath.Base(targetType),
utils.Logger.Warn("Type found in package: " + packageFilter +
", but did not embed from: " + filepath.Base(targetType),
"name", spec.StructName, "importpath", spec.ImportPath, "foundstructures", unfoundNames)
}
}
@@ -112,7 +112,7 @@ func (s *SourceInfo) TypesThatEmbed(targetType, packageFilter string) (filtered
// `revel.Controller`
func (s *SourceInfo) ControllerSpecs() []*TypeInfo {
if s.controllerSpecs == nil {
s.controllerSpecs = s.TypesThatEmbed(RevelImportPath+".Controller", "controllers")
s.controllerSpecs = s.TypesThatEmbed(RevelImportPath + ".Controller", "controllers")
}
return s.controllerSpecs
}
@@ -121,7 +121,7 @@ func (s *SourceInfo) ControllerSpecs() []*TypeInfo {
// `testing.TestSuite`
func (s *SourceInfo) TestSuites() []*TypeInfo {
if s.testSuites == nil {
s.testSuites = s.TypesThatEmbed(RevelImportPath+"/testing.TestSuite", "testsuite")
s.testSuites = s.TypesThatEmbed(RevelImportPath + "/testing.TestSuite", "testsuite")
}
return s.testSuites
}