-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Ignore .tflint.hcl #1075
Ignore .tflint.hcl #1075
Conversation
Fixes #1061
Codecov Report
@@ Coverage Diff @@
## master #1075 +/- ##
=======================================
Coverage 71.49% 71.49%
=======================================
Files 67 67
Lines 5564 5564
=======================================
Hits 3978 3978
Misses 1272 1272
Partials 314 314
Continue to review full report at Codecov.
|
server/events/project_finder.go
Outdated
@@ -40,6 +40,9 @@ type ProjectFinder interface { | |||
DetermineProjectsViaConfig(log *logging.SimpleLogger, modifiedFiles []string, config valid.RepoCfg, absRepoDir string) ([]valid.Project, error) | |||
} | |||
|
|||
// IgnoredFiles contains filename fragments to ignore while looking at changes | |||
var IgnoredFiles = [...]string{"terraform.tfstate", "terraform.tfstate.backup", "tflint.hcl"} |
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.
var IgnoredFiles = [...]string{"terraform.tfstate", "terraform.tfstate.backup", "tflint.hcl"} | |
var ignoredFilenameFragments = []string{"terraform.tfstate", "terraform.tfstate.backup", "tflint.hcl"} |
lowercase so it isn't exported and while I just learned about [...]
(cool!) I think its best to keep things consistent.
server/events/project_finder.go
Outdated
@@ -136,16 +139,16 @@ func (p *DefaultProjectFinder) filterToTerraform(files []string) []string { | |||
for _, fileName := range files { | |||
// Filter out tfstate files since they usually checked in by accident |
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.
Can you delete this comment now.
server/events/project_finder.go
Outdated
// isStatefile returns true if fileName is a terraform statefile or backup. | ||
func (p *DefaultProjectFinder) isStatefile(fileName string) bool { | ||
for _, s := range []string{"terraform.tfstate", "terraform.tfstate.backup"} { | ||
// shouldIgnore returns true if fileName is a terraform statefile, backup or tflint file. |
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.
// shouldIgnore returns true if fileName is a terraform statefile, backup or tflint file. | |
// shouldIgnore returns true if we shouldn't trigger a plan on changes to this file. |
You need to make the renaming changes to the use of the variable as well. |
Thanks! |
This PR is significantly smaller than your last one 😆 |
I'll do my best once I find some time to tackle #936 😂 |
Fixes #1061