mirror of
https://github.com/kevin-DL/revel-cmd.git
synced 2026-01-17 21:14:52 +00:00
revel/revel#1057 addressing golint ALL_CAPS
This commit is contained in:
@@ -4,11 +4,12 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/revel/revel"
|
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/revel/revel"
|
||||||
)
|
)
|
||||||
|
|
||||||
// App contains the configuration for running a Revel app. (Not for the app itself)
|
// App contains the configuration for running a Revel app. (Not for the app itself)
|
||||||
|
|||||||
@@ -419,7 +419,7 @@ func appendAction(fset *token.FileSet, mm methodMap, decl ast.Decl, pkgImportPat
|
|||||||
if selExpr.Sel.Name != "Result" {
|
if selExpr.Sel.Name != "Result" {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if pkgIdent, ok := selExpr.X.(*ast.Ident); !ok || imports[pkgIdent.Name] != revel.REVEL_IMPORT_PATH {
|
if pkgIdent, ok := selExpr.X.(*ast.Ident); !ok || imports[pkgIdent.Name] != revel.RevelImportPath {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -597,7 +597,7 @@ func getValidationParameter(funcDecl *ast.FuncDecl, imports map[string]string) *
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
if selExpr.Sel.Name == "Validation" && imports[xIdent.Name] == revel.REVEL_IMPORT_PATH {
|
if selExpr.Sel.Name == "Validation" && imports[xIdent.Name] == revel.RevelImportPath {
|
||||||
return field.Names[0].Obj
|
return field.Names[0].Obj
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -675,14 +675,14 @@ func (s *SourceInfo) TypesThatEmbed(targetType string) (filtered []*TypeInfo) {
|
|||||||
|
|
||||||
func (s *SourceInfo) ControllerSpecs() []*TypeInfo {
|
func (s *SourceInfo) ControllerSpecs() []*TypeInfo {
|
||||||
if s.controllerSpecs == nil {
|
if s.controllerSpecs == nil {
|
||||||
s.controllerSpecs = s.TypesThatEmbed(revel.REVEL_IMPORT_PATH + ".Controller")
|
s.controllerSpecs = s.TypesThatEmbed(revel.RevelImportPath + ".Controller")
|
||||||
}
|
}
|
||||||
return s.controllerSpecs
|
return s.controllerSpecs
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *SourceInfo) TestSuites() []*TypeInfo {
|
func (s *SourceInfo) TestSuites() []*TypeInfo {
|
||||||
if s.testSuites == nil {
|
if s.testSuites == nil {
|
||||||
s.testSuites = s.TypesThatEmbed(revel.REVEL_IMPORT_PATH + "/testing.TestSuite")
|
s.testSuites = s.TypesThatEmbed(revel.RevelImportPath + "/testing.TestSuite")
|
||||||
}
|
}
|
||||||
return s.testSuites
|
return s.testSuites
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package harness
|
package harness
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/revel/revel"
|
|
||||||
"go/ast"
|
"go/ast"
|
||||||
"go/parser"
|
"go/parser"
|
||||||
"go/token"
|
"go/token"
|
||||||
@@ -10,6 +9,8 @@ import (
|
|||||||
"reflect"
|
"reflect"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
"github.com/revel/revel"
|
||||||
)
|
)
|
||||||
|
|
||||||
const validationKeysSource = `
|
const validationKeysSource = `
|
||||||
@@ -77,7 +78,7 @@ func TestGetValidationKeys(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for i, decl := range file.Decls {
|
for i, decl := range file.Decls {
|
||||||
lineKeys := getValidationKeys(fset, decl.(*ast.FuncDecl), map[string]string{"revel": revel.REVEL_IMPORT_PATH})
|
lineKeys := getValidationKeys(fset, decl.(*ast.FuncDecl), map[string]string{"revel": revel.RevelImportPath})
|
||||||
for k, v := range expectedValidationKeys[i] {
|
for k, v := range expectedValidationKeys[i] {
|
||||||
if lineKeys[k] != v {
|
if lineKeys[k] != v {
|
||||||
t.Errorf("Not found - %d: %v - Actual Map: %v", k, v, lineKeys)
|
t.Errorf("Not found - %d: %v - Actual Map: %v", k, v, lineKeys)
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ func buildApp(args []string) {
|
|||||||
// Revel and the app are in a directory structure mirroring import path
|
// Revel and the app are in a directory structure mirroring import path
|
||||||
srcPath := filepath.Join(destPath, "src")
|
srcPath := filepath.Join(destPath, "src")
|
||||||
destBinaryPath := filepath.Join(destPath, filepath.Base(app.BinaryPath))
|
destBinaryPath := filepath.Join(destPath, filepath.Base(app.BinaryPath))
|
||||||
tmpRevelPath := filepath.Join(srcPath, filepath.FromSlash(revel.REVEL_IMPORT_PATH))
|
tmpRevelPath := filepath.Join(srcPath, filepath.FromSlash(revel.RevelImportPath))
|
||||||
mustCopyFile(destBinaryPath, app.BinaryPath)
|
mustCopyFile(destBinaryPath, app.BinaryPath)
|
||||||
mustChmod(destBinaryPath, 0755)
|
mustChmod(destBinaryPath, 0755)
|
||||||
mustCopyDir(filepath.Join(tmpRevelPath, "conf"), filepath.Join(revel.RevelPath, "conf"), nil)
|
mustCopyDir(filepath.Join(tmpRevelPath, "conf"), filepath.Join(revel.RevelPath, "conf"), nil)
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ func setApplicationPath(args []string) {
|
|||||||
errorf("Abort: Import path %s already exists.\n", importPath)
|
errorf("Abort: Import path %s already exists.\n", importPath)
|
||||||
}
|
}
|
||||||
|
|
||||||
revelPkg, err = build.Import(revel.REVEL_IMPORT_PATH, "", build.FindOnly)
|
revelPkg, err = build.Import(revel.RevelImportPath, "", build.FindOnly)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
errorf("Abort: Could not find Revel source code: %s\n", err)
|
errorf("Abort: Could not find Revel source code: %s\n", err)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"strconv"
|
||||||
|
|
||||||
"github.com/revel/cmd/harness"
|
"github.com/revel/cmd/harness"
|
||||||
"github.com/revel/revel"
|
"github.com/revel/revel"
|
||||||
"strconv"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var cmdRun = &Command{
|
var cmdRun = &Command{
|
||||||
|
|||||||
Reference in New Issue
Block a user