-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
read config from file with viper (#589)
- Loading branch information
1 parent
4822df6
commit c222328
Showing
35 changed files
with
785 additions
and
680 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,22 @@ | ||
## Configuration Files | ||
|
||
Oasdiff can be customized through command-line flags, for example: | ||
``` | ||
oasdiff changelog data/openapi-test1.yaml data/openapi-test3.yaml --format yaml | ||
``` | ||
|
||
To see available flags, run `oasdiff help <cmd>`, for example: | ||
``` | ||
oasdiff help changelog | ||
``` | ||
|
||
The flags can also be provided through a configuration file. | ||
The config file should be named oasdiff.{json,yaml,yml,toml,hcl} and placed in the directory where the command is run. | ||
For example, see [oasdiff.yaml](oasdiff.yaml). | ||
|
||
Note that some of the flags define paths to additional configuration files: | ||
- --err-ignore string: configuration file for ignoring errors | ||
- --severity-levels string: configuration file for custom severity levels | ||
- --warn-ignore string: configuration file for ignoring warnings | ||
|
||
Note that command-line flags take precedence over configuration file settings. |
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,13 @@ | ||
format: json | ||
color: never | ||
attributes: | ||
- x-beta | ||
- x-extension-test | ||
composed: false | ||
flatten-allof: true | ||
err-ignore: ignore-err-example.txt | ||
lang: en | ||
fail-on: ERR | ||
level: INFO | ||
exclude-elements: | ||
- endpoints |
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,12 @@ | ||
package formatters_test | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/require" | ||
"github.com/tufin/oasdiff/formatters" | ||
) | ||
|
||
func TestTypes(t *testing.T) { | ||
require.Equal(t, formatters.GetSupportedFormats(), []string{"yaml", "json", "text", "markup", "singleline", "html", "githubactions", "junit", "sarif"}) | ||
} |
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.