branchproof 0.2.0

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.
Files changed (48) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +36 -0
  3. data/CODE_OF_CONDUCT.md +10 -0
  4. data/LICENSE.txt +202 -0
  5. data/NOTICE +3 -0
  6. data/README.md +242 -0
  7. data/doc/Branchproof/Analyzer.md +26 -0
  8. data/doc/Branchproof/CLI.md +15 -0
  9. data/doc/Branchproof/Error.md +6 -0
  10. data/doc/Branchproof/Evidence.md +46 -0
  11. data/doc/Branchproof/Instrumenter.md +18 -0
  12. data/doc/Branchproof/Limits.md +21 -0
  13. data/doc/Branchproof/Loader.md +25 -0
  14. data/doc/Branchproof/Minimizer.md +15 -0
  15. data/doc/Branchproof/MinitestAdapter.md +28 -0
  16. data/doc/Branchproof/Project.md +23 -0
  17. data/doc/Branchproof/RailsSupport/Error.md +6 -0
  18. data/doc/Branchproof/RailsSupport.md +32 -0
  19. data/doc/Branchproof/Records.md +38 -0
  20. data/doc/Branchproof/Report.md +26 -0
  21. data/doc/Branchproof/Runtime.md +37 -0
  22. data/doc/Branchproof/Source.md +23 -0
  23. data/doc/Branchproof/Worker.md +45 -0
  24. data/doc/Branchproof.md +33 -0
  25. data/doc/CHANGELOG.md +36 -0
  26. data/doc/README.md +242 -0
  27. data/exe/mcdc +6 -0
  28. data/lib/branchproof/analyzer.rb +454 -0
  29. data/lib/branchproof/cli.rb +266 -0
  30. data/lib/branchproof/evidence.rb +484 -0
  31. data/lib/branchproof/instrumenter.rb +150 -0
  32. data/lib/branchproof/limits.rb +44 -0
  33. data/lib/branchproof/loader.rb +140 -0
  34. data/lib/branchproof/minimizer.rb +198 -0
  35. data/lib/branchproof/minitest_adapter.rb +245 -0
  36. data/lib/branchproof/project.rb +53 -0
  37. data/lib/branchproof/rails_support.rb +74 -0
  38. data/lib/branchproof/records.rb +76 -0
  39. data/lib/branchproof/report.rb +412 -0
  40. data/lib/branchproof/runtime.rb +171 -0
  41. data/lib/branchproof/source.rb +238 -0
  42. data/lib/branchproof/version.rb +5 -0
  43. data/lib/branchproof/worker.rb +145 -0
  44. data/lib/branchproof.rb +24 -0
  45. data/lib/mcdc.rb +3 -0
  46. data/llms.txt +33 -0
  47. data/sig/branchproof.rbs +116 -0
  48. metadata +132 -0
@@ -0,0 +1,116 @@
1
+ module Branchproof
2
+ VERSION: String
3
+
4
+ type record = Hash[Symbol, untyped]
5
+ type limits = record
6
+
7
+ class Error < StandardError
8
+ end
9
+
10
+ module Records
11
+ def self.build: (untyped value) -> untyped
12
+ def self.id: (untyped value) -> String
13
+ def self.canonical: (untyped value) -> String
14
+ def self.diagnostic: (code: String | Symbol, severity: String | Symbol, message: String, ?source_id: String?, ?decision_id: String?, ?execution_id: String?, ?test_id: String?, ?details: record) -> record
15
+ def self.source_id: (relative_path: String, digest: String, ?encoding: String) -> String
16
+ def self.condition_id: (String decision_id, Integer index) -> String
17
+ def self.decision_id: (source_id: String, context: String, byte_start: Integer, byte_length: Integer, tree: untyped) -> String
18
+ end
19
+
20
+ module Limits
21
+ KEYS: Array[Symbol]
22
+ DEFAULTS: record
23
+ def self.default: () -> limits
24
+ def self.normalize: (?record overrides) -> limits
25
+ end
26
+
27
+ class Source
28
+ attr_reader root: String
29
+ attr_reader limits: limits
30
+ def initialize: (root: String, limits: limits) -> void
31
+ def inventory: (paths: Array[String]) -> record
32
+ end
33
+
34
+ class Project
35
+ MODES: Array[String]
36
+ RAILS_ENVIRONMENT: record
37
+ def initialize: (root: String, ?mode: String) -> void
38
+ def to_h: () -> record
39
+ end
40
+
41
+ module RailsSupport
42
+ def self.boot: (project: record) -> record
43
+ end
44
+
45
+ class Instrumenter
46
+ RUNTIME: String
47
+ def rewrite: (unit: record) -> record
48
+ end
49
+
50
+ class Loader
51
+ STATUS_KEYS: Array[Symbol]
52
+ def initialize: (inventory: record, instrumenter: Instrumenter) -> void
53
+ def install: () -> record
54
+ def load_iseq: (String path) -> untyped
55
+ def diagnostics: () -> Array[record]
56
+ end
57
+
58
+ module Runtime
59
+ def self.boot: (evidence: Evidence) -> nil
60
+ def self.enter: (String decision_id) -> nil
61
+ def self.condition: (String decision_id, Integer index, untyped value) -> untyped
62
+ def self.finish: (String decision_id, untyped value) -> untyped
63
+ def self.leave: (String decision_id) -> nil
64
+ def self.context: (?test_id: String?, ?phase: String?) -> nil
65
+ def self.snapshot: () -> record
66
+ def self.diagnostics: () -> Array[record]
67
+ end
68
+
69
+ class Evidence
70
+ SCHEMA_VERSION: String
71
+ CRITERION_VERSION: String
72
+ TOOL_VERSION: String
73
+ attr_reader inventory: record
74
+ attr_reader run_id: String
75
+ def initialize: (inventory: record, limits: limits, run_id: String) -> void
76
+ def register_test: (test: record) -> record
77
+ def record: (execution: record) -> record
78
+ def diagnose: (diagnostic: record) -> nil
79
+ def snapshot: () -> record
80
+ def merge: (snapshot: record) -> record
81
+ end
82
+
83
+ class Analyzer
84
+ CRITERION: String
85
+ def initialize: (inventory: record, evidence: record, limits: limits) -> void
86
+ def call: () -> record
87
+ def pair?: (decision_id: String, condition_index: Integer, left: record, right: record) -> bool
88
+ def missing: (decision_id: String, condition_index: Integer) -> record?
89
+ end
90
+
91
+ class Minimizer
92
+ def initialize: (analysis: record, evidence: record, limits: limits) -> void
93
+ def call: (objective: Symbol, decision_ids: Array[String]) -> record
94
+ end
95
+
96
+ class MinitestAdapter
97
+ def initialize: (runtime: untyped) -> void
98
+ def capabilities: () -> record
99
+ def run: (test_files: Array[String], runner_args: Array[String], on_complete: ^(record) -> untyped, ?before_load: ^() -> untyped?) -> nil
100
+ end
101
+
102
+ class Report
103
+ SCHEMA_VERSION: String
104
+ CRITERION_VERSION: String
105
+ def initialize: (inventory: record, evidence: record, analysis: record?, minima: Array[record], baseline: record, diagnostics: Array[record]) -> void
106
+ def write: (io: _WriteIO, format: Symbol | String) -> nil
107
+ def exit_code: () -> Integer
108
+ end
109
+
110
+ interface _WriteIO
111
+ def write: (String) -> Integer
112
+ end
113
+ end
114
+
115
+ module MCDC
116
+ end
metadata ADDED
@@ -0,0 +1,132 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: branchproof
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
5
+ platform: ruby
6
+ authors:
7
+ - Lucian Ghinda
8
+ bindir: exe
9
+ cert_chain: []
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
+ dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: minitest
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - ">="
17
+ - !ruby/object:Gem::Version
18
+ version: 5.25.5
19
+ - - "<"
20
+ - !ruby/object:Gem::Version
21
+ version: '6'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ version: 5.25.5
29
+ - - "<"
30
+ - !ruby/object:Gem::Version
31
+ version: '6'
32
+ - !ruby/object:Gem::Dependency
33
+ name: prism
34
+ requirement: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - ">="
37
+ - !ruby/object:Gem::Version
38
+ version: '1.0'
39
+ - - "<"
40
+ - !ruby/object:Gem::Version
41
+ version: '2'
42
+ type: :runtime
43
+ prerelease: false
44
+ version_requirements: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - ">="
47
+ - !ruby/object:Gem::Version
48
+ version: '1.0'
49
+ - - "<"
50
+ - !ruby/object:Gem::Version
51
+ version: '2'
52
+ description: Inventory Ruby decisions and report masking MC/DC evidence from Minitest
53
+ runs.
54
+ email:
55
+ - lucianghinda@users.noreply.github.com
56
+ executables:
57
+ - mcdc
58
+ extensions: []
59
+ extra_rdoc_files: []
60
+ files:
61
+ - CHANGELOG.md
62
+ - CODE_OF_CONDUCT.md
63
+ - LICENSE.txt
64
+ - NOTICE
65
+ - README.md
66
+ - doc/Branchproof.md
67
+ - doc/Branchproof/Analyzer.md
68
+ - doc/Branchproof/CLI.md
69
+ - doc/Branchproof/Error.md
70
+ - doc/Branchproof/Evidence.md
71
+ - doc/Branchproof/Instrumenter.md
72
+ - doc/Branchproof/Limits.md
73
+ - doc/Branchproof/Loader.md
74
+ - doc/Branchproof/Minimizer.md
75
+ - doc/Branchproof/MinitestAdapter.md
76
+ - doc/Branchproof/Project.md
77
+ - doc/Branchproof/RailsSupport.md
78
+ - doc/Branchproof/RailsSupport/Error.md
79
+ - doc/Branchproof/Records.md
80
+ - doc/Branchproof/Report.md
81
+ - doc/Branchproof/Runtime.md
82
+ - doc/Branchproof/Source.md
83
+ - doc/Branchproof/Worker.md
84
+ - doc/CHANGELOG.md
85
+ - doc/README.md
86
+ - exe/mcdc
87
+ - lib/branchproof.rb
88
+ - lib/branchproof/analyzer.rb
89
+ - lib/branchproof/cli.rb
90
+ - lib/branchproof/evidence.rb
91
+ - lib/branchproof/instrumenter.rb
92
+ - lib/branchproof/limits.rb
93
+ - lib/branchproof/loader.rb
94
+ - lib/branchproof/minimizer.rb
95
+ - lib/branchproof/minitest_adapter.rb
96
+ - lib/branchproof/project.rb
97
+ - lib/branchproof/rails_support.rb
98
+ - lib/branchproof/records.rb
99
+ - lib/branchproof/report.rb
100
+ - lib/branchproof/runtime.rb
101
+ - lib/branchproof/source.rb
102
+ - lib/branchproof/version.rb
103
+ - lib/branchproof/worker.rb
104
+ - lib/mcdc.rb
105
+ - llms.txt
106
+ - sig/branchproof.rbs
107
+ homepage: https://github.com/lucianghinda/branchproof
108
+ licenses:
109
+ - Apache-2.0
110
+ metadata:
111
+ homepage_uri: https://github.com/lucianghinda/branchproof
112
+ source_code_uri: https://github.com/lucianghinda/branchproof/tree/main
113
+ changelog_uri: https://github.com/lucianghinda/branchproof/blob/main/CHANGELOG.md
114
+ rubygems_mfa_required: 'true'
115
+ rdoc_options: []
116
+ require_paths:
117
+ - lib
118
+ required_ruby_version: !ruby/object:Gem::Requirement
119
+ requirements:
120
+ - - ">="
121
+ - !ruby/object:Gem::Version
122
+ version: 3.3.0
123
+ required_rubygems_version: !ruby/object:Gem::Requirement
124
+ requirements:
125
+ - - ">="
126
+ - !ruby/object:Gem::Version
127
+ version: '0'
128
+ requirements: []
129
+ rubygems_version: 4.0.11
130
+ specification_version: 4
131
+ summary: Modified condition and decision coverage for Ruby tests
132
+ test_files: []