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 +4 -4
- data/lib/rail_verdict/cli.rb +11 -9
- data/lib/rail_verdict/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5b562ae1fcfd928c1e23e4e76c0e2bde4dfb95f88a86a46843b6aea6d9300bee
|
|
4
|
+
data.tar.gz: 8532ebb52fa5068f0f674490970f7e56224bb11ebf39a847f86e31ed6c4f492f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ddf77eb85c6df9ad061576213d7b7074c149c2c7fb30d957c1eed2ba085416c327f5b954fe5802642061c5dc3b8dae594792d143406a9d384cde91433c0f4fd7
|
|
7
|
+
data.tar.gz: 5376ca994a627cd57da3462222980f3d0de9dd93d2d61edd164c3d68d9c7578df7f2c0513980b1c4d944b6e7a4cfd7f8d10b305c071bd70c5503bc710bd12b0a
|
data/lib/rail_verdict/cli.rb
CHANGED
|
@@ -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
|
|
638
|
+
def validate_format!(format, allowed: FORMATS)
|
|
639
|
+
return if allowed.include?(format)
|
|
638
640
|
|
|
639
|
-
raise RailVerdict::UsageError, "invalid --format #{format.inspect}; expected
|
|
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]
|
data/lib/rail_verdict/version.rb
CHANGED