![]() They really did an excellent job of exposing context, and make this particular bug easy to track down and isolate. So we get the value, the type, the method type signature, and some other details about tracing what exactly went wrong. rb : 7 : Method Object #main has specified name as String 7 | sig ^^^^ Got Integer ( 42 ) originating from:Ġ1 _homepage. rb : 14 : Integer ( 42 ) does not match String for argument name https :/ / srb. ![]() We'll ignore a lot of the generated files for now, that's likely the subject of an entire writeup of its own.Ġ1 _homepage. Now that's a good deal of text, let's take a look into it. □ Please don't hesitate to give us your feedback! Upgrade a file marked # typed: ignore to # typed: false. It's possible some of these constants are typos. Check whether things that show up in the TODO RBI file actually exist in your project. Add signatures to your methods with `sig`. Then, run srb tc and try to fix any errors. Upgrade a file marked # typed: false to # typed: true. If instead you want to explore your files locally, here are some things to try: We recommend skimming these docs to get a feel for how to use Sorbet: Up to you! First things first, you'll probably want to typecheck your project: Please check this whole folder into version control. ![]() └── todo.rbi # Constants which were still missing, even after the three steps above. ├── hidden-definitions/ # All definitions that exist at runtime, but Sorbet couldn't see statically ├── gems/ # Autogenerated type definitions for your gems (from reflection) ├── sorbet-typed/ # Community writen type definition files for your gems ├── config # Default options to passed to sorbet on every run This project is now set up for use with Sorbet. Generating split RBIs into sorbet/rbi/hidden-definitions/ Generating: sorbet/rbi/hidden-definitions/ If _FILE_ = $PROGRAM_NAME is a throwback, haven't seen that in a while. I kinda wonder if there's a -y flag to bypass this for projects that know they want it and know said risks. # typed: true, depending on how many errors were found in that file.) It will add a comment to the top of every file (like # typed: false or Your project will be run, unless that script checks if _FILE_ = $PROGRAM_NAMEīefore running any code, or has the magic comment # typed: ignore in it.Ģ. It will require every file in your project. To set up your project, this script will take two potentially destructiveġ. RBI stands for 'Ruby Interface' these files define classes, methods, andĬonstants that exist, but which Sorbet doesn 't always know about. This script will get this project ready to use with Sorbet by creating a ➜ strawberry_sorbet git: (master ) ✗ srb init
0 Comments
Leave a Reply. |