rigortype 0.2.8 → 0.3.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 +2 -2
- data/data/core_overlay/csv.rbs +28 -0
- data/data/core_overlay/psych.rbs +22 -0
- data/docs/handbook/01-getting-started.md +9 -1
- data/docs/handbook/02-everyday-types.md +4 -1
- data/docs/handbook/03-narrowing.md +2 -1
- data/docs/handbook/04-tuples-and-shapes.md +7 -3
- data/docs/handbook/06-classes.md +18 -9
- data/docs/handbook/08-understanding-errors.md +4 -3
- data/docs/handbook/11-sig-gen.md +11 -1
- data/docs/handbook/appendix-mypy.md +4 -3
- data/docs/install.md +14 -6
- data/docs/manual/01-installation.md +99 -4
- data/docs/manual/02-cli-reference.md +65 -19
- data/docs/manual/03-configuration.md +34 -2
- data/docs/manual/04-diagnostics.md +23 -0
- data/docs/manual/07-plugins.md +5 -5
- data/docs/manual/09-editor-integration.md +4 -4
- data/docs/manual/11-ci.md +51 -0
- data/docs/manual/12-caching.md +65 -0
- data/docs/manual/14-rails-quickstart.md +4 -2
- data/docs/manual/15-type-protection-coverage.md +21 -0
- data/docs/manual/plugins/rigor-actionpack.md +1 -1
- data/docs/manual/plugins/rigor-activerecord.md +12 -5
- data/docs/manual/plugins/rigor-rails-routes.md +11 -0
- data/lib/rigor/analysis/check_rules/always_truthy_condition_collector.rb +9 -1
- data/lib/rigor/analysis/check_rules/dead_assignment_collector.rb +5 -3
- data/lib/rigor/analysis/check_rules/duplicate_hash_key_collector.rb +128 -0
- data/lib/rigor/analysis/check_rules/inferred_param_guard.rb +60 -0
- data/lib/rigor/analysis/check_rules/ivar_write_collector.rb +3 -2
- data/lib/rigor/analysis/check_rules/return_in_ensure_collector.rb +117 -0
- data/lib/rigor/analysis/check_rules/rule_ids.rb +125 -0
- data/lib/rigor/analysis/check_rules/rule_walk.rb +2 -1
- data/lib/rigor/analysis/check_rules/self_closedness_scanner.rb +2 -1
- data/lib/rigor/analysis/check_rules/shadowed_rescue_collector.rb +283 -0
- data/lib/rigor/analysis/check_rules/unreachable_clause_collector.rb +10 -1
- data/lib/rigor/analysis/check_rules/void_value_use_collector.rb +93 -0
- data/lib/rigor/analysis/check_rules.rb +557 -95
- data/lib/rigor/analysis/dependency_recorder.rb +93 -9
- data/lib/rigor/analysis/dependency_source_inference/walker.rb +2 -1
- data/lib/rigor/analysis/incremental_session.rb +456 -51
- data/lib/rigor/analysis/path_expansion.rb +42 -0
- data/lib/rigor/analysis/plugin_fact_fingerprint.rb +188 -0
- data/lib/rigor/analysis/rule_catalog.rb +226 -1
- data/lib/rigor/analysis/run_cache_key.rb +68 -0
- data/lib/rigor/analysis/run_cache_probe.rb +72 -0
- data/lib/rigor/analysis/runner/diagnostic_aggregator.rb +181 -28
- data/lib/rigor/analysis/runner/pool_coordinator.rb +77 -15
- data/lib/rigor/analysis/runner/project_pre_passes.rb +95 -49
- data/lib/rigor/analysis/runner/run_snapshots.rb +9 -2
- data/lib/rigor/analysis/runner.rb +343 -68
- data/lib/rigor/analysis/severity_stamp.rb +43 -0
- data/lib/rigor/analysis/worker_session.rb +30 -2
- data/lib/rigor/bleeding_edge.rb +37 -8
- data/lib/rigor/builtins/regex_refinement.rb +36 -1
- data/lib/rigor/cache/descriptor.rb +88 -28
- data/lib/rigor/cache/file_digest.rb +158 -0
- data/lib/rigor/cache/incremental_snapshot.rb +41 -5
- data/lib/rigor/cache/rbs_descriptor.rb +56 -10
- data/lib/rigor/cache/store.rb +207 -60
- data/lib/rigor/ci_detector.rb +90 -0
- data/lib/rigor/cli/annotate_command.rb +15 -9
- data/lib/rigor/cli/baseline_command.rb +4 -1
- data/lib/rigor/cli/check_command.rb +212 -27
- data/lib/rigor/cli/coverage_command.rb +56 -30
- data/lib/rigor/cli/diagnostic_formats.rb +4 -1
- data/lib/rigor/cli/docs_command.rb +0 -30
- data/lib/rigor/cli/doctor_command.rb +163 -23
- data/lib/rigor/cli/lsp_command.rb +5 -0
- data/lib/rigor/cli/mcp_command.rb +5 -0
- data/lib/rigor/cli/plugins_command.rb +36 -6
- data/lib/rigor/cli/plugins_renderer.rb +44 -12
- data/lib/rigor/cli/probe_environment.rb +85 -0
- data/lib/rigor/cli/protection_fork_scan.rb +55 -0
- data/lib/rigor/cli/protection_report.rb +7 -1
- data/lib/rigor/cli/sig_gen_command.rb +36 -9
- data/lib/rigor/cli/skill_command.rb +1 -32
- data/lib/rigor/cli/trace_command.rb +5 -6
- data/lib/rigor/cli/type_of_command.rb +9 -8
- data/lib/rigor/cli/type_scan_command.rb +8 -8
- data/lib/rigor/cli.rb +15 -4
- data/lib/rigor/config_audit.rb +48 -2
- data/lib/rigor/configuration/severity_profile.rb +31 -0
- data/lib/rigor/configuration.rb +156 -8
- data/lib/rigor/environment/default_libraries.rb +35 -0
- data/lib/rigor/environment/missing_gem_constant_index.rb +128 -0
- data/lib/rigor/environment/rbs_loader.rb +164 -5
- data/lib/rigor/environment.rb +71 -43
- data/lib/rigor/inference/budget_trace.rb +77 -2
- data/lib/rigor/inference/closure_escape_analyzer.rb +14 -1
- data/lib/rigor/inference/def_handle.rb +23 -0
- data/lib/rigor/inference/def_node_resolver.rb +90 -0
- data/lib/rigor/inference/def_return_typer.rb +2 -1
- data/lib/rigor/inference/expression_typer.rb +379 -113
- data/lib/rigor/inference/fork_map.rb +87 -0
- data/lib/rigor/inference/method_dispatcher/data_folding.rb +30 -5
- data/lib/rigor/inference/method_dispatcher/kernel_dispatch.rb +200 -0
- data/lib/rigor/inference/method_dispatcher/literal_string_folding.rb +22 -16
- data/lib/rigor/inference/method_dispatcher/member_shape_projection.rb +33 -0
- data/lib/rigor/inference/method_dispatcher/overload_selector.rb +11 -0
- data/lib/rigor/inference/method_dispatcher/rbs_dispatch.rb +42 -9
- data/lib/rigor/inference/method_dispatcher/receiver_affinity.rb +5 -0
- data/lib/rigor/inference/method_dispatcher/shape_dispatch.rb +28 -35
- data/lib/rigor/inference/method_dispatcher/struct_folding.rb +40 -8
- data/lib/rigor/inference/method_dispatcher.rb +57 -1
- data/lib/rigor/inference/mutation_widening.rb +42 -8
- data/lib/rigor/inference/narrowing.rb +245 -17
- data/lib/rigor/inference/parameter_inference_collector.rb +70 -10
- data/lib/rigor/inference/project_patched_scanner.rb +2 -1
- data/lib/rigor/inference/rbs_type_translator.rb +8 -1
- data/lib/rigor/inference/scope_indexer.rb +460 -49
- data/lib/rigor/inference/statement_evaluator.rb +111 -17
- data/lib/rigor/inference/struct_fold_safety.rb +48 -11
- data/lib/rigor/inference/synthetic_method_scanner.rb +15 -14
- data/lib/rigor/inference/void_origin.rb +25 -0
- data/lib/rigor/inference/void_tail_summary.rb +220 -0
- data/lib/rigor/language_server/completion_provider.rb +2 -1
- data/lib/rigor/language_server/document_symbol_provider.rb +2 -1
- data/lib/rigor/language_server/folding_range_provider.rb +2 -1
- data/lib/rigor/language_server/selection_range_provider.rb +2 -1
- data/lib/rigor/language_server/signature_help_provider.rb +2 -1
- data/lib/rigor/plugin/base.rb +9 -22
- data/lib/rigor/plugin/inflector.rb +12 -3
- data/lib/rigor/plugin/io_boundary.rb +5 -1
- data/lib/rigor/plugin/isolation.rb +81 -11
- data/lib/rigor/plugin/load_error.rb +10 -1
- data/lib/rigor/plugin/loader.rb +96 -14
- data/lib/rigor/plugin/node_rule_walk.rb +5 -3
- data/lib/rigor/plugin/registry.rb +32 -23
- data/lib/rigor/plugin.rb +26 -0
- data/lib/rigor/protection/mutator.rb +3 -2
- data/lib/rigor/reflection.rb +64 -0
- data/lib/rigor/runtime/jit.rb +128 -0
- data/lib/rigor/scope/discovery_index.rb +12 -2
- data/lib/rigor/scope.rb +122 -28
- data/lib/rigor/sig_gen/classification.rb +5 -1
- data/lib/rigor/sig_gen/generator.rb +38 -6
- data/lib/rigor/sig_gen/observation_collector.rb +4 -3
- data/lib/rigor/sig_gen/rbs_validity.rb +44 -0
- data/lib/rigor/sig_gen/renderer.rb +10 -0
- data/lib/rigor/sig_gen/write_result.rb +9 -4
- data/lib/rigor/sig_gen/writer.rb +24 -2
- data/lib/rigor/source/node_children.rb +116 -0
- data/lib/rigor/source/node_locator.rb +3 -1
- data/lib/rigor/source/node_walker.rb +4 -2
- data/lib/rigor/source.rb +1 -0
- data/lib/rigor/type/difference.rb +28 -24
- data/lib/rigor/type/hash_shape.rb +34 -10
- data/lib/rigor/version.rb +1 -1
- data/lib/rigortype.rb +24 -0
- data/plugins/rigor-actioncable/lib/rigor/plugin/actioncable/channel_discoverer.rb +4 -2
- data/plugins/rigor-actionmailer/lib/rigor/plugin/actionmailer/mailer_discoverer.rb +6 -4
- data/plugins/rigor-actionpack/lib/rigor/plugin/actionpack/analyzer.rb +23 -8
- data/plugins/rigor-actionpack/lib/rigor/plugin/actionpack/controller_discoverer.rb +5 -3
- data/plugins/rigor-actionpack/lib/rigor/plugin/actionpack.rb +21 -0
- data/plugins/rigor-activejob/lib/rigor/plugin/activejob/job_discoverer.rb +4 -2
- data/plugins/rigor-activerecord/lib/rigor/plugin/activerecord/analyzer.rb +13 -2
- data/plugins/rigor-activerecord/lib/rigor/plugin/activerecord/model_discoverer.rb +65 -2
- data/plugins/rigor-activerecord/lib/rigor/plugin/activerecord/model_index.rb +20 -2
- data/plugins/rigor-activerecord/lib/rigor/plugin/activerecord/schema_parser.rb +4 -2
- data/plugins/rigor-activerecord/lib/rigor/plugin/activerecord/structure_sql_parser.rb +172 -0
- data/plugins/rigor-activerecord/lib/rigor/plugin/activerecord.rb +22 -8
- data/plugins/rigor-activestorage/lib/rigor/plugin/activestorage/analyzer.rb +3 -1
- data/plugins/rigor-activestorage/lib/rigor/plugin/activestorage/attachment_discoverer.rb +4 -2
- data/plugins/rigor-activesupport-core-ext/sig/active_support/core_ext.rbs +32 -0
- data/plugins/rigor-dry-types/lib/rigor/plugin/dry_types.rb +38 -6
- data/plugins/rigor-factorybot/lib/rigor/plugin/factorybot/factory_discoverer.rb +3 -1
- data/plugins/rigor-hanami/lib/rigor/plugin/hanami/action_checker.rb +3 -1
- data/plugins/rigor-mangrove/lib/rigor/plugin/mangrove.rb +10 -0
- data/plugins/rigor-minitest/lib/rigor/plugin/minitest.rb +11 -0
- data/plugins/rigor-pundit/lib/rigor/plugin/pundit/policy_discoverer.rb +3 -1
- data/plugins/rigor-rails/lib/rigor-rails.rb +11 -12
- data/plugins/rigor-rails-routes/lib/rigor/plugin/rails_routes/grape_api_discoverer.rb +191 -0
- data/plugins/rigor-rails-routes/lib/rigor/plugin/rails_routes/helper_discoverer.rb +3 -1
- data/plugins/rigor-rails-routes/lib/rigor/plugin/rails_routes/helper_table.rb +19 -1
- data/plugins/rigor-rails-routes/lib/rigor/plugin/rails_routes/routes_parser.rb +48 -15
- data/plugins/rigor-rails-routes/lib/rigor/plugin/rails_routes.rb +42 -12
- data/plugins/rigor-rbs-inline/lib/rigor/plugin/rbs_inline.rb +83 -9
- data/plugins/rigor-rbs-inline/lib/rigor-rbs-inline.rb +9 -5
- data/plugins/rigor-rspec/lib/rigor/plugin/rspec/let_scope_index.rb +3 -1
- data/plugins/rigor-rspec/lib/rigor/plugin/rspec/scope_walker.rb +3 -1
- data/plugins/rigor-rspec/lib/rigor/plugin/rspec.rb +11 -0
- data/plugins/rigor-rspec-rails/lib/rigor/plugin/rspec_rails/http_status_codes.rb +4 -1
- data/plugins/rigor-sidekiq/lib/rigor/plugin/sidekiq/worker_discoverer.rb +4 -2
- data/plugins/rigor-sorbet/lib/rigor/plugin/sorbet/catalog_walker.rb +3 -1
- data/plugins/rigor-sorbet/lib/rigor/plugin/sorbet.rb +74 -14
- data/sig/prism_node_children.rbs +9 -0
- data/sig/rigor/environment.rbs +1 -0
- data/sig/rigor/inference.rbs +7 -0
- data/sig/rigor/plugin/base.rbs +2 -3
- data/sig/rigor/reflection.rbs +1 -0
- data/sig/rigor/scope.rbs +12 -1
- data/skills/rigor-ci-setup/SKILL.md +10 -0
- data/skills/rigor-editor-setup/SKILL.md +11 -0
- data/skills/rigor-next-steps/SKILL.md +23 -2
- data/skills/rigor-plugin-author/SKILL.md +3 -3
- data/skills/rigor-plugin-author/references/02-walker-and-types.md +2 -2
- data/skills/rigor-plugin-review/SKILL.md +2 -2
- data/skills/rigor-plugin-review/references/01-best-practices-checklist.md +5 -4
- data/skills/rigor-project-init/SKILL.md +29 -3
- data/skills/rigor-project-init/references/01-detect.md +1 -1
- data/skills/rigor-project-init/references/02-configure.md +39 -5
- data/skills/rigor-project-init/references/03-baseline-and-bugs.md +20 -0
- data/skills/rigor-project-init/references/05-jit-performance.md +125 -0
- metadata +49 -24
- data/lib/rigor/cli/ci_detector.rb +0 -89
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.
|
|
4
|
+
version: 0.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Rigor contributors
|
|
@@ -129,26 +129,6 @@ dependencies:
|
|
|
129
129
|
- - "<"
|
|
130
130
|
- !ruby/object:Gem::Version
|
|
131
131
|
version: '1.0'
|
|
132
|
-
- !ruby/object:Gem::Dependency
|
|
133
|
-
name: parallel_tests
|
|
134
|
-
requirement: !ruby/object:Gem::Requirement
|
|
135
|
-
requirements:
|
|
136
|
-
- - ">="
|
|
137
|
-
- !ruby/object:Gem::Version
|
|
138
|
-
version: '4.0'
|
|
139
|
-
- - "<"
|
|
140
|
-
- !ruby/object:Gem::Version
|
|
141
|
-
version: '6.0'
|
|
142
|
-
type: :development
|
|
143
|
-
prerelease: false
|
|
144
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
145
|
-
requirements:
|
|
146
|
-
- - ">="
|
|
147
|
-
- !ruby/object:Gem::Version
|
|
148
|
-
version: '4.0'
|
|
149
|
-
- - "<"
|
|
150
|
-
- !ruby/object:Gem::Version
|
|
151
|
-
version: '6.0'
|
|
152
132
|
- !ruby/object:Gem::Dependency
|
|
153
133
|
name: rake
|
|
154
134
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -269,8 +249,13 @@ dependencies:
|
|
|
269
249
|
- - "<"
|
|
270
250
|
- !ruby/object:Gem::Version
|
|
271
251
|
version: '4.0'
|
|
272
|
-
description: Rigor is a CLI-first static analyzer for Ruby applications that prioritizes
|
|
273
|
-
type inference, clean application code, and zero runtime dependencies.
|
|
252
|
+
description: 'Rigor is a CLI-first static analyzer for Ruby applications that prioritizes
|
|
253
|
+
type inference, clean application code, and zero runtime dependencies. Rigor is
|
|
254
|
+
a standalone tool, not a library: install it independently rather than adding it
|
|
255
|
+
to your application''s Gemfile. It runs on Ruby 4.0 while your project keeps its
|
|
256
|
+
own Ruby, and it reads your project as data rather than loading it, so a Gemfile
|
|
257
|
+
entry only constrains your application''s Ruby and dependency resolution. Installation
|
|
258
|
+
channels (mise, asdf, gem install, container, Nix): https://github.com/rigortype/rigor/blob/master/docs/install.md'
|
|
274
259
|
email:
|
|
275
260
|
- maintainers@example.invalid
|
|
276
261
|
executables:
|
|
@@ -301,8 +286,10 @@ files:
|
|
|
301
286
|
- data/builtins/ruby_core/string.yml
|
|
302
287
|
- data/builtins/ruby_core/struct.yml
|
|
303
288
|
- data/builtins/ruby_core/time.yml
|
|
289
|
+
- data/core_overlay/csv.rbs
|
|
304
290
|
- data/core_overlay/numeric.rbs
|
|
305
291
|
- data/core_overlay/pathname.rbs
|
|
292
|
+
- data/core_overlay/psych.rbs
|
|
306
293
|
- data/core_overlay/string_scanner.rbs
|
|
307
294
|
- data/gem_overlay/activesupport/core_ext.rbs
|
|
308
295
|
- data/vendored_gem_sigs/ast/ast.rbs
|
|
@@ -408,11 +395,17 @@ files:
|
|
|
408
395
|
- lib/rigor/analysis/check_rules.rb
|
|
409
396
|
- lib/rigor/analysis/check_rules/always_truthy_condition_collector.rb
|
|
410
397
|
- lib/rigor/analysis/check_rules/dead_assignment_collector.rb
|
|
398
|
+
- lib/rigor/analysis/check_rules/duplicate_hash_key_collector.rb
|
|
399
|
+
- lib/rigor/analysis/check_rules/inferred_param_guard.rb
|
|
411
400
|
- lib/rigor/analysis/check_rules/ivar_write_collector.rb
|
|
412
401
|
- lib/rigor/analysis/check_rules/main_pass_collector.rb
|
|
402
|
+
- lib/rigor/analysis/check_rules/return_in_ensure_collector.rb
|
|
403
|
+
- lib/rigor/analysis/check_rules/rule_ids.rb
|
|
413
404
|
- lib/rigor/analysis/check_rules/rule_walk.rb
|
|
414
405
|
- lib/rigor/analysis/check_rules/self_closedness_scanner.rb
|
|
406
|
+
- lib/rigor/analysis/check_rules/shadowed_rescue_collector.rb
|
|
415
407
|
- lib/rigor/analysis/check_rules/unreachable_clause_collector.rb
|
|
408
|
+
- lib/rigor/analysis/check_rules/void_value_use_collector.rb
|
|
416
409
|
- lib/rigor/analysis/dependency_recorder.rb
|
|
417
410
|
- lib/rigor/analysis/dependency_source_inference.rb
|
|
418
411
|
- lib/rigor/analysis/dependency_source_inference/boundary_cross_reporter.rb
|
|
@@ -426,9 +419,13 @@ files:
|
|
|
426
419
|
- lib/rigor/analysis/fact_store.rb
|
|
427
420
|
- lib/rigor/analysis/incremental.rb
|
|
428
421
|
- lib/rigor/analysis/incremental_session.rb
|
|
422
|
+
- lib/rigor/analysis/path_expansion.rb
|
|
423
|
+
- lib/rigor/analysis/plugin_fact_fingerprint.rb
|
|
429
424
|
- lib/rigor/analysis/project_scan.rb
|
|
430
425
|
- lib/rigor/analysis/result.rb
|
|
431
426
|
- lib/rigor/analysis/rule_catalog.rb
|
|
427
|
+
- lib/rigor/analysis/run_cache_key.rb
|
|
428
|
+
- lib/rigor/analysis/run_cache_probe.rb
|
|
432
429
|
- lib/rigor/analysis/run_stats.rb
|
|
433
430
|
- lib/rigor/analysis/runner.rb
|
|
434
431
|
- lib/rigor/analysis/runner/diagnostic_aggregator.rb
|
|
@@ -436,6 +433,7 @@ files:
|
|
|
436
433
|
- lib/rigor/analysis/runner/project_pre_passes.rb
|
|
437
434
|
- lib/rigor/analysis/runner/run_snapshots.rb
|
|
438
435
|
- lib/rigor/analysis/self_call_resolution_recorder.rb
|
|
436
|
+
- lib/rigor/analysis/severity_stamp.rb
|
|
439
437
|
- lib/rigor/analysis/worker_session.rb
|
|
440
438
|
- lib/rigor/ast.rb
|
|
441
439
|
- lib/rigor/ast/type_node.rb
|
|
@@ -446,6 +444,7 @@ files:
|
|
|
446
444
|
- lib/rigor/builtins/regex_refinement.rb
|
|
447
445
|
- lib/rigor/builtins/static_return_refinements.rb
|
|
448
446
|
- lib/rigor/cache/descriptor.rb
|
|
447
|
+
- lib/rigor/cache/file_digest.rb
|
|
449
448
|
- lib/rigor/cache/incremental_snapshot.rb
|
|
450
449
|
- lib/rigor/cache/rbs_cache_producer.rb
|
|
451
450
|
- lib/rigor/cache/rbs_class_ancestor_table.rb
|
|
@@ -456,12 +455,12 @@ files:
|
|
|
456
455
|
- lib/rigor/cache/rbs_environment_marshal_patch.rb
|
|
457
456
|
- lib/rigor/cache/rbs_known_class_names.rb
|
|
458
457
|
- lib/rigor/cache/store.rb
|
|
458
|
+
- lib/rigor/ci_detector.rb
|
|
459
459
|
- lib/rigor/cli.rb
|
|
460
460
|
- lib/rigor/cli/annotate_command.rb
|
|
461
461
|
- lib/rigor/cli/baseline_command.rb
|
|
462
462
|
- lib/rigor/cli/check_command.rb
|
|
463
463
|
- lib/rigor/cli/check_runner_factory.rb
|
|
464
|
-
- lib/rigor/cli/ci_detector.rb
|
|
465
464
|
- lib/rigor/cli/command.rb
|
|
466
465
|
- lib/rigor/cli/coverage_command.rb
|
|
467
466
|
- lib/rigor/cli/coverage_mutation.rb
|
|
@@ -484,6 +483,8 @@ files:
|
|
|
484
483
|
- lib/rigor/cli/plugins_command.rb
|
|
485
484
|
- lib/rigor/cli/plugins_renderer.rb
|
|
486
485
|
- lib/rigor/cli/prism_colorizer.rb
|
|
486
|
+
- lib/rigor/cli/probe_environment.rb
|
|
487
|
+
- lib/rigor/cli/protection_fork_scan.rb
|
|
487
488
|
- lib/rigor/cli/protection_renderer.rb
|
|
488
489
|
- lib/rigor/cli/protection_report.rb
|
|
489
490
|
- lib/rigor/cli/renderable.rb
|
|
@@ -509,8 +510,10 @@ files:
|
|
|
509
510
|
- lib/rigor/environment/bundle_sig_discovery.rb
|
|
510
511
|
- lib/rigor/environment/class_registry.rb
|
|
511
512
|
- lib/rigor/environment/constant_type_cache_holder.rb
|
|
513
|
+
- lib/rigor/environment/default_libraries.rb
|
|
512
514
|
- lib/rigor/environment/hkt_registry_holder.rb
|
|
513
515
|
- lib/rigor/environment/lockfile_resolver.rb
|
|
516
|
+
- lib/rigor/environment/missing_gem_constant_index.rb
|
|
514
517
|
- lib/rigor/environment/rbs_collection_discovery.rb
|
|
515
518
|
- lib/rigor/environment/rbs_coverage_report.rb
|
|
516
519
|
- lib/rigor/environment/rbs_hierarchy.rb
|
|
@@ -549,12 +552,15 @@ files:
|
|
|
549
552
|
- lib/rigor/inference/builtins/time_catalog.rb
|
|
550
553
|
- lib/rigor/inference/closure_escape_analyzer.rb
|
|
551
554
|
- lib/rigor/inference/coverage_scanner.rb
|
|
555
|
+
- lib/rigor/inference/def_handle.rb
|
|
556
|
+
- lib/rigor/inference/def_node_resolver.rb
|
|
552
557
|
- lib/rigor/inference/def_return_typer.rb
|
|
553
558
|
- lib/rigor/inference/dynamic_origin.rb
|
|
554
559
|
- lib/rigor/inference/expression_typer.rb
|
|
555
560
|
- lib/rigor/inference/fallback.rb
|
|
556
561
|
- lib/rigor/inference/fallback_tracer.rb
|
|
557
562
|
- lib/rigor/inference/flow_tracer.rb
|
|
563
|
+
- lib/rigor/inference/fork_map.rb
|
|
558
564
|
- lib/rigor/inference/hkt_body.rb
|
|
559
565
|
- lib/rigor/inference/hkt_body_parser.rb
|
|
560
566
|
- lib/rigor/inference/hkt_reducer.rb
|
|
@@ -604,6 +610,8 @@ files:
|
|
|
604
610
|
- lib/rigor/inference/synthetic_method.rb
|
|
605
611
|
- lib/rigor/inference/synthetic_method_index.rb
|
|
606
612
|
- lib/rigor/inference/synthetic_method_scanner.rb
|
|
613
|
+
- lib/rigor/inference/void_origin.rb
|
|
614
|
+
- lib/rigor/inference/void_tail_summary.rb
|
|
607
615
|
- lib/rigor/language_server.rb
|
|
608
616
|
- lib/rigor/language_server/buffer_resolution.rb
|
|
609
617
|
- lib/rigor/language_server/buffer_table.rb
|
|
@@ -659,6 +667,7 @@ files:
|
|
|
659
667
|
- lib/rigor/rbs_extended/hkt_directives.rb
|
|
660
668
|
- lib/rigor/rbs_extended/reporter.rb
|
|
661
669
|
- lib/rigor/reflection.rb
|
|
670
|
+
- lib/rigor/runtime/jit.rb
|
|
662
671
|
- lib/rigor/scope.rb
|
|
663
672
|
- lib/rigor/scope/discovery_index.rb
|
|
664
673
|
- lib/rigor/sig_gen.rb
|
|
@@ -669,6 +678,7 @@ files:
|
|
|
669
678
|
- lib/rigor/sig_gen/observation_collector.rb
|
|
670
679
|
- lib/rigor/sig_gen/observed_call.rb
|
|
671
680
|
- lib/rigor/sig_gen/path_mapper.rb
|
|
681
|
+
- lib/rigor/sig_gen/rbs_validity.rb
|
|
672
682
|
- lib/rigor/sig_gen/renderer.rb
|
|
673
683
|
- lib/rigor/sig_gen/type_elaborator.rb
|
|
674
684
|
- lib/rigor/sig_gen/write_result.rb
|
|
@@ -677,6 +687,7 @@ files:
|
|
|
677
687
|
- lib/rigor/source.rb
|
|
678
688
|
- lib/rigor/source/constant_path.rb
|
|
679
689
|
- lib/rigor/source/literals.rb
|
|
690
|
+
- lib/rigor/source/node_children.rb
|
|
680
691
|
- lib/rigor/source/node_locator.rb
|
|
681
692
|
- lib/rigor/source/node_walker.rb
|
|
682
693
|
- lib/rigor/testing.rb
|
|
@@ -720,6 +731,7 @@ files:
|
|
|
720
731
|
- lib/rigor/type_node/union.rb
|
|
721
732
|
- lib/rigor/value_semantics.rb
|
|
722
733
|
- lib/rigor/version.rb
|
|
734
|
+
- lib/rigortype.rb
|
|
723
735
|
- plugins/rigor-actioncable/lib/rigor-actioncable.rb
|
|
724
736
|
- plugins/rigor-actioncable/lib/rigor/plugin/actioncable.rb
|
|
725
737
|
- plugins/rigor-actioncable/lib/rigor/plugin/actioncable/analyzer.rb
|
|
@@ -747,6 +759,7 @@ files:
|
|
|
747
759
|
- plugins/rigor-activerecord/lib/rigor/plugin/activerecord/model_index.rb
|
|
748
760
|
- plugins/rigor-activerecord/lib/rigor/plugin/activerecord/schema_parser.rb
|
|
749
761
|
- plugins/rigor-activerecord/lib/rigor/plugin/activerecord/schema_table.rb
|
|
762
|
+
- plugins/rigor-activerecord/lib/rigor/plugin/activerecord/structure_sql_parser.rb
|
|
750
763
|
- plugins/rigor-activerecord/sig/active_record/relation.rbs
|
|
751
764
|
- plugins/rigor-activestorage/lib/rigor-activestorage.rb
|
|
752
765
|
- plugins/rigor-activestorage/lib/rigor/plugin/activestorage.rb
|
|
@@ -802,6 +815,7 @@ files:
|
|
|
802
815
|
- plugins/rigor-rails-routes/lib/rigor/plugin/rails_routes/analyzer.rb
|
|
803
816
|
- plugins/rigor-rails-routes/lib/rigor/plugin/rails_routes/devise_routes.rb
|
|
804
817
|
- plugins/rigor-rails-routes/lib/rigor/plugin/rails_routes/doorkeeper_routes.rb
|
|
818
|
+
- plugins/rigor-rails-routes/lib/rigor/plugin/rails_routes/grape_api_discoverer.rb
|
|
805
819
|
- plugins/rigor-rails-routes/lib/rigor/plugin/rails_routes/helper_discoverer.rb
|
|
806
820
|
- plugins/rigor-rails-routes/lib/rigor/plugin/rails_routes/helper_table.rb
|
|
807
821
|
- plugins/rigor-rails-routes/lib/rigor/plugin/rails_routes/routes_parser.rb
|
|
@@ -843,6 +857,7 @@ files:
|
|
|
843
857
|
- plugins/rigor-statesman/lib/rigor/plugin/statesman.rb
|
|
844
858
|
- plugins/rigor-typescript-utility-types/lib/rigor-typescript-utility-types.rb
|
|
845
859
|
- plugins/rigor-typescript-utility-types/lib/rigor/plugin/typescript_utility_types.rb
|
|
860
|
+
- sig/prism_node_children.rbs
|
|
846
861
|
- sig/rigor.rbs
|
|
847
862
|
- sig/rigor/analysis/baseline.rbs
|
|
848
863
|
- sig/rigor/analysis/check_rules/always_truthy_condition_collector.rbs
|
|
@@ -904,6 +919,7 @@ files:
|
|
|
904
919
|
- skills/rigor-project-init/references/02-configure.md
|
|
905
920
|
- skills/rigor-project-init/references/03-baseline-and-bugs.md
|
|
906
921
|
- skills/rigor-project-init/references/04-sig-uplift.md
|
|
922
|
+
- skills/rigor-project-init/references/05-jit-performance.md
|
|
907
923
|
- skills/rigor-protection-uplift/SKILL.md
|
|
908
924
|
- skills/rigor-rbs-setup/SKILL.md
|
|
909
925
|
- skills/rigor-upgrade/SKILL.md
|
|
@@ -915,6 +931,15 @@ metadata:
|
|
|
915
931
|
source_code_uri: https://github.com/rigortype/rigor
|
|
916
932
|
documentation_uri: https://github.com/rigortype/rigor/tree/master/docs
|
|
917
933
|
rubygems_mfa_required: 'true'
|
|
934
|
+
post_install_message: |
|
|
935
|
+
Rigor installs as a standalone CLI, not a project dependency. Run `rigor check app lib` from your
|
|
936
|
+
project root — no `bundle exec`.
|
|
937
|
+
|
|
938
|
+
If this came from `bundle add rigortype` or a Gemfile entry, remove it: Rigor runs on its own Ruby
|
|
939
|
+
and analyses your project from the outside, so in a Gemfile it constrains your application's Ruby
|
|
940
|
+
and dependency resolution without giving you anything. Per-project version pinning without that
|
|
941
|
+
cost, plus every other channel, is documented in
|
|
942
|
+
https://github.com/rigortype/rigor/blob/master/docs/install.md
|
|
918
943
|
rdoc_options: []
|
|
919
944
|
require_paths:
|
|
920
945
|
- lib
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Rigor
|
|
4
|
-
class CLI
|
|
5
|
-
# Runtime CI-environment detection (ADR-51 WD7), modelled on `OndraM/ci-detector` (the library PHPStan uses). Reads
|
|
6
|
-
# the well-known environment variables a CI provider sets and returns the matching {Platform}, classifying it into a
|
|
7
|
-
# **tier** that decides how `rigor check` surfaces diagnostics there:
|
|
8
|
-
#
|
|
9
|
-
# :native_stdout — Rigor has a native format that renders purely from
|
|
10
|
-
# stdout, so it is auto-emitted on top of the human
|
|
11
|
-
# output (GitHub Actions → `github`, TeamCity →
|
|
12
|
-
# `teamcity`). These are the first-class platforms.
|
|
13
|
-
# :native_artifact — Rigor has a native format but it needs a CI-wired
|
|
14
|
-
# report artifact, not stdout (GitLab CI → `gitlab`).
|
|
15
|
-
# First-class, but Rigor only *hints* the format.
|
|
16
|
-
# :reviewdog — no native Rigor format; second-class, routed through
|
|
17
|
-
# reviewdog (`checkstyle`/`sarif`) or `junit`. Hint
|
|
18
|
-
# only.
|
|
19
|
-
#
|
|
20
|
-
# Detection is a pure function of the environment hash, so it is fully testable; the CLI passes `ENV`.
|
|
21
|
-
# `RIGOR_CI_DETECT=0` (or `false`/`no`) disables it globally — the seam the spec suite uses for determinism.
|
|
22
|
-
module CiDetector
|
|
23
|
-
Platform = Struct.new(:id, :name, :format, :tier, keyword_init: true) do
|
|
24
|
-
def native_stdout? = tier == :native_stdout
|
|
25
|
-
def native_artifact? = tier == :native_artifact
|
|
26
|
-
def reviewdog? = tier == :reviewdog
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
# The detection table, ordered most-specific first so the generic `CI=true` catch-all is last (a provider that
|
|
30
|
-
# also sets `CI` is still recognised by its own variable). `match` is `:truthy` (value in 1/true/yes/on),
|
|
31
|
-
# `:present` (variable set non-empty), or `:equals`.
|
|
32
|
-
PROVIDERS = [
|
|
33
|
-
{ id: "github-actions", name: "GitHub Actions", format: "github", tier: :native_stdout,
|
|
34
|
-
var: "GITHUB_ACTIONS", match: :truthy },
|
|
35
|
-
{ id: "gitlab", name: "GitLab CI", format: "gitlab", tier: :native_artifact,
|
|
36
|
-
var: "GITLAB_CI", match: :truthy },
|
|
37
|
-
{ id: "teamcity", name: "TeamCity", format: "teamcity", tier: :native_stdout,
|
|
38
|
-
var: "TEAMCITY_VERSION", match: :present },
|
|
39
|
-
{ id: "circleci", name: "CircleCI", format: nil, tier: :reviewdog,
|
|
40
|
-
var: "CIRCLECI", match: :truthy },
|
|
41
|
-
{ id: "jenkins", name: "Jenkins", format: nil, tier: :reviewdog,
|
|
42
|
-
var: "JENKINS_URL", match: :present },
|
|
43
|
-
{ id: "travis", name: "Travis CI", format: nil, tier: :reviewdog,
|
|
44
|
-
var: "TRAVIS", match: :truthy },
|
|
45
|
-
{ id: "appveyor", name: "AppVeyor", format: nil, tier: :reviewdog,
|
|
46
|
-
var: "APPVEYOR", match: :truthy },
|
|
47
|
-
{ id: "azure-pipelines", name: "Azure Pipelines", format: nil, tier: :reviewdog,
|
|
48
|
-
var: "TF_BUILD", match: :present },
|
|
49
|
-
{ id: "bitbucket", name: "Bitbucket Pipelines", format: nil, tier: :reviewdog,
|
|
50
|
-
var: "BITBUCKET_BUILD_NUMBER", match: :present },
|
|
51
|
-
{ id: "buildkite", name: "Buildkite", format: nil, tier: :reviewdog,
|
|
52
|
-
var: "BUILDKITE", match: :truthy },
|
|
53
|
-
{ id: "drone", name: "Drone CI", format: nil, tier: :reviewdog,
|
|
54
|
-
var: "DRONE", match: :truthy },
|
|
55
|
-
{ id: "semaphore", name: "Semaphore", format: nil, tier: :reviewdog,
|
|
56
|
-
var: "SEMAPHORE", match: :truthy },
|
|
57
|
-
{ id: "codeship", name: "Codeship", format: nil, tier: :reviewdog,
|
|
58
|
-
var: "CI_NAME", match: :equals, value: "codeship" },
|
|
59
|
-
{ id: "ci", name: "CI", format: nil, tier: :reviewdog,
|
|
60
|
-
var: "CI", match: :truthy }
|
|
61
|
-
].freeze
|
|
62
|
-
|
|
63
|
-
module_function
|
|
64
|
-
|
|
65
|
-
# Returns the detected {Platform}, or nil when no CI is recognised or detection is disabled via `RIGOR_CI_DETECT`.
|
|
66
|
-
def detect(env = ENV)
|
|
67
|
-
return nil if disabled?(env)
|
|
68
|
-
|
|
69
|
-
row = PROVIDERS.find { |provider| matches?(env, provider) }
|
|
70
|
-
return nil if row.nil?
|
|
71
|
-
|
|
72
|
-
Platform.new(id: row[:id], name: row[:name], format: row[:format], tier: row[:tier])
|
|
73
|
-
end
|
|
74
|
-
|
|
75
|
-
def disabled?(env)
|
|
76
|
-
%w[0 false no off].include?(env["RIGOR_CI_DETECT"].to_s.strip.downcase)
|
|
77
|
-
end
|
|
78
|
-
|
|
79
|
-
def matches?(env, provider)
|
|
80
|
-
value = env[provider[:var]].to_s.strip
|
|
81
|
-
case provider[:match]
|
|
82
|
-
when :truthy then %w[1 true yes on].include?(value.downcase)
|
|
83
|
-
when :present then !value.empty?
|
|
84
|
-
when :equals then value.downcase == provider[:value]
|
|
85
|
-
end
|
|
86
|
-
end
|
|
87
|
-
end
|
|
88
|
-
end
|
|
89
|
-
end
|