duel 0.1.0 → 0.1.1

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.
data/sig/duel/init.rbs CHANGED
@@ -63,9 +63,15 @@ module Duel
63
63
 
64
64
  def render: (String name) -> String
65
65
 
66
+ # The project's configuration, as the conventions have it.
67
+ def config: () -> Config
68
+
66
69
  # The library the gemspec names, or nil.
67
70
  def library: () -> String?
68
71
 
72
+ # The glob release tags match, for the workflow.
73
+ def release_tags: () -> String
74
+
69
75
  # The library, without a gemspec: lib/'s only Ruby file, or nil.
70
76
  def guess: () -> String?
71
77
 
@@ -15,16 +15,18 @@ module Duel
15
15
  @results: Array[Result]
16
16
  @settings: Settings
17
17
  @exit: Integer
18
+ @comment: String
18
19
  @versions: Hash[String, Hash[String, String | bool | nil]]
19
20
 
20
- # A run that didn't compare: +status+, its +exit+ status, and what it
21
- # said.
22
- def self.note: (String status, Integer exit, String message, Settings settings) -> report
21
+ # A run that didn't compare: +status+, its +exit+ status, what it
22
+ # said, and what the workflow does about its comment.
23
+ def self.note: (String status, Integer exit, String message, Settings settings, String comment) -> report
23
24
 
24
25
  # What every report starts with.
25
- def self.head: (String status, Integer exit, String? message, Settings settings) -> report
26
+ def self.head: (String status, Integer exit, String? message, Settings settings, String comment) -> report
26
27
 
27
- def initialize: (Runner runner, Array[Result] results, settings: Settings, exit: Integer, baseline: Hash[String, String?],
28
+ def initialize: (Runner runner, Array[Result] results, settings: Settings, exit: Integer, comment: String,
29
+ baseline: Hash[String, String?],
28
30
  candidate: Hash[String, String | bool | nil]) -> void
29
31
 
30
32
  def to_h: () -> report
data/sig/duel/runner.rbs CHANGED
@@ -18,7 +18,7 @@ module Duel
18
18
 
19
19
  # How a run is set up (see Duel::CLI for where each comes from).
20
20
  # @api private
21
- class Settings < Struct[String | Regexp | Integer | Float | bool | Config::ruby | nil]
21
+ class Settings < Struct[String | Regexp | Integer | Float | bool | Config::ruby | Config::comment | nil]
22
22
  attr_accessor base: String?
23
23
  attr_accessor base_dir: String?
24
24
  attr_accessor candidate_dir: String?
@@ -33,13 +33,16 @@ module Duel
33
33
  attr_accessor timeout: Float
34
34
  # Each version's Ruby (--ruby), over Config#ruby.
35
35
  attr_accessor ruby: Config::ruby
36
+ # When the workflow comments on a pull request (--comment), over
37
+ # Config#comment.
38
+ attr_accessor comment: Config::comment?
36
39
 
37
40
  def self.new: (?String? base, ?String? base_dir, ?String? candidate_dir, ?Regexp filter, ?Integer jobs,
38
41
  ?Integer processes, ?Float limit, ?Float confidence, ?Float? warm, ?bool force, ?String? config_path,
39
- ?Float timeout, ?Config::ruby ruby) -> instance
42
+ ?Float timeout, ?Config::ruby ruby, ?Config::comment? comment) -> instance
40
43
  | (?base: String?, ?base_dir: String?, ?candidate_dir: String?, ?filter: Regexp, ?jobs: Integer,
41
44
  ?processes: Integer, ?limit: Float, ?confidence: Float, ?warm: Float?, ?force: bool,
42
- ?config_path: String?, ?timeout: Float, ?ruby: Config::ruby) -> instance
45
+ ?config_path: String?, ?timeout: Float, ?ruby: Config::ruby, ?comment: Config::comment?) -> instance
43
46
 
44
47
  def self.defaults: () -> Settings
45
48
  end
data/sig/duel/summary.rbs CHANGED
@@ -14,17 +14,33 @@ module Duel
14
14
  # The verdicts that fail a run.
15
15
  FAILED: Array[String]
16
16
 
17
+ # What the heading starts with.
18
+ PASSED_MARK: String
19
+ FAILED_MARK: String
20
+ NEUTRAL_MARK: String
21
+
22
+ # What an unsettled timing means.
23
+ UNSETTLED: String
24
+
25
+ # How Duel decides that a timing is slower, in its docs.
26
+ DECIDES: String
27
+
17
28
  @runner: Runner
18
29
  @results: Array[Result]
19
30
  @settings: Settings
20
- @versions: Hash[String, String]
31
+ @baseline: String
32
+ @candidate: String
21
33
  @regressed: Array[Result]
34
+ @failed: Array[Result]
22
35
 
23
36
  # +text+ as code, in Markdown.
24
37
  def self.code: (String text) -> String
25
38
 
26
- # A run that didn't compare, with what it said.
27
- def self.note: (String title, String message) -> String
39
+ # +text+ as it is, in Markdown.
40
+ def self.escape: (String text) -> String
41
+
42
+ # A run that didn't compare, and why.
43
+ def self.note: (String mark, String title, String reason) -> String
28
44
 
29
45
  # +text+ in a fenced block of its own.
30
46
  def self.block: (String text) -> String
@@ -45,26 +61,35 @@ module Duel
45
61
  # The Markdown, with the first +explained+ regressions explained.
46
62
  def render: (Integer explained) -> String
47
63
 
64
+ # The verdict.
48
65
  def heading: () -> String
49
66
 
50
- # Each version, on its Ruby where theirs differ.
51
- def versions: () -> String
67
+ # The two versions, and why any benchmark was skipped.
68
+ def compared: () -> String
69
+
70
+ # The benchmarks that failed.
71
+ def failures: () -> String?
52
72
 
53
- def overview: () -> String
73
+ # What got worse, or the error's first line.
74
+ def failure: (Result result) -> String
75
+
76
+ # The frame whose own share of the CPU grew the most.
77
+ def top: (Result result) -> String
78
+
79
+ # The rest, collapsed.
80
+ def details: (Integer explained) -> String
54
81
 
55
82
  # The results, by verdict.
56
83
  def sorted: () -> Array[Result]
57
84
 
58
- def table: (Array[Result] changed) -> String?
59
-
60
- # Those that didn't change, collapsed.
61
- def unchanged: (Array[Result] same) -> String?
85
+ # Every benchmark.
86
+ def table: () -> String?
62
87
 
63
88
  # A table's row of +cells+.
64
- def row: (*String cells) -> String
89
+ def row: (Array[String] cells) -> String
65
90
 
66
- # A benchmark's name, for a table's cell.
67
- def name: (Result result) -> String
91
+ # +text+ for a table's cell, on one line.
92
+ def cell: (String text) -> String
68
93
 
69
94
  # Each timed measure's ratio and its interval.
70
95
  def timings: (Result result) -> String
@@ -75,13 +100,18 @@ module Duel
75
100
  def mb: (Integer bytes) -> String
76
101
 
77
102
  # The first +explained+ regressions, explained.
78
- def regressions: (Integer explained) -> String?
103
+ def regressions: (Integer explained) -> Array[String]
79
104
 
80
105
  # The verdicts across the board.
81
- def across: () -> String?
106
+ def across: (confirmed: bool) -> String?
107
+
108
+ # The errors of more than a line.
109
+ def errors: () -> Array[String]
82
110
 
83
- def unsettled: () -> String?
111
+ # Each version's Ruby, where they differ.
112
+ def rubies: () -> String?
84
113
 
85
- def errors: () -> String?
114
+ # How Duel decides that a timing is slower.
115
+ def decides: () -> String
86
116
  end
87
117
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: duel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erik Berlin