-
Notifications
You must be signed in to change notification settings - Fork 367
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch internal Terraform rules to the bundled plugin
- Loading branch information
Showing
64 changed files
with
580 additions
and
8,420 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package cmd | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/terraform-linters/tflint-plugin-sdk/plugin" | ||
"github.com/terraform-linters/tflint-plugin-sdk/tflint" | ||
"github.com/terraform-linters/tflint-ruleset-terraform/project" | ||
"github.com/terraform-linters/tflint-ruleset-terraform/rules" | ||
"github.com/terraform-linters/tflint-ruleset-terraform/terraform" | ||
) | ||
|
||
func (cli *CLI) actAsBundledPlugin() int { | ||
plugin.Serve(&plugin.ServeOpts{ | ||
RuleSet: &terraform.RuleSet{ | ||
BuiltinRuleSet: tflint.BuiltinRuleSet{ | ||
Name: "terraform", | ||
Version: fmt.Sprintf("%s-bundled", project.Version), | ||
}, | ||
PresetRules: rules.PresetRules, | ||
}, | ||
}) | ||
return ExitCodeOK | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
variable "instance_type" {} | ||
variable "unused" { | ||
type = string | ||
} | ||
|
||
resource "aws_instance" "main" { | ||
count = [] == [] ? 1 : 0 | ||
|
||
instance_type = "${var.instance_type}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
{ | ||
"issues": [ | ||
{ | ||
"rule": { | ||
"name": "terraform_required_version", | ||
"severity": "warning", | ||
"link": "https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.1.0/docs/rules/terraform_required_version.md" | ||
}, | ||
"message": "terraform \"required_version\" attribute is required", | ||
"range": { | ||
"filename": "", | ||
"start": { | ||
"line": 0, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 0, | ||
"column": 0 | ||
} | ||
}, | ||
"callers": [] | ||
}, | ||
{ | ||
"rule": { | ||
"name": "terraform_typed_variables", | ||
"severity": "warning", | ||
"link": "https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.1.0/docs/rules/terraform_typed_variables.md" | ||
}, | ||
"message": "`instance_type` variable has no type", | ||
"range": { | ||
"filename": "main.tf", | ||
"start": { | ||
"line": 1, | ||
"column": 1 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 25 | ||
} | ||
}, | ||
"callers": [] | ||
}, | ||
{ | ||
"rule": { | ||
"name": "terraform_unused_declarations", | ||
"severity": "warning", | ||
"link": "https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.1.0/docs/rules/terraform_unused_declarations.md" | ||
}, | ||
"message": "variable \"unused\" is declared but not used", | ||
"range": { | ||
"filename": "main.tf", | ||
"start": { | ||
"line": 2, | ||
"column": 1 | ||
}, | ||
"end": { | ||
"line": 2, | ||
"column": 18 | ||
} | ||
}, | ||
"callers": [] | ||
}, | ||
{ | ||
"rule": { | ||
"name": "terraform_required_providers", | ||
"severity": "warning", | ||
"link": "https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.1.0/docs/rules/terraform_required_providers.md" | ||
}, | ||
"message": "Missing version constraint for provider \"aws\" in \"required_providers\"", | ||
"range": { | ||
"filename": "main.tf", | ||
"start": { | ||
"line": 6, | ||
"column": 1 | ||
}, | ||
"end": { | ||
"line": 6, | ||
"column": 31 | ||
} | ||
}, | ||
"callers": [] | ||
}, | ||
{ | ||
"rule": { | ||
"name": "terraform_empty_list_equality", | ||
"severity": "warning", | ||
"link": "https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.1.0/docs/rules/terraform_empty_list_equality.md" | ||
}, | ||
"message": "Comparing a collection with an empty list is invalid. To detect an empty collection, check its length.", | ||
"range": { | ||
"filename": "main.tf", | ||
"start": { | ||
"line": 7, | ||
"column": 11 | ||
}, | ||
"end": { | ||
"line": 7, | ||
"column": 19 | ||
} | ||
}, | ||
"callers": [] | ||
}, | ||
{ | ||
"rule": { | ||
"name": "terraform_deprecated_interpolation", | ||
"severity": "warning", | ||
"link": "https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.1.0/docs/rules/terraform_deprecated_interpolation.md" | ||
}, | ||
"message": "Interpolation-only expressions are deprecated in Terraform v0.12.14", | ||
"range": { | ||
"filename": "main.tf", | ||
"start": { | ||
"line": 9, | ||
"column": 19 | ||
}, | ||
"end": { | ||
"line": 9, | ||
"column": 41 | ||
} | ||
}, | ||
"callers": [] | ||
} | ||
], | ||
"errors": [] | ||
} |
Oops, something went wrong.