Skip to content

Add root log to yard.rbi#397

Merged
jez merged 1 commit intosorbet:masterfrom
dduugg:yard-log
Aug 8, 2022
Merged

Add root log to yard.rbi#397
jez merged 1 commit intosorbet:masterfrom
dduugg:yard-log

Conversation

@dduugg
Copy link
Copy Markdown
Contributor

@dduugg dduugg commented Aug 7, 2022

Adds the log method in an attempt to solve the problem posted here (and pasted below):

I'm attempting to migrate yard-sorbet to use tapioca for RBI generation. WIP PR: dduugg/yard-sorbet#103
I'm following the migration guide: https://github.com/Shopify/tapioca/wiki/Migrating-to-Tapioca
However, typechecking is currently failing:

$ be srb tc                                                                                                                         [15:52:16]
lib/yard-sorbet/sig_to_yard.rb:60: Method log does not exist on T.class_of(YARDSorbet::SigToYARD) https://srb.help/7003
    60 |        log.info("Unsupported sig aref node #{node.source}")
                ^^^

lib/yard-sorbet/sig_to_yard.rb:126: Method log does not exist on T.class_of(YARDSorbet::SigToYARD) https://srb.help/7003
     126 |      log.warn("Unsupported sig #{node.type} node #{node.source}")
                ^^^
Errors: 2
FAIL

log is defined by yard here: https://github.com/lsegal/yard/blob/main/lib/yard/globals.rb#L20-L22
My understanding is that I should be able to resolve this by adding requiring yard/globals in tapioca/require, then invoking bin/tapioca gem yard, which I attempted to do in these commits:
dduugg/yard-sorbet@9e00ecd
dduugg/yard-sorbet@8717134
However, I'm still seeing the same errors when I attempt to invoke srb tc
What am I doing wrong?

@dduugg dduugg requested a review from a team as a code owner August 7, 2022 16:13
@dduugg dduugg requested review from jez and removed request for a team August 7, 2022 16:13
@jez jez merged commit e0d6e94 into sorbet:master Aug 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants