Skip to content
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

Module source pinned ref check #100

Merged
merged 9 commits into from
Apr 20, 2017

Conversation

OmarDarwish
Copy link
Contributor

This is to add a warning to modules from source control that either do not pin a version or pin to a default version. Documentation is provided here

@LudwigHoff
Copy link

+1

}
// Special case for module_pinned_source rule
modulePinnedSourceRule := "module_pinned_source"
if d.Config.IgnoreModule[modulePinnedSourceRule] {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this d.Config.IgnoreRule ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep. Changed.

continue
}
// Special case for module_pinned_source rule
modulePinnedSourceRule := "module_pinned_source"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rename to terraform_module_pinned_source :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

}
d.Logger.Info(fmt.Sprintf("run module linter `%s`", name))
modulePinnedSourceDetector := NewTerraformModulePinnedSourceDetector(d, m.File, m.ObjectItem)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[gometalinter]

  • [interfacer] undeclared name: NewTerraformModulePinnedSourceDetector
  • [structcheck] unused struct field undeclared name: NewTerraformModulePinnedSourceDetector
  • [unconvert] undeclared name: NewTerraformModulePinnedSourceDetector
  • [staticcheck] undeclared name: NewTerraformModulePinnedSourceDetector
  • [gosimple] undeclared name: NewTerraformModulePinnedSourceDetector
  • [varcheck] unused variable or constant undeclared name: NewTerraformModulePinnedSourceDetector

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

docs/README.md Outdated
@@ -28,6 +28,8 @@ Issues are classified into the following three types.
- **AWS Route**
- [aws_route_not_specified_target](aws_route_not_specified_target.md)
- [aws_route_specified_multiple_targets](aws_route_specified_multiple_targets.md)
- **Terraform**
- [module_pinned_source](module_pinned_source.md)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also rename this link and title.

@wata727 wata727 merged commit 727fe29 into terraform-linters:master Apr 20, 2017
@wata727
Copy link
Member

wata727 commented Apr 20, 2017

@OmarDarwish Great work! I'm very pleased to add such a useful detector!

@LudwigHoff
Copy link

+1

@OmarDarwish OmarDarwish deleted the module-source-ref-check branch April 21, 2017 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants