rail_verdict 1.8.2 → 1.8.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 564018ea0a8253a34b54578dc59864000267937ac5175aa437903a5afb67ece8
4
- data.tar.gz: ed89e1c5d4b7610b12eca7d66eca82e268dc17297ac040107ff26f79e620ac86
3
+ metadata.gz: 5b562ae1fcfd928c1e23e4e76c0e2bde4dfb95f88a86a46843b6aea6d9300bee
4
+ data.tar.gz: 8532ebb52fa5068f0f674490970f7e56224bb11ebf39a847f86e31ed6c4f492f
5
5
  SHA512:
6
- metadata.gz: b41423f2cedfac216e9997745f93d8480fc78d8b0b4b0d7274c2c4f9a32d430287b7250d0229e5c23374f91097dfe178df2164bc3f5bc9e0d1dcd0282382e378
7
- data.tar.gz: efef3d68cf12a5f40788a946b086a74428b06afca0f1f68b9cad79d8dbbc8fdfe81ca0def0d8de3090d050afbee9e2e224f25be7b1f1961c5788a599c40efa34
6
+ metadata.gz: ddf77eb85c6df9ad061576213d7b7074c149c2c7fb30d957c1eed2ba085416c327f5b954fe5802642061c5dc3b8dae594792d143406a9d384cde91433c0f4fd7
7
+ data.tar.gz: 5376ca994a627cd57da3462222980f3d0de9dd93d2d61edd164c3d68d9c7578df7f2c0513980b1c4d944b6e7a4cfd7f8d10b305c071bd70c5503bc710bd12b0a
@@ -73,6 +73,8 @@ module RailVerdict
73
73
  command_findings(argv.drop(1))
74
74
  when "explain"
75
75
  command_explain(argv.drop(1))
76
+ when "investigate"
77
+ command_investigate(argv.drop(1))
76
78
  when "repair"
77
79
  command_repair(argv.drop(1))
78
80
  when "review"
@@ -125,7 +127,7 @@ module RailVerdict
125
127
  opts.on("--format FORMAT", String) { |value| options[:format] = value }
126
128
  end
127
129
  parse!(parser, argv)
128
- validate_format!(options[:format])
130
+ validate_format!(options[:format], allowed: %w[console json])
129
131
  outcome = Doctor.execute(
130
132
  repository_root: @working_directory,
131
133
  config_path: options[:config]
@@ -562,7 +564,7 @@ module RailVerdict
562
564
  opts.on("--force") { options[:force] = true }
563
565
  end
564
566
  parse!(parser, argv.drop(1))
565
- validate_format!(options[:format])
567
+ validate_format!(options[:format], allowed: %w[console json])
566
568
 
567
569
  outcome, interrupted = execute_check({ config: options[:config], format: options[:format] })
568
570
  return EXIT_INTERRUPTED if interrupted || outcome.result.completion_status == "interrupted"
@@ -609,7 +611,7 @@ module RailVerdict
609
611
  opts.on("--format FORMAT", String) { |value| options[:format] = value }
610
612
  end
611
613
  parse!(parser, argv)
612
- validate_format!(options[:format])
614
+ validate_format!(options[:format], allowed: %w[console json])
613
615
  outcome, interrupted = execute_check(options)
614
616
  if options[:format] == "json"
615
617
  @stdout.write(JSON.generate(FindingsCommand.document(outcome)))
@@ -633,10 +635,10 @@ module RailVerdict
633
635
  raise RailVerdict::UsageError, error.message
634
636
  end
635
637
 
636
- def validate_format!(format)
637
- return if FORMATS.include?(format)
638
+ def validate_format!(format, allowed: FORMATS)
639
+ return if allowed.include?(format)
638
640
 
639
- raise RailVerdict::UsageError, "invalid --format #{format.inspect}; expected console, json or sarif"
641
+ raise RailVerdict::UsageError, "invalid --format #{format.inspect}; expected #{allowed.join(', ')}"
640
642
  end
641
643
 
642
644
  def execute_check(options)
@@ -709,7 +711,7 @@ module RailVerdict
709
711
  opts.on("--preview-context") { options[:preview] = true }
710
712
  end
711
713
  parse!(parser, argv.drop(1))
712
- validate_format!(options[:format])
714
+ validate_format!(options[:format], allowed: %w[console json])
713
715
 
714
716
  outcome, interrupted = execute_check({ config: options[:config], format: options[:format] })
715
717
  return EXIT_INTERRUPTED if interrupted
@@ -743,7 +745,7 @@ module RailVerdict
743
745
  opts.on("--limit N", Integer) { |v| options[:limit] = v }
744
746
  end
745
747
  parse!(parser, argv)
746
- validate_format!(options[:format])
748
+ validate_format!(options[:format], allowed: %w[console json])
747
749
 
748
750
  outcome, interrupted = execute_check({ config: options[:config], format: options[:format] })
749
751
  return EXIT_INTERRUPTED if interrupted
@@ -826,7 +828,7 @@ module RailVerdict
826
828
  opts.on("--waiver PATH", String) { |v| options[:waiver] = v }
827
829
  end
828
830
  parse!(parser, argv.drop(1))
829
- validate_format!(options[:format])
831
+ validate_format!(options[:format], allowed: %w[console json])
830
832
  raise RailVerdict::UsageError, "--base requires --changed" if options[:base] && !options[:changed]
831
833
  options[:baseline] = resolved_override_path(options[:baseline], nil) if options[:baseline]
832
834
  options[:waiver] = resolved_override_path(options[:waiver], nil) if options[:waiver]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailVerdict
4
- VERSION = "1.8.2"
4
+ VERSION = "1.8.3"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rail_verdict
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.2
4
+ version: 1.8.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pedro Dalben