-
Notifications
You must be signed in to change notification settings - Fork 2
feat(INT-83): dial in configs for tflint #39
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
Changes from all commits
07cbb1a
1dbd027
5c3df24
1fd0885
bca14cd
5e50542
8a30de9
3dbffd3
a4a07ed
4c3e4b5
45ec37b
a4640fa
997bc51
3c72adb
5abce98
2d144f7
52c5dfe
5807009
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
plugin "terraform" { | ||
enabled = true | ||
preset = "all" | ||
} | ||
|
||
config { | ||
format = "compact" | ||
|
||
# Inspect vars passed into "module" blocks. eg, lint AMI value passed into ec2 module. | ||
# https://github.com/terraform-linters/tflint/blob/master/docs/user-guide/calling-modules.md | ||
call_module_type = "all" | ||
|
||
# default values but keeping them here for clarity | ||
disabled_by_default = false | ||
force = false | ||
} | ||
|
||
# Installing tflint rulesets from Github requires setting a GITHUB_TOKEN | ||
# environment variable. Without it, you'll get an error like this: | ||
# $ tflint --init | ||
# Installing "aws" plugin... | ||
# Failed to install a plugin; Failed to fetch GitHub releases: GET https://api.github.com/repos/terraform-linters/tflint-ruleset-aws/releases/tags/v0.39.0: 401 Bad credentials [] | ||
# | ||
# The solution is to provide a github PAT via a GITHUB_TOKEN env var, | ||
# export GITHUB_TOKEN=github_pat_120abc123def456ghi789jkl123mno456pqr789stu123vwx456yz789 | ||
# | ||
# See docs for more info: https://github.com/terraform-linters/tflint/blob/master/docs/user-guide/plugins.md#avoiding-rate-limiting | ||
plugin "aws" { | ||
enabled = true | ||
version = "0.39.0" | ||
source = "github.com/terraform-linters/tflint-ruleset-aws" | ||
deep_check = false | ||
} | ||
|
||
# Allow variables to exist in more files than ONLY variables.tf | ||
# Example use cases where we prefer for variables to exist in context, | ||
# - context.tf (applicable to the null-label module) | ||
# - providers.tf (when passing in secret keys from SOPs - example, github provider) | ||
# https://github.com/terraform-linters/tflint-ruleset-terraform/blob/main/docs/rules/terraform_standard_module_structure.md | ||
rule "terraform_standard_module_structure" { | ||
enabled = false | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,6 +31,13 @@ lint: | |
- trivy@0.63.0 | ||
- trufflehog@3.88.35 | ||
- yamllint@1.37.1 | ||
# NOTE(tflint): specific override required so it uses .tflint.hcl file in .trunk/configs directory | ||
# https://github.com/trunk-io/plugins/tree/main/linters/tflint | ||
definitions: | ||
- name: tflint | ||
environment: | ||
- name: TFLINT_CONFIG_FILE | ||
value: ${workspace}/.trunk/configs/.tflint.hcl | ||
Comment on lines
+37
to
+40
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of doing this, do we just want to include it at the root of the project so that it can be picked up like other configs and isn't hidden in the trunk folder? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Gowiem did you have an opinion on this approach? I am reviewing what else needs to be take care before merging this PR. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's keep this for now and ship it, but two things for us in the future to follow up on:
|
||
ignore: | ||
- linters: [tofu] | ||
paths: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
# complete.tf | ||
# complete/main.tf |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
# complete.tf | ||
# complete/outputs.tf |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
# complete.tf | ||
# complete/variables.tf |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# complete/versions.tf | ||
|
||
terraform { | ||
required_version = ">= 1.0.0" | ||
} |
Uh oh!
There was an error while loading. Please reload this page.