-
Notifications
You must be signed in to change notification settings - Fork 358
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix a bug where auto-fixed code could not be retrieved via GetFile API (
- Loading branch information
Showing
9 changed files
with
188 additions
and
4 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,3 @@ | ||
plugin "testing" { | ||
enabled = true | ||
} |
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,4 @@ | ||
// autofixed | ||
resource "aws_instance" "autofixed_foo" { | ||
instance_type = "[AUTO_FIXED]" | ||
} |
4 changes: 4 additions & 0 deletions
4
integrationtest/autofix/chdir_with_conflict/dir/main.tf.fixed
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,4 @@ | ||
# autofixed | ||
resource "aws_instance" "autofixed_foo" { | ||
instance_type = "t2.micro" # autofixed | ||
} |
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,85 @@ | ||
{ | ||
"issues": [ | ||
{ | ||
"rule": { | ||
"name": "terraform_autofix_comment", | ||
"severity": "error", | ||
"link": "" | ||
}, | ||
"message": "Use \"# autofixed\" instead of \"// autofixed\"", | ||
"range": { | ||
"filename": "dir/main.tf", | ||
"start": { | ||
"line": 1, | ||
"column": 1 | ||
}, | ||
"end": { | ||
"line": 2, | ||
"column": 1 | ||
} | ||
}, | ||
"callers": [] | ||
}, | ||
{ | ||
"rule": { | ||
"name": "aws_instance_example_type", | ||
"severity": "error", | ||
"link": "" | ||
}, | ||
"message": "instance type is [AUTO_FIXED]", | ||
"range": { | ||
"filename": "dir/main.tf", | ||
"start": { | ||
"line": 3, | ||
"column": 19 | ||
}, | ||
"end": { | ||
"line": 3, | ||
"column": 33 | ||
} | ||
}, | ||
"callers": [] | ||
}, | ||
{ | ||
"rule": { | ||
"name": "aws_instance_autofix_conflict", | ||
"severity": "error", | ||
"link": "" | ||
}, | ||
"message": "instance type is [AUTO_FIXED]", | ||
"range": { | ||
"filename": "dir/main.tf", | ||
"start": { | ||
"line": 3, | ||
"column": 19 | ||
}, | ||
"end": { | ||
"line": 3, | ||
"column": 33 | ||
} | ||
}, | ||
"callers": [] | ||
}, | ||
{ | ||
"rule": { | ||
"name": "terraform_autofix_comment", | ||
"severity": "error", | ||
"link": "" | ||
}, | ||
"message": "Use \"# autofixed\" instead of \"// autofixed\"", | ||
"range": { | ||
"filename": "dir/main.tf", | ||
"start": { | ||
"line": 3, | ||
"column": 30 | ||
}, | ||
"end": { | ||
"line": 4, | ||
"column": 1 | ||
} | ||
}, | ||
"callers": [] | ||
} | ||
], | ||
"errors": [] | ||
} |
85 changes: 85 additions & 0 deletions
85
integrationtest/autofix/chdir_with_conflict/result_windows.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,85 @@ | ||
{ | ||
"issues": [ | ||
{ | ||
"rule": { | ||
"name": "terraform_autofix_comment", | ||
"severity": "error", | ||
"link": "" | ||
}, | ||
"message": "Use \"# autofixed\" instead of \"// autofixed\"", | ||
"range": { | ||
"filename": "dir\\main.tf", | ||
"start": { | ||
"line": 1, | ||
"column": 1 | ||
}, | ||
"end": { | ||
"line": 2, | ||
"column": 1 | ||
} | ||
}, | ||
"callers": [] | ||
}, | ||
{ | ||
"rule": { | ||
"name": "aws_instance_example_type", | ||
"severity": "error", | ||
"link": "" | ||
}, | ||
"message": "instance type is [AUTO_FIXED]", | ||
"range": { | ||
"filename": "dir\\main.tf", | ||
"start": { | ||
"line": 3, | ||
"column": 19 | ||
}, | ||
"end": { | ||
"line": 3, | ||
"column": 33 | ||
} | ||
}, | ||
"callers": [] | ||
}, | ||
{ | ||
"rule": { | ||
"name": "aws_instance_autofix_conflict", | ||
"severity": "error", | ||
"link": "" | ||
}, | ||
"message": "instance type is [AUTO_FIXED]", | ||
"range": { | ||
"filename": "dir\\main.tf", | ||
"start": { | ||
"line": 3, | ||
"column": 19 | ||
}, | ||
"end": { | ||
"line": 3, | ||
"column": 33 | ||
} | ||
}, | ||
"callers": [] | ||
}, | ||
{ | ||
"rule": { | ||
"name": "terraform_autofix_comment", | ||
"severity": "error", | ||
"link": "" | ||
}, | ||
"message": "Use \"# autofixed\" instead of \"// autofixed\"", | ||
"range": { | ||
"filename": "dir\\main.tf", | ||
"start": { | ||
"line": 3, | ||
"column": 30 | ||
}, | ||
"end": { | ||
"line": 4, | ||
"column": 1 | ||
} | ||
}, | ||
"callers": [] | ||
} | ||
], | ||
"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
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