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

Ignore .tflint.hcl #1075

Merged
merged 4 commits into from
Jul 7, 2020
Merged

Ignore .tflint.hcl #1075

merged 4 commits into from
Jul 7, 2020

Conversation

unRob
Copy link
Contributor

@unRob unRob commented Jun 4, 2020

Fixes #1061

@codecov
Copy link

codecov bot commented Jun 4, 2020

Codecov Report

Merging #1075 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1075   +/-   ##
=======================================
  Coverage   71.49%   71.49%           
=======================================
  Files          67       67           
  Lines        5564     5564           
=======================================
  Hits         3978     3978           
  Misses       1272     1272           
  Partials      314      314           
Impacted Files Coverage Δ
server/events/project_finder.go 94.38% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 25cd66d...9c09a14. Read the comment docs.

@@ -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"}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
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.

@@ -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
Copy link
Member

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.

// 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.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// 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.

@lkysow
Copy link
Member

lkysow commented Jul 7, 2020

You need to make the renaming changes to the use of the variable as well.

@lkysow lkysow merged commit 50a414c into runatlantis:master Jul 7, 2020
@lkysow
Copy link
Member

lkysow commented Jul 7, 2020

Thanks!

@lkysow
Copy link
Member

lkysow commented Jul 7, 2020

This PR is significantly smaller than your last one 😆

@unRob unRob deleted the feature/ignore-tflint branch July 7, 2020 18:09
@unRob
Copy link
Contributor Author

unRob commented Jul 7, 2020

I'll do my best once I find some time to tackle #936 😂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

/.tflint.hcl triggers planning
2 participants