Activate lint typecheck

This commit is contained in:
Jeffrey Regan
2019-11-18 06:53:38 -08:00
parent 562aaadf2c
commit 362454413a
5 changed files with 7 additions and 7 deletions

View File

@@ -26,7 +26,7 @@ linters:
# stylecheck demands that acronyms not be treated as words
# in camelCase, so JsonOp become JSONOp, etc. Yuck.
# - stylecheck
# - typecheck (fails in lots of places)
- typecheck
- unconvert
- unused
- unparam

View File

@@ -23,7 +23,7 @@ func (p *HashTransformerPlugin) Config(
// Transform appends hash to generated resources.
func (p *HashTransformerPlugin) Transform(m resmap.ResMap) error {
for _, res := range m.Resources() {
if res.ShouldAddHashSuffixToName() {
if res.NeedHashSuffix() {
h, err := p.hasher.Hash(res)
if err != nil {
return err

View File

@@ -157,7 +157,7 @@ func TestUpdateResourceOptions(t *testing.T) {
if !a.Equals(b) {
t.Errorf("expected %v got %v", a, b)
}
if a.ShouldAddHashSuffixToName() != b.ShouldAddHashSuffixToName() {
if a.NeedHashSuffix() != b.NeedHashSuffix() {
t.Errorf("")
}
if a.Behavior() != b.Behavior() {

View File

@@ -252,9 +252,9 @@ func (r *Resource) Behavior() types.GenerationBehavior {
return r.options.Behavior()
}
// ShouldAddHashSuffixToName returns true if a resource
// content hash should be appended to the name of the resource.
func (r *Resource) ShouldAddHashSuffixToName() bool {
// NeedHashSuffix returns true if a resource content
// hash should be appended to the name of the resource.
func (r *Resource) NeedHashSuffix() bool {
return r.options != nil && r.options.ShouldAddHashSuffixToName()
}

View File

@@ -34,7 +34,7 @@ func (g *GenArgs) String() string {
"}"
}
// ShouldAddHashSuffixToName returns true if a resource
// NeedHashSuffix returns true if a resource
// content hash should be appended to the name of the resource.
func (g *GenArgs) ShouldAddHashSuffixToName() bool {
return g.args != nil &&