Skip to content

Commit

Permalink
changed ignored_filename_patterns to ignored_path_patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Gołąb committed May 9, 2020
1 parent 9b9f26f commit 43a2319
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ var (
commit = "none"
date = "unknown"
directories = []string{}
ignoredFilenamePatterns = []string{}
ignoredPathPatterns = []string{}

// forceColor tells kubeval to use colored output even if
// stdout is not a TTY
Expand Down Expand Up @@ -175,9 +175,9 @@ func hasErrors(res []kubeval.ValidationResult) bool {
}

// isIgnored returns whether the specified filename should be ignored.
func isIgnored(filename string) (bool, error) {
for _, p := range ignoredFilenamePatterns {
m, err := regexp.MatchString(p, filename)
func isIgnored(path string) (bool, error) {
for _, p := range ignoredPathPatterns {
m, err := regexp.MatchString(p, path)
if err != nil {
return false, err
}
Expand All @@ -198,7 +198,7 @@ func aggregateFiles(args []string) ([]string, error) {
if err != nil {
return err
}
ignored, err := isIgnored(info.Name())
ignored, err := isIgnored(path)
if err != nil {
return err
}
Expand Down Expand Up @@ -240,7 +240,7 @@ func init() {
RootCmd.Flags().BoolVarP(&forceColor, "force-color", "", false, "Force colored output even if stdout is not a TTY")
RootCmd.SetVersionTemplate(`{{.Version}}`)
RootCmd.Flags().StringSliceVarP(&directories, "directories", "d", []string{}, "A comma-separated list of directories to recursively search for YAML documents")
RootCmd.Flags().StringSliceVarP(&ignoredFilenamePatterns, "ignored-filename-patterns", "i", []string{}, "A comma-separated list of regular expressions specifying filenames to ignore")
RootCmd.Flags().StringSliceVarP(&ignoredPathPatterns, "ignored-path-patterns", "i", []string{}, "A comma-separated list of regular expressions specifying paths to ignore")

viper.SetEnvPrefix("KUBEVAL")
viper.AutomaticEnv()
Expand Down

0 comments on commit 43a2319

Please sign in to comment.