-
Notifications
You must be signed in to change notification settings - Fork 349
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
Module source pinned ref check #100
Conversation
+1 |
detector/detector.go
Outdated
} | ||
// Special case for module_pinned_source rule | ||
modulePinnedSourceRule := "module_pinned_source" | ||
if d.Config.IgnoreModule[modulePinnedSourceRule] { |
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.
Is this d.Config.IgnoreRule
?
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.
Yep. Changed.
detector/detector.go
Outdated
continue | ||
} | ||
// Special case for module_pinned_source rule | ||
modulePinnedSourceRule := "module_pinned_source" |
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.
Please rename to terraform_module_pinned_source
:)
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.
Done!
} | ||
d.Logger.Info(fmt.Sprintf("run module linter `%s`", name)) | ||
modulePinnedSourceDetector := NewTerraformModulePinnedSourceDetector(d, m.File, m.ObjectItem) |
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.
[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
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.
Fixed
d02853b
to
e3cc826
Compare
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) |
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.
Please also rename this link and title.
@OmarDarwish Great work! I'm very pleased to add such a useful detector! |
+1 |
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