diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 1ab0d12f05..2566bbdfcc 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -53,11 +53,11 @@ Metrics/AbcSize: # Offense count: 2 # Configuration parameters: CountComments. Metrics/ClassLength: - Max: 152 + Max: 155 # Offense count: 12 Metrics/CyclomaticComplexity: - Max: 24 + Max: 25 # Offense count: 297 # Configuration parameters: AllowHeredoc, AllowURI, URISchemes. diff --git a/scripts/download_clean_ingest.rb b/scripts/download_clean_ingest.rb index 1293502fa8..f197e9e18e 100644 --- a/scripts/download_clean_ingest.rb +++ b/scripts/download_clean_ingest.rb @@ -50,6 +50,8 @@ def initialize(argv) mode = argv.shift args = argv + unrecognized_flags = args.select { |arg| arg =~ /^-/ } + raise("Unrecognized flags: #{unrecognized_flags.join(', ')}") unless unrecognized_flags.empty? raise("#{JUST_REINDEX} should only be used with #{IDS} or #{QUERY} modes") if @is_just_reindex && ![IDS, ID_FILES, QUERY].include?(mode) log_init(orig) diff --git a/spec/scripts/download_clean_ingest_spec.rb b/spec/scripts/download_clean_ingest_spec.rb index 4924206d6a..8d9a0c5a9e 100644 --- a/spec/scripts/download_clean_ingest_spec.rb +++ b/spec/scripts/download_clean_ingest_spec.rb @@ -46,6 +46,9 @@ def dci_output(*args) "--just-reindex #{default_flags} #{default_mode}" => [ /should only be used with/ ], + '--this-is-not-valid -neither-is-this' => [ + /Unrecognized flags: --this-is-not-valid, -neither-is-this/ + ], # Modes expected to succeed: # (--back can be slow)