From 57acd2fbe4faf9601b316f7878de1da3fc3d4f8b Mon Sep 17 00:00:00 2001 From: Reuven Harrison Date: Tue, 4 Jul 2023 09:19:39 +0300 Subject: [PATCH] add flags to changelog (#304) * add "--include-checks" flag to changelog * add ignore flags to changelog cmd --- checker/default_checks.go | 2 +- internal/changelog.go | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/checker/default_checks.go b/checker/default_checks.go index 0373fa6a..6dd09061 100644 --- a/checker/default_checks.go +++ b/checker/default_checks.go @@ -16,7 +16,7 @@ func GetChecks(includeChecks utils.StringList) BackwardCompatibilityCheckConfig func LevelOverrides(includeChecks utils.StringList) map[string]Level { result := map[string]Level{} for _, s := range includeChecks { - // if the checker was explicitly included with the `-include-checks`, + // if the checker was explicitly included with the `--include-checks`, // it means that it's output is considered a breaking change, // so the returned level should overwritten to ERR. result[s] = ERR diff --git a/internal/changelog.go b/internal/changelog.go index da75257d..94945791 100644 --- a/internal/changelog.go +++ b/internal/changelog.go @@ -57,6 +57,9 @@ In 'composed' mode, base and revision can be a glob and oasdiff will compare mat cmd.PersistentFlags().StringVarP(&flags.stripPrefixRevision, "strip-prefix-revision", "", "", "strip this prefix from paths in revised-spec before comparison") cmd.PersistentFlags().BoolVarP(&flags.includePathParams, "include-path-params", "", false, "include path parameter names in endpoint matching") cmd.PersistentFlags().VarP(newEnumValue([]string{LangEn, LangRu}, LangDefault, &flags.lang), "lang", "l", "language for localized output") + cmd.PersistentFlags().StringVarP(&flags.errIgnoreFile, "err-ignore", "", "", "configuration file for ignoring errors") + cmd.PersistentFlags().StringVarP(&flags.warnIgnoreFile, "warn-ignore", "", "", "configuration file for ignoring warnings") + cmd.PersistentFlags().VarP(newEnumSliceValue(checker.GetOptionalChecks(), nil, &flags.includeChecks), "include-checks", "i", "comma-separated list of optional checks") cmd.PersistentFlags().IntVarP(&flags.deprecationDays, "deprecation-days", "d", 0, "minimal number of days required between deprecating a resource and removing it") return &cmd