rigortype 0.1.19 → 0.2.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.
Files changed (197) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +41 -6
  3. data/data/core_overlay/numeric.rbs +33 -0
  4. data/data/core_overlay/pathname.rbs +25 -0
  5. data/data/core_overlay/string_scanner.rbs +28 -0
  6. data/data/gem_overlay/activesupport/core_ext.rbs +473 -0
  7. data/data/vendored_gem_sigs/ast/ast.rbs +130 -0
  8. data/data/vendored_gem_sigs/bcrypt/bcrypt.rbs +47 -0
  9. data/data/vendored_gem_sigs/bundler/bundler.rbs +238 -0
  10. data/data/vendored_gem_sigs/cgi/cgi_extras.rbs +34 -0
  11. data/data/vendored_gem_sigs/did_you_mean/did_you_mean_extras.rbs +34 -0
  12. data/data/vendored_gem_sigs/idn-ruby/idn.rbs +54 -0
  13. data/data/vendored_gem_sigs/mysql2/client.rbs +55 -0
  14. data/data/vendored_gem_sigs/mysql2/error.rbs +5 -0
  15. data/data/vendored_gem_sigs/mysql2/result.rbs +31 -0
  16. data/data/vendored_gem_sigs/mysql2/statement.rbs +5 -0
  17. data/data/vendored_gem_sigs/nokogiri/nokogiri.rbs +2332 -0
  18. data/data/vendored_gem_sigs/nokogiri/nokogiri_html5.rbs +47 -0
  19. data/data/vendored_gem_sigs/pg/pg.rbs +212 -0
  20. data/data/vendored_gem_sigs/prism/prism_supplement.rbs +44 -0
  21. data/data/vendored_gem_sigs/redis/errors.rbs +50 -0
  22. data/data/vendored_gem_sigs/redis/future.rbs +5 -0
  23. data/data/vendored_gem_sigs/redis/redis.rbs +348 -0
  24. data/data/vendored_gem_sigs/redis/redis_extras.rbs +130 -0
  25. data/data/vendored_gem_sigs/rubygems/rubygems_extras.rbs +226 -0
  26. data/lib/rigor/analysis/check_rules/ivar_write_collector.rb +3 -23
  27. data/lib/rigor/analysis/check_rules/rule_walk.rb +3 -21
  28. data/lib/rigor/analysis/check_rules/self_closedness_scanner.rb +24 -15
  29. data/lib/rigor/analysis/check_rules.rb +492 -71
  30. data/lib/rigor/analysis/dependency_source_inference/index.rb +4 -7
  31. data/lib/rigor/analysis/dependency_source_inference/walker.rb +2 -18
  32. data/lib/rigor/analysis/dependency_source_inference.rb +3 -12
  33. data/lib/rigor/analysis/fact_store.rb +5 -4
  34. data/lib/rigor/analysis/rule_catalog.rb +153 -6
  35. data/lib/rigor/analysis/runner/diagnostic_aggregator.rb +17 -17
  36. data/lib/rigor/analysis/runner/project_pre_passes.rb +9 -8
  37. data/lib/rigor/analysis/runner.rb +17 -6
  38. data/lib/rigor/analysis/self_call_resolution_recorder.rb +3 -4
  39. data/lib/rigor/analysis/worker_session.rb +10 -14
  40. data/lib/rigor/builtins/predefined_constant_refinements.rb +151 -0
  41. data/lib/rigor/cache/store.rb +5 -3
  42. data/lib/rigor/cli/annotate_command.rb +28 -7
  43. data/lib/rigor/cli/baseline_command.rb +4 -3
  44. data/lib/rigor/cli/check_command.rb +138 -16
  45. data/lib/rigor/cli/coverage_command.rb +138 -31
  46. data/lib/rigor/cli/coverage_mutation.rb +149 -0
  47. data/lib/rigor/cli/coverage_scan.rb +57 -0
  48. data/lib/rigor/cli/explain_command.rb +2 -0
  49. data/lib/rigor/cli/fused_protection_renderer.rb +67 -0
  50. data/lib/rigor/cli/fused_protection_report.rb +76 -0
  51. data/lib/rigor/cli/lsp_command.rb +3 -7
  52. data/lib/rigor/cli/mutation_protection_renderer.rb +63 -0
  53. data/lib/rigor/cli/mutation_protection_report.rb +73 -0
  54. data/lib/rigor/cli/options.rb +9 -0
  55. data/lib/rigor/cli/plugins_command.rb +2 -1
  56. data/lib/rigor/cli/protection_renderer.rb +63 -0
  57. data/lib/rigor/cli/protection_report.rb +68 -0
  58. data/lib/rigor/cli/sig_gen_command.rb +2 -1
  59. data/lib/rigor/cli/trace_command.rb +2 -1
  60. data/lib/rigor/cli/triage_command.rb +2 -1
  61. data/lib/rigor/cli/type_of_command.rb +1 -1
  62. data/lib/rigor/cli/type_scan_command.rb +2 -1
  63. data/lib/rigor/cli.rb +3 -2
  64. data/lib/rigor/config_audit.rb +152 -0
  65. data/lib/rigor/configuration/dependencies.rb +2 -4
  66. data/lib/rigor/configuration.rb +57 -7
  67. data/lib/rigor/environment/bundle_sig_discovery.rb +61 -13
  68. data/lib/rigor/environment/class_registry.rb +4 -3
  69. data/lib/rigor/environment/constant_type_cache_holder.rb +43 -0
  70. data/lib/rigor/environment/lockfile_resolver.rb +1 -1
  71. data/lib/rigor/environment/rbs_collection_discovery.rb +1 -2
  72. data/lib/rigor/environment/rbs_coverage_report.rb +2 -1
  73. data/lib/rigor/environment/rbs_loader.rb +76 -5
  74. data/lib/rigor/environment.rb +66 -8
  75. data/lib/rigor/flow_contribution/fact.rb +1 -1
  76. data/lib/rigor/flow_contribution.rb +3 -5
  77. data/lib/rigor/inference/acceptance.rb +17 -9
  78. data/lib/rigor/inference/block_parameter_binder.rb +2 -3
  79. data/lib/rigor/inference/builtins/comparable_catalog.rb +2 -2
  80. data/lib/rigor/inference/builtins/enumerable_catalog.rb +2 -2
  81. data/lib/rigor/inference/builtins/method_catalog.rb +19 -0
  82. data/lib/rigor/inference/builtins/string_catalog.rb +9 -1
  83. data/lib/rigor/inference/expression_typer.rb +20 -28
  84. data/lib/rigor/inference/hkt_body.rb +8 -11
  85. data/lib/rigor/inference/hkt_body_parser.rb +10 -12
  86. data/lib/rigor/inference/hkt_registry.rb +10 -11
  87. data/lib/rigor/inference/method_dispatcher/call_context.rb +1 -4
  88. data/lib/rigor/inference/method_dispatcher/constant_folding.rb +169 -24
  89. data/lib/rigor/inference/method_dispatcher/data_folding.rb +9 -73
  90. data/lib/rigor/inference/method_dispatcher/file_folding.rb +6 -7
  91. data/lib/rigor/inference/method_dispatcher/iterator_dispatch.rb +10 -16
  92. data/lib/rigor/inference/method_dispatcher/kernel_dispatch.rb +25 -13
  93. data/lib/rigor/inference/method_dispatcher/member_shape_projection.rb +93 -0
  94. data/lib/rigor/inference/method_dispatcher/overload_selector.rb +1 -3
  95. data/lib/rigor/inference/method_dispatcher/rbs_dispatch.rb +24 -22
  96. data/lib/rigor/inference/method_dispatcher/shape_dispatch.rb +90 -15
  97. data/lib/rigor/inference/method_dispatcher/struct_folding.rb +303 -0
  98. data/lib/rigor/inference/method_dispatcher.rb +40 -48
  99. data/lib/rigor/inference/mutation_widening.rb +5 -11
  100. data/lib/rigor/inference/narrowing.rb +14 -16
  101. data/lib/rigor/inference/parameter_inference_collector.rb +367 -0
  102. data/lib/rigor/inference/project_patched_methods.rb +4 -7
  103. data/lib/rigor/inference/project_patched_scanner.rb +2 -13
  104. data/lib/rigor/inference/protection_scanner.rb +86 -0
  105. data/lib/rigor/inference/scope_indexer.rb +129 -55
  106. data/lib/rigor/inference/statement_evaluator.rb +271 -114
  107. data/lib/rigor/inference/struct_fold_safety.rb +181 -0
  108. data/lib/rigor/inference/synthetic_method.rb +7 -7
  109. data/lib/rigor/language_server/completion_provider.rb +6 -12
  110. data/lib/rigor/language_server/diagnostic_publisher.rb +4 -4
  111. data/lib/rigor/language_server/document_symbol_provider.rb +3 -3
  112. data/lib/rigor/language_server/hover_provider.rb +2 -3
  113. data/lib/rigor/language_server/hover_renderer.rb +2 -11
  114. data/lib/rigor/language_server/server.rb +9 -17
  115. data/lib/rigor/language_server.rb +4 -5
  116. data/lib/rigor/plugin/base.rb +10 -8
  117. data/lib/rigor/plugin/macro/block_as_method.rb +3 -4
  118. data/lib/rigor/plugin/macro/heredoc_template.rb +4 -7
  119. data/lib/rigor/plugin/macro/trait_registry.rb +3 -6
  120. data/lib/rigor/plugin/macro.rb +4 -5
  121. data/lib/rigor/plugin/manifest.rb +45 -66
  122. data/lib/rigor/plugin/registry.rb +6 -7
  123. data/lib/rigor/plugin/type_node_resolver.rb +6 -8
  124. data/lib/rigor/protection/diagnostic_oracle.rb +51 -0
  125. data/lib/rigor/protection/mutation_scanner.rb +180 -0
  126. data/lib/rigor/protection/mutator.rb +267 -0
  127. data/lib/rigor/protection/test_suite_oracle.rb +68 -0
  128. data/lib/rigor/rbs_extended.rb +24 -36
  129. data/lib/rigor/reflection.rb +4 -7
  130. data/lib/rigor/scope/discovery_index.rb +14 -2
  131. data/lib/rigor/scope.rb +54 -11
  132. data/lib/rigor/sig_gen/observed_call.rb +3 -3
  133. data/lib/rigor/sig_gen/writer.rb +40 -2
  134. data/lib/rigor/signature_path_audit.rb +92 -0
  135. data/lib/rigor/source/constant_path.rb +62 -0
  136. data/lib/rigor/source.rb +1 -0
  137. data/lib/rigor/type/bound_method.rb +2 -11
  138. data/lib/rigor/type/combinator.rb +16 -3
  139. data/lib/rigor/type/constant.rb +2 -11
  140. data/lib/rigor/type/data_class.rb +2 -11
  141. data/lib/rigor/type/data_instance.rb +2 -11
  142. data/lib/rigor/type/hash_shape.rb +2 -11
  143. data/lib/rigor/type/integer_range.rb +2 -11
  144. data/lib/rigor/type/intersection.rb +2 -11
  145. data/lib/rigor/type/nominal.rb +2 -11
  146. data/lib/rigor/type/plain_lattice.rb +37 -0
  147. data/lib/rigor/type/refined.rb +72 -13
  148. data/lib/rigor/type/singleton.rb +2 -11
  149. data/lib/rigor/type/struct_class.rb +75 -0
  150. data/lib/rigor/type/struct_instance.rb +93 -0
  151. data/lib/rigor/type/tuple.rb +5 -15
  152. data/lib/rigor/type.rb +2 -0
  153. data/lib/rigor/version.rb +1 -1
  154. data/plugins/rigor-actioncable/lib/rigor/plugin/actioncable/channel_discoverer.rb +1 -1
  155. data/plugins/rigor-actioncable/lib/rigor/plugin/actioncable/channel_index.rb +3 -3
  156. data/plugins/rigor-actioncable/lib/rigor/plugin/actioncable.rb +3 -3
  157. data/plugins/rigor-actionmailer/lib/rigor/plugin/actionmailer/mailer_discoverer.rb +5 -13
  158. data/plugins/rigor-actionpack/lib/rigor/plugin/actionpack/analyzer.rb +11 -17
  159. data/plugins/rigor-actionpack/lib/rigor/plugin/actionpack.rb +7 -10
  160. data/plugins/rigor-activejob/lib/rigor/plugin/activejob/job_index.rb +3 -2
  161. data/plugins/rigor-activerecord/lib/rigor/plugin/activerecord/model_discoverer.rb +4 -4
  162. data/plugins/rigor-activerecord/lib/rigor/plugin/activerecord.rb +6 -8
  163. data/plugins/rigor-activestorage/lib/rigor/plugin/activestorage/analyzer.rb +5 -7
  164. data/plugins/rigor-activestorage/lib/rigor/plugin/activestorage.rb +1 -2
  165. data/plugins/rigor-devise/lib/rigor/plugin/devise.rb +9 -11
  166. data/plugins/rigor-dry-struct/lib/rigor/plugin/dry_struct.rb +8 -9
  167. data/plugins/rigor-dry-types/lib/rigor/plugin/dry_types.rb +13 -12
  168. data/plugins/rigor-dry-validation/lib/rigor/plugin/dry_validation.rb +3 -4
  169. data/plugins/rigor-factorybot/lib/rigor/plugin/factorybot/analyzer.rb +8 -8
  170. data/plugins/rigor-factorybot/lib/rigor/plugin/factorybot/factory_discoverer.rb +9 -11
  171. data/plugins/rigor-factorybot/lib/rigor/plugin/factorybot/factory_index.rb +7 -8
  172. data/plugins/rigor-factorybot/lib/rigor/plugin/factorybot.rb +7 -9
  173. data/plugins/rigor-graphql/lib/rigor/plugin/graphql/type_scanner.rb +12 -13
  174. data/plugins/rigor-graphql/lib/rigor/plugin/graphql.rb +15 -23
  175. data/plugins/rigor-mangrove/lib/rigor/plugin/mangrove.rb +3 -3
  176. data/plugins/rigor-minitest/lib/rigor/plugin/minitest.rb +3 -3
  177. data/plugins/rigor-rails-i18n/lib/rigor/plugin/rails_i18n/analyzer.rb +2 -4
  178. data/plugins/rigor-rails-i18n/lib/rigor/plugin/rails_i18n/locale_loader.rb +27 -11
  179. data/plugins/rigor-rails-i18n/lib/rigor/plugin/rails_i18n.rb +1 -1
  180. data/plugins/rigor-rails-routes/lib/rigor/plugin/rails_routes/devise_routes.rb +4 -6
  181. data/plugins/rigor-rails-routes/lib/rigor/plugin/rails_routes/routes_parser.rb +12 -18
  182. data/plugins/rigor-rails-routes/lib/rigor/plugin/rails_routes.rb +5 -5
  183. data/plugins/rigor-rspec/lib/rigor/plugin/rspec/let_scope_index.rb +3 -4
  184. data/plugins/rigor-rspec/lib/rigor/plugin/rspec/let_type_resolver.rb +1 -1
  185. data/plugins/rigor-rspec/lib/rigor/plugin/rspec/matcher_analyzer.rb +1 -1
  186. data/plugins/rigor-rspec/lib/rigor/plugin/rspec.rb +19 -14
  187. data/plugins/rigor-shoulda-matchers/lib/rigor/plugin/shoulda_matchers/analyzer.rb +0 -1
  188. data/plugins/rigor-sidekiq/lib/rigor/plugin/sidekiq/worker_index.rb +5 -4
  189. data/plugins/rigor-sorbet/lib/rigor/plugin/sorbet/assertion_recognizer.rb +2 -3
  190. data/plugins/rigor-sorbet/lib/rigor/plugin/sorbet/method_signature.rb +7 -11
  191. data/plugins/rigor-sorbet/lib/rigor/plugin/sorbet/sig_parser.rb +4 -5
  192. data/plugins/rigor-sorbet/lib/rigor/plugin/sorbet/sigil_detector.rb +6 -9
  193. data/plugins/rigor-sorbet/lib/rigor/plugin/sorbet/type_translator.rb +5 -15
  194. data/plugins/rigor-sorbet/lib/rigor/plugin/sorbet.rb +28 -41
  195. data/sig/rigor/scope.rbs +9 -1
  196. data/sig/rigor/type.rbs +36 -1
  197. metadata +49 -1
@@ -0,0 +1,47 @@
1
+ # Rigor-side patches on top of the gem_rbs_collection's
2
+ # nokogiri/1.11/ surface to cover API added in later nokogiri
3
+ # releases that real-world Rails projects actually use.
4
+ #
5
+ # Source: hand-written by Rigor maintainers.
6
+ # License: MPL-2.0 (matches the rest of Rigor).
7
+ #
8
+ # Add new entries here when a project flags
9
+ # `call.undefined-method` for a Nokogiri method that should exist.
10
+ # Each addition SHOULD be a real public method in upstream Nokogiri.
11
+
12
+ # Top-level Nokogiri::HTML5 entry - nokogiri 1.12+ shipped its own
13
+ # spec-conformant HTML5 parser at the top level. Calls are
14
+ # `Nokogiri::HTML5(html_string)` (which dispatches to
15
+ # `Nokogiri.HTML5(...)`) and `Nokogiri::HTML5.parse(...)` /
16
+ # `.fragment(...)`.
17
+ module Nokogiri
18
+ def self.HTML5: (String html, ?untyped url, ?untyped encoding, **untyped options) -> Nokogiri::HTML5::Document
19
+ end
20
+
21
+ module Nokogiri::HTML5
22
+ def self.parse: (String html, ?untyped url, ?untyped encoding, **untyped options) -> Nokogiri::HTML5::Document
23
+ def self.fragment: (String html, ?untyped encoding, **untyped options) -> Nokogiri::HTML5::DocumentFragment
24
+ def self.get: (String uri, **untyped options) -> Nokogiri::HTML5::Document
25
+ def self.read_and_encode: (untyped string, untyped encoding) -> String
26
+ end
27
+
28
+ class Nokogiri::HTML5::Document < Nokogiri::HTML::Document
29
+ def self.parse: (String html, ?untyped url, ?untyped encoding, **untyped options) -> Nokogiri::HTML5::Document
30
+ def self.read_io: (untyped, untyped, untyped, untyped) -> Nokogiri::HTML5::Document
31
+ def self.read_memory: (untyped, untyped, untyped, untyped) -> Nokogiri::HTML5::Document
32
+
33
+ def fragment: (?String tags) -> Nokogiri::HTML5::DocumentFragment
34
+ def quirks_mode: () -> Symbol
35
+ end
36
+
37
+ class Nokogiri::HTML5::DocumentFragment < Nokogiri::HTML::DocumentFragment
38
+ def self.parse: (String html, ?untyped encoding, **untyped options) -> Nokogiri::HTML5::DocumentFragment
39
+ end
40
+
41
+ # nokogiri 1.12+ adds element-sibling accessors on Nokogiri::XML::Node;
42
+ # the gem_rbs_collection 1.11 snapshot pre-dates them.
43
+ class Nokogiri::XML::Node
44
+ def previous_element_sibling: () -> Nokogiri::XML::Element?
45
+ def next_element_sibling: () -> Nokogiri::XML::Element?
46
+ def wrap_node: (untyped html) -> Nokogiri::XML::Element
47
+ end
@@ -0,0 +1,212 @@
1
+ # Minimal hand-authored RBS stub for the `pg` gem (PostgreSQL native
2
+ # extension). Covers the surface that real-world Rails projects
3
+ # (Mastodon, GitLab FOSS, OpenProject, Diaspora, etc.) actually call
4
+ # rather than the entire libpq surface; PRs to extend are welcome.
5
+ #
6
+ # `pg` is not in `ruby/gem_rbs_collection` as of 2026-05-15.
7
+ # Authorship: hand-written by Rigor maintainers based on the
8
+ # upstream README + libpq documentation.
9
+
10
+ module PG
11
+ VERSION: String
12
+ REVISION: String
13
+
14
+ # Connection-establishment shortcut: `PG.connect(...)` is an alias for
15
+ # `PG::Connection.new(...)`.
16
+ def self.connect: (*untyped) -> PG::Connection
17
+
18
+ # Quoting helpers.
19
+ def self.quote_connstr: (String value) -> String
20
+ def self.escape_string: (String value) -> String
21
+
22
+ class Error < StandardError
23
+ def connection: () -> PG::Connection?
24
+ def result: () -> PG::Result?
25
+ def error: () -> String?
26
+ def severity: () -> String?
27
+ def sql_state: () -> String?
28
+ end
29
+
30
+ class ConnectionBad < Error
31
+ end
32
+
33
+ class UnableToSend < Error
34
+ end
35
+
36
+ class ServerError < Error
37
+ end
38
+
39
+ class Connection
40
+ INVALID_OID: Integer
41
+
42
+ def self.new: (?untyped, *untyped) -> instance
43
+ def self.open: (?untyped, *untyped) -> instance
44
+ def self.connect: (?untyped, *untyped) -> instance
45
+ def self.connect_start: (*untyped) -> instance
46
+ def self.escape_string: (String) -> String
47
+ def self.escape_bytea: (String) -> String
48
+ def self.unescape_bytea: (String) -> String
49
+ def self.quote_ident: (String | Symbol | Array[String | Symbol]) -> String
50
+ def self.connect_hash_to_string: (Hash[Symbol, untyped]) -> String
51
+
52
+ def initialize: (?untyped, *untyped) -> void
53
+
54
+ # Query execution.
55
+ def exec: (String sql, ?Array[untyped] params) -> PG::Result
56
+ | (String sql, ?Array[untyped] params) { (PG::Result) -> untyped } -> untyped
57
+ alias query exec
58
+ alias async_exec exec
59
+
60
+ def exec_params: (String sql, Array[untyped] params, ?Integer result_format) -> PG::Result
61
+ | (String sql, Array[untyped] params, ?Integer result_format) { (PG::Result) -> untyped } -> untyped
62
+ alias async_exec_params exec_params
63
+
64
+ def exec_prepared: (String stmt_name, ?Array[untyped] params, ?Integer result_format) -> PG::Result
65
+ | (String stmt_name, ?Array[untyped] params, ?Integer result_format) { (PG::Result) -> untyped } -> untyped
66
+ alias async_exec_prepared exec_prepared
67
+
68
+ def prepare: (String name, String sql, ?Array[Integer] param_types) -> PG::Result
69
+ alias async_prepare prepare
70
+
71
+ def describe_prepared: (String name) -> PG::Result
72
+ def describe_portal: (String name) -> PG::Result
73
+
74
+ # Connection state.
75
+ def reset: () -> void
76
+ def reset_start: () -> void
77
+ def reset_poll: () -> Integer
78
+ def close: () -> void
79
+ alias finish close
80
+ def finished?: () -> bool
81
+ def status: () -> Integer
82
+ def error_message: () -> String?
83
+ def db: () -> String
84
+ def user: () -> String
85
+ def host: () -> String
86
+ def hostaddr: () -> String
87
+ def port: () -> Integer
88
+ def server_version: () -> Integer
89
+ def protocol_version: () -> Integer
90
+ def transaction_status: () -> Integer
91
+ def parameter_status: (String name) -> String?
92
+
93
+ # Quoting / escaping.
94
+ def escape_string: (String) -> String
95
+ alias escape escape_string
96
+ def escape_bytea: (String) -> String
97
+ def unescape_bytea: (String) -> String
98
+ def quote_ident: (String | Symbol | Array[String | Symbol]) -> String
99
+
100
+ # Transaction helper.
101
+ def transaction: () { (self) -> untyped } -> untyped
102
+
103
+ # Notifications / LISTEN / NOTIFY.
104
+ def notifies: () -> Hash[Symbol, untyped]?
105
+ def wait_for_notify: (?Numeric timeout) ?{ (String, Integer, String?) -> void } -> String?
106
+ alias notifies_wait wait_for_notify
107
+
108
+ # COPY.
109
+ def put_copy_data: (String, ?untyped encoder) -> bool
110
+ def put_copy_end: (?String error_message) -> bool
111
+ def get_copy_data: (?bool async, ?untyped decoder) -> String?
112
+
113
+ # Misc.
114
+ def encrypt_password: (String password, String username, ?String? algorithm) -> String
115
+ def cancel: () -> String?
116
+ def trace: (IO) -> void
117
+ def untrace: () -> void
118
+ def encoding: () -> Encoding?
119
+ def set_client_encoding: (String) -> Integer
120
+ alias client_encoding set_client_encoding
121
+
122
+ def type_map_for_queries: () -> untyped
123
+ def type_map_for_queries=: (untyped) -> untyped
124
+ def type_map_for_results: () -> untyped
125
+ def type_map_for_results=: (untyped) -> untyped
126
+ end
127
+
128
+ class Result
129
+ include Enumerable[Hash[String, untyped]]
130
+
131
+ def each: () { (Hash[String, untyped]) -> void } -> self
132
+ def each_row: () { (Array[untyped]) -> void } -> self
133
+ def []: (Integer | String row_or_column) -> untyped
134
+ def values: () -> Array[Array[untyped]]
135
+ def to_a: () -> Array[Hash[String, untyped]]
136
+
137
+ def ntuples: () -> Integer
138
+ alias num_tuples ntuples
139
+ alias count ntuples
140
+
141
+ def nfields: () -> Integer
142
+ alias num_fields nfields
143
+
144
+ def fname: (Integer column) -> String
145
+ def fnumber: (String column) -> Integer
146
+ def ftype: (Integer column) -> Integer
147
+ def getvalue: (Integer row, Integer column) -> untyped
148
+ def fields: () -> Array[String]
149
+ def field_values: (String column) -> Array[untyped]
150
+ def column_values: (Integer column) -> Array[untyped]
151
+
152
+ def cmd_status: () -> String?
153
+ def cmd_tuples: () -> Integer
154
+ alias cmdtuples cmd_tuples
155
+
156
+ def oid_value: () -> Integer?
157
+ def res_status: (?Integer status) -> String
158
+ def result_status: () -> Integer
159
+ def error_message: () -> String?
160
+ alias error error_message
161
+
162
+ def clear: () -> void
163
+ def cleared?: () -> bool
164
+ def autoclear?: () -> bool
165
+
166
+ def check: () -> void
167
+ alias check_result check
168
+ end
169
+
170
+ class TextEncoder
171
+ class Boolean
172
+ end
173
+ class Integer
174
+ end
175
+ class Float
176
+ end
177
+ class String
178
+ end
179
+ class Date
180
+ end
181
+ class TimestampWithoutTimeZone
182
+ end
183
+ class TimestampWithTimeZone
184
+ end
185
+ class Bytea
186
+ end
187
+ end
188
+
189
+ class TextDecoder
190
+ class Boolean
191
+ end
192
+ class Integer
193
+ end
194
+ class Float
195
+ end
196
+ class String
197
+ end
198
+ class Date
199
+ end
200
+ class TimestampWithoutTimeZone
201
+ end
202
+ class TimestampWithTimeZone
203
+ end
204
+ class Bytea
205
+ end
206
+ end
207
+
208
+ class BasicTypeRegistry
209
+ def self.alias_type: (Symbol format, String name, String alias_name) -> void
210
+ def self.register_type: (Symbol format, String name, untyped enc, untyped dec) -> void
211
+ end
212
+ end
@@ -0,0 +1,44 @@
1
+ #
2
+ # Rigor-side supplement to the `prism` gem's bundled RBS.
3
+ #
4
+ # The `prism` gem ships its own `sig/` directory (loaded via
5
+ # `Rigor::Environment::DEFAULT_LIBRARIES`), but a handful of
6
+ # surfaces visible to Ruby callers are not declared there because
7
+ # they are bound by the C extension or because the RBS template
8
+ # (`prism/templates/sig/prism.rbs.erb`) omits them.
9
+ #
10
+ # This file re-opens the affected modules / classes to ADD the
11
+ # missing declarations only — never re-declaring anything that
12
+ # the gem's RBS already covers, so the loader does not raise
13
+ # `RBS::DuplicatedDeclarationError`.
14
+ #
15
+ # Surfaces covered:
16
+ # 1. `Prism::ParseResult#attach_comments!`,
17
+ # `Prism::ParseResult#mark_newlines!`
18
+ # — defined in Ruby source (`lib/prism/parse_result.rb`)
19
+ # but not declared in the gem's RBS.
20
+ # 2. `Prism::StringQuery.{local?, constant?, method_name?}`
21
+ # — bound as singleton methods by the C extension; the
22
+ # gem's RBS only declares the matching instance methods.
23
+ #
24
+ module Prism
25
+ class ParseResult < Result
26
+ # Walk the parse result's tree, attaching every comment to
27
+ # its nearest node. Mutates the tree in place; returns the
28
+ # mutated comments array.
29
+ def attach_comments!: () -> Array[comment]
30
+
31
+ # Walk the tree and mark nodes that begin on a new line,
32
+ # loosely emulating CRuby's `:line` tracepoint event.
33
+ def mark_newlines!: () -> ProgramNode
34
+ end
35
+
36
+ class StringQuery
37
+ # C-extension-bound class-method counterparts to the Ruby
38
+ # instance methods. `Prism::StringQuery.local?("foo")` is
39
+ # a shorthand for `Prism::StringQuery.new("foo").local?`.
40
+ def self.local?: (String string) -> bool
41
+ def self.constant?: (String string) -> bool
42
+ def self.method_name?: (String string) -> bool
43
+ end
44
+ end
@@ -0,0 +1,50 @@
1
+ class Redis
2
+ class BaseError < RuntimeError
3
+ end
4
+
5
+ class ProtocolError < BaseError
6
+ def initialize: (untyped reply_type) -> void
7
+ end
8
+
9
+ class CommandError < BaseError
10
+ end
11
+
12
+ class BaseConnectionError < BaseError
13
+ end
14
+
15
+ class CannotConnectError < BaseConnectionError
16
+ end
17
+
18
+ class ConnectionError < BaseConnectionError
19
+ end
20
+
21
+ class TimeoutError < BaseConnectionError
22
+ end
23
+
24
+ class InheritedError < BaseConnectionError
25
+ end
26
+
27
+ class InvalidClientOptionError < BaseError
28
+ end
29
+
30
+ class Cluster
31
+ class OrchestrationCommandNotSupported < BaseError
32
+ def initialize: (untyped command, untyped subcommand) -> void
33
+ end
34
+
35
+ class CommandErrorCollection < BaseError
36
+ attr_reader errors: Hash[String, Redis::CommandError]
37
+ @errors: Hash[String, Redis::CommandError]
38
+
39
+ def initialize: (Hash[String, Redis::CommandError] errors, String error_message) -> void
40
+ end
41
+
42
+ class AmbiguousNodeError < BaseError
43
+ def initialize: (untyped command) -> void
44
+ end
45
+
46
+ class CrossSlotPipeliningError < BaseError
47
+ def initialize: (untyped keys) -> void
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,5 @@
1
+ class Redis
2
+ class Future[out T]
3
+ attr_reader value: T
4
+ end
5
+ end