Skip to content

Commit ac7d548

Browse files
author
Kevin Paulisse
committed
Add command line option for ignoring equivalent YAML files
1 parent 6b4f9f2 commit ac7d548

2 files changed

Lines changed: 23 additions & 0 deletions

File tree

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# frozen_string_literal: true
2+
3+
# Ignore difference between YAML files if they contain the same content differing only by whitespace.
4+
# @param parser [OptionParser object] The OptionParser argument
5+
# @param options [Hash] Options hash being constructed; this is modified in this method.
6+
OctocatalogDiff::CatalogDiff::Cli::Options::Option.newoption(:ignore_equivalent_yaml_files) do
7+
has_weight 199
8+
9+
def parse(parser, options)
10+
parser.on('--[no-]ignore-equivalent-yaml-files', 'Ignore YAML files differing only by whitespace') do |x|
11+
options[:ignore_equivalent_yaml_files] = x
12+
end
13+
end
14+
end
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# frozen_string_literal: true
2+
3+
require_relative '../options_helper'
4+
5+
describe OctocatalogDiff::CatalogDiff::Cli::Options do
6+
describe '#opt_ignore_equivalent_yaml_files' do
7+
include_examples 'true/false option', 'ignore-equivalent-yaml-files', :ignore_equivalent_yaml_files
8+
end
9+
end

0 commit comments

Comments
 (0)