-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add flag to print resolved config (#179)
* feat: add flag to print resolved config * chore: apply suggestions #179 (comment) * Prefer basic formatter having mapstructure rather than yaml tag in command * Rename resolved with print * Add integration tests for loading config files * fix: commit .yamlfmt in integrationtest * chore: remove unused fixtures in print_conf tests * fix: add keep file to make sure empty directory in integration tests
- Loading branch information
Showing
21 changed files
with
200 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
# Sometimes use these for testing | ||
.yamlfmt | ||
!integrationtest/**/.yamlfmt | ||
tmp | ||
|
||
# Goreleaser build folder | ||
|
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 |
---|---|---|
|
@@ -29,6 +29,7 @@ const ( | |
OperationLint | ||
OperationDry | ||
OperationStdin | ||
OperationPrintConfig | ||
) | ||
|
||
type Engine interface { | ||
|
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
11 changes: 11 additions & 0 deletions
11
integrationtest/command/testdata/print_conf_file/after/.yamlfmt
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 @@ | ||
continue_on_error: false | ||
doublestar: true | ||
exclude: | ||
- "**/templates/*.yaml" | ||
gitignore_excludes: false | ||
gitignore_path: .my_gitignore | ||
line_ending: crlf | ||
formatter: | ||
type: basic | ||
retain_line_breaks_single: true | ||
include_document_start: true |
11 changes: 11 additions & 0 deletions
11
integrationtest/command/testdata/print_conf_file/before/.yamlfmt
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 @@ | ||
continue_on_error: false | ||
doublestar: true | ||
exclude: | ||
- "**/templates/*.yaml" | ||
gitignore_excludes: false | ||
gitignore_path: .my_gitignore | ||
line_ending: crlf | ||
formatter: | ||
type: basic | ||
retain_line_breaks_single: true | ||
include_document_start: true |
Empty file.
26 changes: 26 additions & 0 deletions
26
integrationtest/command/testdata/print_conf_file/stdout/stdout.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,26 @@ | ||
continue_on_error: false | ||
doublestar: true | ||
exclude: | ||
- '**/templates/*.yaml' | ||
extensions: | ||
- yaml | ||
- yml | ||
gitignore_excludes: false | ||
gitignore_path: .my_gitignore | ||
include: [] | ||
line_ending: crlf | ||
output_format: default | ||
regex_exclude: [] | ||
formatter: | ||
disallow_anchors: false | ||
drop_merge_tag: false | ||
include_document_start: true | ||
indent: 2 | ||
indentless_arrays: false | ||
line_ending: crlf | ||
max_line_length: 0 | ||
pad_line_comments: 1 | ||
retain_line_breaks: false | ||
retain_line_breaks_single: true | ||
scan_folded_as_literal: false | ||
type: basic |
Empty file.
Empty file.
Empty file.
25 changes: 25 additions & 0 deletions
25
integrationtest/command/testdata/print_conf_flags/stdout/stdout.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,25 @@ | ||
continue_on_error: true | ||
doublestar: false | ||
exclude: [] | ||
extensions: | ||
- yaml | ||
- yml | ||
gitignore_excludes: false | ||
gitignore_path: .gitignore | ||
include: [] | ||
line_ending: lf | ||
output_format: default | ||
regex_exclude: [] | ||
formatter: | ||
disallow_anchors: false | ||
drop_merge_tag: false | ||
include_document_start: false | ||
indent: 2 | ||
indentless_arrays: false | ||
line_ending: lf | ||
max_line_length: 0 | ||
pad_line_comments: 1 | ||
retain_line_breaks: true | ||
retain_line_breaks_single: false | ||
scan_folded_as_literal: false | ||
type: basic |
11 changes: 11 additions & 0 deletions
11
integrationtest/command/testdata/print_conf_flags_and_file/after/.yamlfmt
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 @@ | ||
continue_on_error: false | ||
doublestar: true | ||
exclude: | ||
- "**/templates/*.yaml" | ||
gitignore_excludes: false | ||
gitignore_path: .my_gitignore | ||
line_ending: crlf | ||
formatter: | ||
type: basic | ||
retain_line_breaks_single: true | ||
include_document_start: true |
11 changes: 11 additions & 0 deletions
11
integrationtest/command/testdata/print_conf_flags_and_file/before/.yamlfmt
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 @@ | ||
continue_on_error: false | ||
doublestar: true | ||
exclude: | ||
- "**/templates/*.yaml" | ||
gitignore_excludes: false | ||
gitignore_path: .my_gitignore | ||
line_ending: crlf | ||
formatter: | ||
type: basic | ||
retain_line_breaks_single: true | ||
include_document_start: true |
Empty file.
26 changes: 26 additions & 0 deletions
26
integrationtest/command/testdata/print_conf_flags_and_file/stdout/stdout.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,26 @@ | ||
continue_on_error: true | ||
doublestar: true | ||
exclude: | ||
- '**/templates/*.yaml' | ||
extensions: | ||
- yaml | ||
- yml | ||
gitignore_excludes: false | ||
gitignore_path: .my_gitignore | ||
include: [] | ||
line_ending: crlf | ||
output_format: default | ||
regex_exclude: [] | ||
formatter: | ||
disallow_anchors: false | ||
drop_merge_tag: false | ||
include_document_start: true | ||
indent: 2 | ||
indentless_arrays: false | ||
line_ending: crlf | ||
max_line_length: 0 | ||
pad_line_comments: 1 | ||
retain_line_breaks: true | ||
retain_line_breaks_single: true | ||
scan_folded_as_literal: false | ||
type: basic |