-
Notifications
You must be signed in to change notification settings - Fork 361
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
33 changed files
with
1,129 additions
and
134 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
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
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,14 @@ | ||
# Switching working directory with --chdir | ||
|
||
The `--chdir` option is available in TFLint like Terraform: | ||
|
||
```console | ||
$ tflint --chdir=environments/production | ||
``` | ||
|
||
Its behavior is the same as [Terraform's behavior](https://developer.hashicorp.com/terraform/cli/commands#switching-working-directory-with-chdir), but there are some TFLint-specific considerations: | ||
|
||
- Config file (`.tflint.hcl`) is processed before acting on the `--chdir` option. | ||
- Files specified with relative paths like `--var-file` and `varfile` on config files are resolved against the original working directory. | ||
|
||
TFLint also accepts a directory as an argument, but `--chdir` is recommended in most cases. The directory argument is deprecated and may be removed in a future version. |
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 |
---|---|---|
@@ -1,7 +1,3 @@ | ||
plugin "testing" { | ||
enabled = true | ||
} | ||
|
||
plugin "aws" { | ||
enabled = false | ||
} |
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,11 @@ | ||
plugin "testing" { | ||
enabled = true | ||
} | ||
|
||
plugin "terraform" { | ||
enabled = false | ||
} | ||
|
||
config { | ||
varfile = ["dir/from_config.tfvars"] | ||
} |
1 change: 1 addition & 0 deletions
1
integrationtest/inspection/chdir/dir/.terraform/modules/modules.json
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 @@ | ||
{"Modules":[{"Key":"","Source":"","Dir":"."},{"Key":"aws_instance","Source":"./module","Dir":"module"}]} |
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 @@ | ||
file_in_dir |
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 @@ | ||
from_cli="from_cli" |
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 @@ | ||
from_config="from_config" |
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,21 @@ | ||
variable "from_config" { | ||
default = "default" | ||
} | ||
|
||
variable "from_cli" { | ||
default = "default" | ||
} | ||
|
||
variable "from_auto" { | ||
default = "default" | ||
} | ||
|
||
variable "from_auto_default" { | ||
default = "default" | ||
} | ||
|
||
module "aws_instance" { | ||
source = "./module" | ||
|
||
instance_type = "${var.from_config}-${var.from_cli}-${var.from_auto}-${var.from_auto_default}-${file("dir.txt")}-${file("${path.cwd}/root.txt")}" | ||
} |
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,5 @@ | ||
variable "instance_type" {} | ||
|
||
resource "aws_instance" "main" { | ||
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 @@ | ||
from_auto="from_auto" |
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 @@ | ||
from_auto_default="from_auto_default" |
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,48 @@ | ||
{ | ||
"issues": [ | ||
{ | ||
"rule": { | ||
"name": "aws_instance_example_type", | ||
"severity": "error", | ||
"link": "" | ||
}, | ||
"message": "instance type is from_config-from_cli-from_auto-from_auto_default-file_in_dir-file_in_root", | ||
"range": { | ||
"filename": "dir/main.tf", | ||
"start": { | ||
"line": 20, | ||
"column": 19 | ||
}, | ||
"end": { | ||
"line": 20, | ||
"column": 148 | ||
} | ||
}, | ||
"callers": [ | ||
{ | ||
"filename": "dir/main.tf", | ||
"start": { | ||
"line": 20, | ||
"column": 19 | ||
}, | ||
"end": { | ||
"line": 20, | ||
"column": 148 | ||
} | ||
}, | ||
{ | ||
"filename": "dir/module/main.tf", | ||
"start": { | ||
"line": 4, | ||
"column": 19 | ||
}, | ||
"end": { | ||
"line": 4, | ||
"column": 36 | ||
} | ||
} | ||
] | ||
} | ||
], | ||
"errors": [] | ||
} |
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 @@ | ||
file_in_root |
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
Oops, something went wrong.