rigortype 0.2.0 → 0.2.2
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/README.md +82 -20
- data/data/core_overlay/numeric.rbs +33 -0
- data/data/core_overlay/pathname.rbs +25 -0
- data/data/core_overlay/string_scanner.rbs +28 -0
- data/data/gem_overlay/activesupport/core_ext.rbs +473 -0
- data/data/vendored_gem_sigs/ast/ast.rbs +130 -0
- data/data/vendored_gem_sigs/bcrypt/bcrypt.rbs +47 -0
- data/data/vendored_gem_sigs/bundler/bundler.rbs +238 -0
- data/data/vendored_gem_sigs/cgi/cgi_extras.rbs +34 -0
- data/data/vendored_gem_sigs/did_you_mean/did_you_mean_extras.rbs +34 -0
- data/data/vendored_gem_sigs/idn-ruby/idn.rbs +54 -0
- data/data/vendored_gem_sigs/mysql2/client.rbs +55 -0
- data/data/vendored_gem_sigs/mysql2/error.rbs +5 -0
- data/data/vendored_gem_sigs/mysql2/result.rbs +31 -0
- data/data/vendored_gem_sigs/mysql2/statement.rbs +5 -0
- data/data/vendored_gem_sigs/nokogiri/nokogiri.rbs +2332 -0
- data/data/vendored_gem_sigs/nokogiri/nokogiri_html5.rbs +47 -0
- data/data/vendored_gem_sigs/pg/pg.rbs +212 -0
- data/data/vendored_gem_sigs/prism/prism_supplement.rbs +44 -0
- data/data/vendored_gem_sigs/redis/errors.rbs +50 -0
- data/data/vendored_gem_sigs/redis/future.rbs +5 -0
- data/data/vendored_gem_sigs/redis/redis.rbs +348 -0
- data/data/vendored_gem_sigs/redis/redis_extras.rbs +130 -0
- data/data/vendored_gem_sigs/rubygems/rubygems_extras.rbs +226 -0
- data/docs/handbook/01-getting-started.md +311 -0
- data/docs/handbook/02-everyday-types.md +337 -0
- data/docs/handbook/03-narrowing.md +359 -0
- data/docs/handbook/04-tuples-and-shapes.md +321 -0
- data/docs/handbook/05-methods-and-blocks.md +339 -0
- data/docs/handbook/06-classes.md +305 -0
- data/docs/handbook/07-rbs-and-extended.md +427 -0
- data/docs/handbook/08-understanding-errors.md +373 -0
- data/docs/handbook/09-plugins.md +241 -0
- data/docs/handbook/10-sorbet.md +347 -0
- data/docs/handbook/11-sig-gen.md +312 -0
- data/docs/handbook/12-lightweight-hkt.md +333 -0
- data/docs/handbook/README.md +275 -0
- data/docs/handbook/appendix-elixir.md +370 -0
- data/docs/handbook/appendix-go.md +399 -0
- data/docs/handbook/appendix-java-csharp.md +470 -0
- data/docs/handbook/appendix-liskov.md +580 -0
- data/docs/handbook/appendix-mypy.md +370 -0
- data/docs/handbook/appendix-phpstan.md +338 -0
- data/docs/handbook/appendix-protocols-and-structural-typing.md +292 -0
- data/docs/handbook/appendix-rust.md +446 -0
- data/docs/handbook/appendix-steep.md +336 -0
- data/docs/handbook/appendix-type-theory.md +1662 -0
- data/docs/handbook/appendix-typeprof.md +416 -0
- data/docs/handbook/appendix-typescript.md +332 -0
- data/docs/install.md +189 -0
- data/docs/llms.txt +72 -0
- data/docs/manual/01-installation.md +342 -0
- data/docs/manual/02-cli-reference.md +557 -0
- data/docs/manual/03-configuration.md +152 -0
- data/docs/manual/04-diagnostics.md +206 -0
- data/docs/manual/05-inspecting-types.md +109 -0
- data/docs/manual/06-baseline.md +104 -0
- data/docs/manual/07-plugins.md +92 -0
- data/docs/manual/08-skills.md +143 -0
- data/docs/manual/09-editor-integration.md +245 -0
- data/docs/manual/10-mcp-server.md +532 -0
- data/docs/manual/11-ci.md +274 -0
- data/docs/manual/12-caching.md +116 -0
- data/docs/manual/13-troubleshooting.md +120 -0
- data/docs/manual/14-rails-quickstart.md +332 -0
- data/docs/manual/15-type-protection-coverage.md +204 -0
- data/docs/manual/16-rbs-extended-annotations.md +190 -0
- data/docs/manual/17-driving-improvement.md +160 -0
- data/docs/manual/README.md +87 -0
- data/docs/manual/ci-templates/README.md +58 -0
- data/docs/manual/plugins/README.md +86 -0
- data/docs/manual/plugins/rigor-actioncable.md +78 -0
- data/docs/manual/plugins/rigor-actionmailer.md +74 -0
- data/docs/manual/plugins/rigor-actionpack.md +80 -0
- data/docs/manual/plugins/rigor-activejob.md +58 -0
- data/docs/manual/plugins/rigor-activerecord.md +102 -0
- data/docs/manual/plugins/rigor-activestorage.md +74 -0
- data/docs/manual/plugins/rigor-activesupport-core-ext.md +86 -0
- data/docs/manual/plugins/rigor-devise.md +70 -0
- data/docs/manual/plugins/rigor-dry-schema.md +56 -0
- data/docs/manual/plugins/rigor-dry-struct.md +60 -0
- data/docs/manual/plugins/rigor-dry-types.md +59 -0
- data/docs/manual/plugins/rigor-dry-validation.md +62 -0
- data/docs/manual/plugins/rigor-factorybot.md +76 -0
- data/docs/manual/plugins/rigor-graphql.md +89 -0
- data/docs/manual/plugins/rigor-hanami.md +83 -0
- data/docs/manual/plugins/rigor-mangrove.md +73 -0
- data/docs/manual/plugins/rigor-minitest.md +86 -0
- data/docs/manual/plugins/rigor-pundit.md +72 -0
- data/docs/manual/plugins/rigor-rails-i18n.md +92 -0
- data/docs/manual/plugins/rigor-rails-routes.md +94 -0
- data/docs/manual/plugins/rigor-rails.md +44 -0
- data/docs/manual/plugins/rigor-rbs-inline.md +83 -0
- data/docs/manual/plugins/rigor-rspec-rails.md +72 -0
- data/docs/manual/plugins/rigor-rspec.md +86 -0
- data/docs/manual/plugins/rigor-shoulda-matchers.md +78 -0
- data/docs/manual/plugins/rigor-sidekiq.md +78 -0
- data/docs/manual/plugins/rigor-sinatra.md +61 -0
- data/docs/manual/plugins/rigor-sorbet.md +63 -0
- data/docs/manual/plugins/rigor-statesman.md +75 -0
- data/docs/manual/plugins/rigor-typescript-utility-types.md +71 -0
- data/exe/rigor +1 -1
- data/lib/rigor/analysis/incremental_session.rb +4 -2
- data/lib/rigor/analysis/run_stats.rb +13 -1
- data/lib/rigor/analysis/runner.rb +54 -12
- data/lib/rigor/cli/check_command.rb +26 -3
- data/lib/rigor/cli/coverage_command.rb +67 -92
- data/lib/rigor/cli/coverage_mutation.rb +149 -0
- data/lib/rigor/cli/docs_command.rb +248 -0
- data/lib/rigor/cli/fused_protection_renderer.rb +67 -0
- data/lib/rigor/cli/fused_protection_report.rb +76 -0
- data/lib/rigor/cli/skill_command.rb +103 -41
- data/lib/rigor/cli/skill_describe.rb +346 -0
- data/lib/rigor/cli.rb +25 -3
- data/lib/rigor/config_audit.rb +152 -0
- data/lib/rigor/configuration.rb +12 -0
- data/lib/rigor/environment/rbs_loader.rb +27 -0
- data/lib/rigor/environment.rb +49 -1
- data/lib/rigor/inference/method_dispatcher/constant_folding.rb +140 -38
- data/lib/rigor/inference/method_dispatcher/shape_dispatch.rb +37 -6
- data/lib/rigor/inference/scope_indexer.rb +87 -89
- data/lib/rigor/inference/statement_evaluator.rb +27 -0
- data/lib/rigor/plugin/isolation.rb +5 -5
- data/lib/rigor/plugin/loader.rb +4 -2
- data/lib/rigor/protection/diagnostic_oracle.rb +51 -0
- data/lib/rigor/protection/mutation_scanner.rb +98 -38
- data/lib/rigor/protection/mutator.rb +21 -0
- data/lib/rigor/protection/test_suite_oracle.rb +68 -0
- data/lib/rigor/signature_path_audit.rb +92 -0
- data/lib/rigor/version.rb +1 -1
- data/skills/rigor-ask/SKILL.md +172 -0
- data/skills/rigor-doctor/SKILL.md +87 -0
- data/skills/rigor-editor-setup/SKILL.md +114 -0
- data/skills/rigor-mcp-setup/SKILL.md +117 -0
- data/skills/rigor-monkeypatch-resolve/SKILL.md +79 -0
- data/skills/rigor-next-steps/SKILL.md +113 -0
- data/skills/rigor-plugin-tune/SKILL.md +79 -0
- data/skills/rigor-protection-uplift/SKILL.md +133 -0
- data/skills/rigor-rbs-setup/SKILL.md +128 -0
- data/skills/rigor-upgrade/SKILL.md +79 -0
- metadata +120 -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
|