rigortype 0.0.9 → 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.
- checksums.yaml +4 -4
- data/README.md +45 -2
- data/data/builtins/ruby_core/array.yml +6 -6
- data/data/builtins/ruby_core/hash.yml +1 -1
- data/data/builtins/ruby_core/io.yml +3 -3
- data/data/builtins/ruby_core/numeric.yml +1 -1
- data/data/builtins/ruby_core/pathname.yml +100 -100
- data/data/builtins/ruby_core/proc.yml +1 -1
- data/data/builtins/ruby_core/time.yml +3 -3
- data/lib/rigor/analysis/check_rules.rb +228 -40
- data/lib/rigor/analysis/diagnostic.rb +15 -1
- data/lib/rigor/analysis/runner.rb +269 -7
- data/lib/rigor/builtins/regex_refinement.rb +104 -0
- data/lib/rigor/cache/rbs_class_ancestor_table.rb +1 -1
- data/lib/rigor/cache/rbs_class_type_param_names.rb +1 -1
- data/lib/rigor/cache/rbs_constant_table.rb +2 -2
- data/lib/rigor/cache/rbs_descriptor.rb +2 -0
- data/lib/rigor/cache/rbs_instance_definitions.rb +79 -0
- data/lib/rigor/cache/store.rb +2 -0
- data/lib/rigor/cli/type_of_command.rb +3 -3
- data/lib/rigor/cli/type_scan_command.rb +4 -4
- data/lib/rigor/cli.rb +20 -7
- data/lib/rigor/configuration/severity_profile.rb +109 -0
- data/lib/rigor/configuration.rb +286 -15
- data/lib/rigor/environment/rbs_loader.rb +89 -13
- data/lib/rigor/environment.rb +12 -4
- 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 +51 -0
- data/lib/rigor/inference/block_parameter_binder.rb +15 -0
- data/lib/rigor/inference/expression_typer.rb +87 -6
- data/lib/rigor/inference/method_dispatcher/kernel_dispatch.rb +31 -0
- data/lib/rigor/inference/method_dispatcher/literal_string_folding.rb +136 -9
- data/lib/rigor/inference/method_dispatcher/rbs_dispatch.rb +21 -1
- data/lib/rigor/inference/method_dispatcher/shape_dispatch.rb +68 -2
- data/lib/rigor/inference/method_dispatcher.rb +50 -1
- data/lib/rigor/inference/multi_target_binder.rb +2 -0
- data/lib/rigor/inference/narrowing.rb +246 -127
- data/lib/rigor/inference/scope_indexer.rb +124 -16
- data/lib/rigor/inference/statement_evaluator.rb +406 -37
- data/lib/rigor/plugin/access_denied_error.rb +24 -0
- data/lib/rigor/plugin/base.rb +284 -0
- data/lib/rigor/plugin/fact_store.rb +92 -0
- data/lib/rigor/plugin/io_boundary.rb +102 -0
- data/lib/rigor/plugin/load_error.rb +35 -0
- data/lib/rigor/plugin/loader.rb +307 -0
- data/lib/rigor/plugin/manifest.rb +203 -0
- data/lib/rigor/plugin/registry.rb +50 -0
- data/lib/rigor/plugin/services.rb +77 -0
- data/lib/rigor/plugin/trust_policy.rb +99 -0
- data/lib/rigor/plugin.rb +62 -0
- data/lib/rigor/rbs_extended.rb +57 -9
- data/lib/rigor/reflection.rb +2 -2
- data/lib/rigor/trinary.rb +1 -1
- data/lib/rigor/type/integer_range.rb +6 -2
- data/lib/rigor/version.rb +1 -1
- data/lib/rigor.rb +7 -0
- data/sig/rigor/environment.rbs +10 -3
- 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 +8 -2
- metadata +20 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6a6dc65f5d9bf7eb3cd87b6cd7b276f42a7c5e7c053b001017cb89a3e7c636d7
|
|
4
|
+
data.tar.gz: 7b70c37b3fe532121a0f3d76c67e07570b9a070155c63f6bcec7e612dfd15ea5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 167ca081df2d10e10b529014f53333cd34424a5fb68a88e2ab33a044eba9d72fa89fdf8b6c43e4cd5f3ee69b355f16d4d2762cbb8356e13649b55d4287aeb808
|
|
7
|
+
data.tar.gz: 3cbcffa0ce1d659512c42cfa608357b6d06dbc45b3769ca7719bfad4c021e3f165ff8a77a58fbde024768addd862b2c51170167ef46263aec04fb1656588f6cb
|
data/README.md
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
# Rigor
|
|
2
2
|
|
|
3
3
|
[](https://badge.fury.io/rb/rigortype)
|
|
4
|
-

|
|
4
|
+
[](https://github.com/rigortype/rigor/blob/master/LICENSE)
|
|
5
|
+
[](https://deepwiki.com/rigortype/rigor)
|
|
5
6
|
|
|
6
7
|
**Inference-first static analysis for Ruby.** Add Rigor to your
|
|
7
8
|
Gemfile and run `rigor check` over your code — no annotations,
|
|
@@ -207,6 +208,12 @@ genuinely proved.
|
|
|
207
208
|
|
|
208
209
|
### Where the type model is documented
|
|
209
210
|
|
|
211
|
+
- **End-user handbook** — chapter-by-chapter walkthrough of
|
|
212
|
+
the type model written for Ruby programmers without prior
|
|
213
|
+
static-typing background:
|
|
214
|
+
[`docs/handbook/`](docs/handbook/README.md). Start here if
|
|
215
|
+
you want a guided tour of how Rigor sees your code rather
|
|
216
|
+
than a spec deep-dive.
|
|
210
217
|
- One-page mental model:
|
|
211
218
|
[`docs/types.md`](docs/types.md).
|
|
212
219
|
- Binding spec corpus:
|
|
@@ -366,6 +373,42 @@ The full per-release surface lives in
|
|
|
366
373
|
analyzer guarantees live under
|
|
367
374
|
[`docs/internal-spec/`](docs/internal-spec/).
|
|
368
375
|
|
|
376
|
+
## Plugins (v0.1.0)
|
|
377
|
+
|
|
378
|
+
`v0.1.0` adds an extension API so projects can teach Rigor about
|
|
379
|
+
their own DSLs. Seven worked examples ship under
|
|
380
|
+
[`examples/`](examples/) — each is a fully-shaped plugin gem
|
|
381
|
+
with a runnable demo and an end-to-end integration spec, and
|
|
382
|
+
each spotlights a different facet of the plugin contract:
|
|
383
|
+
|
|
384
|
+
- [`rigor-deprecations`](examples/rigor-deprecations/) —
|
|
385
|
+
smallest possible plugin (~80 lines); config-driven rules.
|
|
386
|
+
- [`rigor-lisp-eval`](examples/rigor-lisp-eval/) — typing literal
|
|
387
|
+
AST arguments at a method call.
|
|
388
|
+
- [`rigor-statesman`](examples/rigor-statesman/) — two-pass DSL
|
|
389
|
+
analysis (collect declarations, then validate references).
|
|
390
|
+
- [`rigor-pattern`](examples/rigor-pattern/) — plugin →
|
|
391
|
+
analyzer collaboration via `Scope#type_of` and the
|
|
392
|
+
literal-string carrier.
|
|
393
|
+
- [`rigor-units`](examples/rigor-units/) — local-variable flow
|
|
394
|
+
tracking through arithmetic.
|
|
395
|
+
- [`rigor-routes`](examples/rigor-routes/) — `Plugin::IoBoundary`
|
|
396
|
+
reads under `TrustPolicy` plus cache producers (slice 2 +
|
|
397
|
+
slice 6).
|
|
398
|
+
- [`rigor-activerecord`](examples/rigor-activerecord/) —
|
|
399
|
+
validates `Model.find` / `.find_by` / `.where` against
|
|
400
|
+
`db/schema.rb` and discovered AR model classes; combines
|
|
401
|
+
DSL interpretation, multi-file `IoBoundary`, and chained
|
|
402
|
+
cache producers — the most architecturally complete example.
|
|
403
|
+
|
|
404
|
+
[`examples/README.md`](examples/README.md) is the plugin
|
|
405
|
+
authoring landing page — comparison table, recommended reading
|
|
406
|
+
order, and the architectural map of which surface each example
|
|
407
|
+
exercises. The binding contract for the plugin API lives in
|
|
408
|
+
[`docs/adr/2-extension-api.md`](docs/adr/2-extension-api.md)
|
|
409
|
+
and the slice-by-slice normative specs under
|
|
410
|
+
[`docs/internal-spec/plugin*.md`](docs/internal-spec/).
|
|
411
|
+
|
|
369
412
|
## Configuration
|
|
370
413
|
|
|
371
414
|
`rigor init` writes a starter `.rigor.yml`:
|
|
@@ -421,4 +464,4 @@ skill documentation contributors should know about.
|
|
|
421
464
|
|
|
422
465
|
Mozilla Public License Version 2.0. See [`LICENSE`](LICENSE).
|
|
423
466
|
</content>
|
|
424
|
-
</invoke>
|
|
467
|
+
</invoke>
|
|
@@ -1361,7 +1361,7 @@ classes:
|
|
|
1361
1361
|
body_kind: composed
|
|
1362
1362
|
cexpr_target:
|
|
1363
1363
|
prelude_at: references/ruby/array.rb:22
|
|
1364
|
-
purity:
|
|
1364
|
+
purity: dispatch
|
|
1365
1365
|
arity: -1
|
|
1366
1366
|
cfunc:
|
|
1367
1367
|
defined_at: references/ruby/array.rb:22
|
|
@@ -1374,7 +1374,7 @@ classes:
|
|
|
1374
1374
|
body_kind: composed
|
|
1375
1375
|
cexpr_target:
|
|
1376
1376
|
prelude_at: references/ruby/array.rb:45
|
|
1377
|
-
purity:
|
|
1377
|
+
purity: dispatch
|
|
1378
1378
|
arity: -1
|
|
1379
1379
|
cfunc:
|
|
1380
1380
|
defined_at: references/ruby/array.rb:45
|
|
@@ -1387,7 +1387,7 @@ classes:
|
|
|
1387
1387
|
body_kind: composed
|
|
1388
1388
|
cexpr_target:
|
|
1389
1389
|
prelude_at: references/ruby/array.rb:95
|
|
1390
|
-
purity:
|
|
1390
|
+
purity: dispatch
|
|
1391
1391
|
arity: -1
|
|
1392
1392
|
cfunc:
|
|
1393
1393
|
defined_at: references/ruby/array.rb:95
|
|
@@ -1401,7 +1401,7 @@ classes:
|
|
|
1401
1401
|
body_kind: composed
|
|
1402
1402
|
cexpr_target:
|
|
1403
1403
|
prelude_at: references/ruby/array.rb:129
|
|
1404
|
-
purity:
|
|
1404
|
+
purity: dispatch
|
|
1405
1405
|
arity: -1
|
|
1406
1406
|
cfunc:
|
|
1407
1407
|
defined_at: references/ruby/array.rb:129
|
|
@@ -1415,7 +1415,7 @@ classes:
|
|
|
1415
1415
|
body_kind: composed
|
|
1416
1416
|
cexpr_target:
|
|
1417
1417
|
prelude_at: references/ruby/array.rb:166
|
|
1418
|
-
purity:
|
|
1418
|
+
purity: dispatch
|
|
1419
1419
|
arity: -1
|
|
1420
1420
|
cfunc:
|
|
1421
1421
|
defined_at: references/ruby/array.rb:166
|
|
@@ -1429,7 +1429,7 @@ classes:
|
|
|
1429
1429
|
body_kind: composed
|
|
1430
1430
|
cexpr_target:
|
|
1431
1431
|
prelude_at: references/ruby/array.rb:210
|
|
1432
|
-
purity:
|
|
1432
|
+
purity: dispatch
|
|
1433
1433
|
arity: -1
|
|
1434
1434
|
cfunc:
|
|
1435
1435
|
defined_at: references/ruby/array.rb:210
|
|
@@ -891,7 +891,7 @@ classes:
|
|
|
891
891
|
body_kind: composed
|
|
892
892
|
cexpr_target:
|
|
893
893
|
prelude_at: references/ruby/io.rb:62
|
|
894
|
-
purity:
|
|
894
|
+
purity: dispatch
|
|
895
895
|
arity: -2
|
|
896
896
|
cfunc:
|
|
897
897
|
defined_at: references/ruby/io.rb:62
|
|
@@ -906,7 +906,7 @@ classes:
|
|
|
906
906
|
body_kind: composed
|
|
907
907
|
cexpr_target:
|
|
908
908
|
prelude_at: references/ruby/io.rb:120
|
|
909
|
-
purity:
|
|
909
|
+
purity: dispatch
|
|
910
910
|
arity: -2
|
|
911
911
|
cfunc:
|
|
912
912
|
defined_at: references/ruby/io.rb:120
|
|
@@ -920,7 +920,7 @@ classes:
|
|
|
920
920
|
body_kind: composed
|
|
921
921
|
cexpr_target:
|
|
922
922
|
prelude_at: references/ruby/io.rb:133
|
|
923
|
-
purity:
|
|
923
|
+
purity: dispatch
|
|
924
924
|
arity: -1
|
|
925
925
|
cfunc:
|
|
926
926
|
defined_at: references/ruby/io.rb:133
|