rigortype 0.0.8 → 0.1.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.
- checksums.yaml +4 -4
- data/README.md +234 -22
- data/data/builtins/ruby_core/encoding.yml +210 -0
- data/data/builtins/ruby_core/exception.yml +641 -0
- data/data/builtins/ruby_core/numeric.yml +3 -2
- data/data/builtins/ruby_core/proc.yml +731 -0
- data/data/builtins/ruby_core/random.yml +166 -0
- data/data/builtins/ruby_core/re.yml +689 -0
- data/data/builtins/ruby_core/struct.yml +449 -0
- data/lib/rigor/analysis/check_rules.rb +228 -40
- data/lib/rigor/analysis/diagnostic.rb +15 -1
- data/lib/rigor/analysis/runner.rb +199 -4
- data/lib/rigor/builtins/imported_refinements.rb +6 -1
- data/lib/rigor/cache/rbs_class_ancestor_table.rb +63 -0
- data/lib/rigor/cache/rbs_class_type_param_names.rb +60 -0
- data/lib/rigor/cache/rbs_constant_table.rb +15 -51
- data/lib/rigor/cache/rbs_descriptor.rb +55 -0
- data/lib/rigor/cache/rbs_environment.rb +52 -0
- data/lib/rigor/cache/rbs_environment_marshal_patch.rb +40 -0
- data/lib/rigor/cache/rbs_instance_definitions.rb +79 -0
- data/lib/rigor/cache/rbs_known_class_names.rb +43 -0
- data/lib/rigor/cache/store.rb +81 -15
- data/lib/rigor/cli.rb +45 -7
- data/lib/rigor/configuration/severity_profile.rb +109 -0
- data/lib/rigor/configuration.rb +110 -6
- data/lib/rigor/environment/rbs_hierarchy.rb +18 -5
- data/lib/rigor/environment/rbs_loader.rb +220 -32
- data/lib/rigor/environment.rb +11 -2
- data/lib/rigor/flow_contribution/conflict.rb +81 -0
- data/lib/rigor/flow_contribution/element.rb +53 -0
- data/lib/rigor/flow_contribution/fact.rb +88 -0
- data/lib/rigor/flow_contribution/merge_result.rb +67 -0
- data/lib/rigor/flow_contribution/merger.rb +275 -0
- data/lib/rigor/flow_contribution.rb +179 -0
- data/lib/rigor/inference/block_parameter_binder.rb +15 -0
- data/lib/rigor/inference/builtins/encoding_catalog.rb +67 -0
- data/lib/rigor/inference/builtins/exception_catalog.rb +92 -0
- data/lib/rigor/inference/builtins/proc_catalog.rb +122 -0
- data/lib/rigor/inference/builtins/random_catalog.rb +58 -0
- data/lib/rigor/inference/builtins/re_catalog.rb +81 -0
- data/lib/rigor/inference/builtins/struct_catalog.rb +55 -0
- data/lib/rigor/inference/expression_typer.rb +110 -6
- data/lib/rigor/inference/method_dispatcher/constant_folding.rb +16 -1
- data/lib/rigor/inference/method_dispatcher/literal_string_folding.rb +173 -0
- data/lib/rigor/inference/method_dispatcher/rbs_dispatch.rb +21 -1
- data/lib/rigor/inference/method_dispatcher.rb +2 -0
- data/lib/rigor/inference/multi_target_binder.rb +2 -0
- data/lib/rigor/inference/narrowing.rb +134 -144
- data/lib/rigor/inference/scope_indexer.rb +75 -1
- data/lib/rigor/inference/statement_evaluator.rb +380 -40
- data/lib/rigor/plugin/access_denied_error.rb +24 -0
- data/lib/rigor/plugin/base.rb +241 -0
- data/lib/rigor/plugin/io_boundary.rb +102 -0
- data/lib/rigor/plugin/load_error.rb +23 -0
- data/lib/rigor/plugin/loader.rb +191 -0
- data/lib/rigor/plugin/manifest.rb +134 -0
- data/lib/rigor/plugin/registry.rb +50 -0
- data/lib/rigor/plugin/services.rb +65 -0
- data/lib/rigor/plugin/trust_policy.rb +99 -0
- data/lib/rigor/plugin.rb +61 -0
- data/lib/rigor/rbs_extended.rb +103 -0
- data/lib/rigor/reflection.rb +2 -2
- data/lib/rigor/type/combinator.rb +72 -0
- data/lib/rigor/type/refined.rb +50 -2
- data/lib/rigor/version.rb +1 -1
- data/lib/rigor.rb +13 -0
- data/sig/rigor/environment.rbs +7 -1
- data/sig/rigor/inference.rbs +1 -0
- data/sig/rigor/rbs_extended.rbs +2 -0
- data/sig/rigor/scope.rbs +1 -0
- data/sig/rigor/type.rbs +7 -0
- data/sig/rigor.rbs +3 -1
- metadata +38 -1
data/sig/rigor/scope.rbs
CHANGED
data/sig/rigor/type.rbs
CHANGED
|
@@ -244,9 +244,16 @@ module Rigor
|
|
|
244
244
|
def self?.decimal_int_string: () -> Refined
|
|
245
245
|
def self?.octal_int_string: () -> Refined
|
|
246
246
|
def self?.hex_int_string: () -> Refined
|
|
247
|
+
def self?.literal_string: () -> Refined
|
|
248
|
+
def self?.non_lowercase_string: () -> Refined
|
|
249
|
+
def self?.non_uppercase_string: () -> Refined
|
|
250
|
+
def self?.non_numeric_string: () -> Refined
|
|
251
|
+
def self?.literal_string_carrier?: (Type::t refined) -> bool
|
|
252
|
+
def self?.literal_string_compatible?: (Type::t type) -> bool
|
|
247
253
|
def self?.intersection: (*Type::t members) -> Type::t
|
|
248
254
|
def self?.non_empty_lowercase_string: () -> Type::t
|
|
249
255
|
def self?.non_empty_uppercase_string: () -> Type::t
|
|
256
|
+
def self?.non_empty_literal_string: () -> Type::t
|
|
250
257
|
def self?.integer_range: ((Integer | Symbol) min, (Integer | Symbol) max) -> IntegerRange
|
|
251
258
|
def self?.positive_int: () -> IntegerRange
|
|
252
259
|
def self?.non_negative_int: () -> IntegerRange
|
data/sig/rigor.rbs
CHANGED
|
@@ -63,7 +63,9 @@ module Rigor
|
|
|
63
63
|
|
|
64
64
|
class Runner
|
|
65
65
|
RUBY_GLOB: String
|
|
66
|
-
|
|
66
|
+
DEFAULT_CACHE_ROOT: String
|
|
67
|
+
attr_reader cache_store: Rigor::Cache::Store?
|
|
68
|
+
def initialize: (configuration: Configuration, ?explain: bool, ?cache_store: Rigor::Cache::Store?) -> void
|
|
67
69
|
def run: (?Array[String] paths) -> Result
|
|
68
70
|
end
|
|
69
71
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rigortype
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0
|
|
4
|
+
version: 0.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Rigor contributors
|
|
@@ -164,16 +164,22 @@ files:
|
|
|
164
164
|
- data/builtins/ruby_core/comparable.yml
|
|
165
165
|
- data/builtins/ruby_core/complex.yml
|
|
166
166
|
- data/builtins/ruby_core/date.yml
|
|
167
|
+
- data/builtins/ruby_core/encoding.yml
|
|
167
168
|
- data/builtins/ruby_core/enumerable.yml
|
|
169
|
+
- data/builtins/ruby_core/exception.yml
|
|
168
170
|
- data/builtins/ruby_core/file.yml
|
|
169
171
|
- data/builtins/ruby_core/hash.yml
|
|
170
172
|
- data/builtins/ruby_core/io.yml
|
|
171
173
|
- data/builtins/ruby_core/numeric.yml
|
|
172
174
|
- data/builtins/ruby_core/pathname.yml
|
|
175
|
+
- data/builtins/ruby_core/proc.yml
|
|
176
|
+
- data/builtins/ruby_core/random.yml
|
|
173
177
|
- data/builtins/ruby_core/range.yml
|
|
174
178
|
- data/builtins/ruby_core/rational.yml
|
|
179
|
+
- data/builtins/ruby_core/re.yml
|
|
175
180
|
- data/builtins/ruby_core/set.yml
|
|
176
181
|
- data/builtins/ruby_core/string.yml
|
|
182
|
+
- data/builtins/ruby_core/struct.yml
|
|
177
183
|
- data/builtins/ruby_core/time.yml
|
|
178
184
|
- exe/rigor
|
|
179
185
|
- lib/rigor.rb
|
|
@@ -186,7 +192,14 @@ files:
|
|
|
186
192
|
- lib/rigor/ast/type_node.rb
|
|
187
193
|
- lib/rigor/builtins/imported_refinements.rb
|
|
188
194
|
- lib/rigor/cache/descriptor.rb
|
|
195
|
+
- lib/rigor/cache/rbs_class_ancestor_table.rb
|
|
196
|
+
- lib/rigor/cache/rbs_class_type_param_names.rb
|
|
189
197
|
- lib/rigor/cache/rbs_constant_table.rb
|
|
198
|
+
- lib/rigor/cache/rbs_descriptor.rb
|
|
199
|
+
- lib/rigor/cache/rbs_environment.rb
|
|
200
|
+
- lib/rigor/cache/rbs_environment_marshal_patch.rb
|
|
201
|
+
- lib/rigor/cache/rbs_instance_definitions.rb
|
|
202
|
+
- lib/rigor/cache/rbs_known_class_names.rb
|
|
190
203
|
- lib/rigor/cache/store.rb
|
|
191
204
|
- lib/rigor/cli.rb
|
|
192
205
|
- lib/rigor/cli/type_of_command.rb
|
|
@@ -195,25 +208,38 @@ files:
|
|
|
195
208
|
- lib/rigor/cli/type_scan_renderer.rb
|
|
196
209
|
- lib/rigor/cli/type_scan_report.rb
|
|
197
210
|
- lib/rigor/configuration.rb
|
|
211
|
+
- lib/rigor/configuration/severity_profile.rb
|
|
198
212
|
- lib/rigor/environment.rb
|
|
199
213
|
- lib/rigor/environment/class_registry.rb
|
|
200
214
|
- lib/rigor/environment/rbs_hierarchy.rb
|
|
201
215
|
- lib/rigor/environment/rbs_loader.rb
|
|
216
|
+
- lib/rigor/flow_contribution.rb
|
|
217
|
+
- lib/rigor/flow_contribution/conflict.rb
|
|
218
|
+
- lib/rigor/flow_contribution/element.rb
|
|
219
|
+
- lib/rigor/flow_contribution/fact.rb
|
|
220
|
+
- lib/rigor/flow_contribution/merge_result.rb
|
|
221
|
+
- lib/rigor/flow_contribution/merger.rb
|
|
202
222
|
- lib/rigor/inference/acceptance.rb
|
|
203
223
|
- lib/rigor/inference/block_parameter_binder.rb
|
|
204
224
|
- lib/rigor/inference/builtins/array_catalog.rb
|
|
205
225
|
- lib/rigor/inference/builtins/comparable_catalog.rb
|
|
206
226
|
- lib/rigor/inference/builtins/complex_catalog.rb
|
|
207
227
|
- lib/rigor/inference/builtins/date_catalog.rb
|
|
228
|
+
- lib/rigor/inference/builtins/encoding_catalog.rb
|
|
208
229
|
- lib/rigor/inference/builtins/enumerable_catalog.rb
|
|
230
|
+
- lib/rigor/inference/builtins/exception_catalog.rb
|
|
209
231
|
- lib/rigor/inference/builtins/hash_catalog.rb
|
|
210
232
|
- lib/rigor/inference/builtins/method_catalog.rb
|
|
211
233
|
- lib/rigor/inference/builtins/numeric_catalog.rb
|
|
212
234
|
- lib/rigor/inference/builtins/pathname_catalog.rb
|
|
235
|
+
- lib/rigor/inference/builtins/proc_catalog.rb
|
|
236
|
+
- lib/rigor/inference/builtins/random_catalog.rb
|
|
213
237
|
- lib/rigor/inference/builtins/range_catalog.rb
|
|
214
238
|
- lib/rigor/inference/builtins/rational_catalog.rb
|
|
239
|
+
- lib/rigor/inference/builtins/re_catalog.rb
|
|
215
240
|
- lib/rigor/inference/builtins/set_catalog.rb
|
|
216
241
|
- lib/rigor/inference/builtins/string_catalog.rb
|
|
242
|
+
- lib/rigor/inference/builtins/struct_catalog.rb
|
|
217
243
|
- lib/rigor/inference/builtins/time_catalog.rb
|
|
218
244
|
- lib/rigor/inference/closure_escape_analyzer.rb
|
|
219
245
|
- lib/rigor/inference/coverage_scanner.rb
|
|
@@ -226,6 +252,7 @@ files:
|
|
|
226
252
|
- lib/rigor/inference/method_dispatcher/file_folding.rb
|
|
227
253
|
- lib/rigor/inference/method_dispatcher/iterator_dispatch.rb
|
|
228
254
|
- lib/rigor/inference/method_dispatcher/kernel_dispatch.rb
|
|
255
|
+
- lib/rigor/inference/method_dispatcher/literal_string_folding.rb
|
|
229
256
|
- lib/rigor/inference/method_dispatcher/overload_selector.rb
|
|
230
257
|
- lib/rigor/inference/method_dispatcher/rbs_dispatch.rb
|
|
231
258
|
- lib/rigor/inference/method_dispatcher/shape_dispatch.rb
|
|
@@ -235,6 +262,16 @@ files:
|
|
|
235
262
|
- lib/rigor/inference/rbs_type_translator.rb
|
|
236
263
|
- lib/rigor/inference/scope_indexer.rb
|
|
237
264
|
- lib/rigor/inference/statement_evaluator.rb
|
|
265
|
+
- lib/rigor/plugin.rb
|
|
266
|
+
- lib/rigor/plugin/access_denied_error.rb
|
|
267
|
+
- lib/rigor/plugin/base.rb
|
|
268
|
+
- lib/rigor/plugin/io_boundary.rb
|
|
269
|
+
- lib/rigor/plugin/load_error.rb
|
|
270
|
+
- lib/rigor/plugin/loader.rb
|
|
271
|
+
- lib/rigor/plugin/manifest.rb
|
|
272
|
+
- lib/rigor/plugin/registry.rb
|
|
273
|
+
- lib/rigor/plugin/services.rb
|
|
274
|
+
- lib/rigor/plugin/trust_policy.rb
|
|
238
275
|
- lib/rigor/rbs_extended.rb
|
|
239
276
|
- lib/rigor/reflection.rb
|
|
240
277
|
- lib/rigor/scope.rb
|