Upgrade to Pro — share decks privately, control downloads, hide ads and more …

yard2steep 進捗報告

yard2steep 進捗報告

Meguro.rb#17 で yard2steep のリリース後の改善について話しました!
cf. https://megurorb.connpass.com/event/94480

Nao Minami

July 31, 2018
Tweet

More Decks by Nao Minami

Other Decks in Programming

Transcript

  1. ©2018 Wantedly, Inc. 3VCZίʔυΛ༻ҙ͢Δ # lib/parser.rb class AST # @return

    [String] def to_s "AST" end # @param [Hash] opt def traverse!(opt) end end class Parser # @param [String] text # @param [Hash] opt # @return [AST] def parse(text, opt) ast = AST.new ast.traverse!(opt) ast end end
  2. ©2018 Wantedly, Inc. ZBSETUFFQίϚϯυΛ࣮ߦ $ yard2steep lib ZBSETUFFQͰܕఆٛϑΝΠϧΛੜ੒ # sig/parser.rbi

    class AST def to_s: -> String def traverse!: (Hash<any, any>) -> any end class Parser def parse: (String, Hash<any, any>) -> AST end
  3. ©2018 Wantedly, Inc. ZBSETUFFQϦϦʔεޙͷվળ w 3VCZQBSTFSͷվળ w ࣗલ࣮૷͔ΒɺSJQQFSϕʔεͷQBSTFS΁ͱҠߦͨ͠ w ղऍͰ͖ΔSVCZDPEFͷ෯͕޿͕ͬͨ

    w Ϧςϥϧఆ਺ͷܕ෇͚ w ϦςϥϧΛBTTJHOͯ͠࡞Δఆ਺ʹ͸ܕ৘ใΛ෇༩͢ΔΑ͏ʹͳͬͨ w BUUS@XSJUFS BUUS@BDDFTTPSͷTVQQPSU w HFUUFSNFUIPEʹ͍ͭͯ΋ɺܕఆٛΛੜ੒͢ΔΑ͏ʹͳͬͨ
  4. ©2018 Wantedly, Inc. ZBSETUFFQϦϦʔεޙͷվળ w 3VCZQBSTFSͷվળ w ࣗલ࣮૷͔ΒɺSJQQFSϕʔεͷQBSTFS΁ͱҠߦͨ͠ w ղऍͰ͖ΔSVCZDPEFͷ෯͕޿͕ͬͨ

    w Ϧςϥϧఆ਺ͷܕ෇͚ w ϦςϥϧΛBTTJHOͯ͠࡞Δఆ਺ʹ͸ܕ৘ใΛ෇༩͢ΔΑ͏ʹͳͬͨ w BUUS@XSJUFS BUUS@BDDFTTPSͷTVQQPSU w HFUUFSNFUIPEʹ͍ͭͯ΋ɺܕఆٛΛੜ੒͢ΔΑ͏ʹͳͬͨ
  5. ©2018 Wantedly, Inc. 3VCZQBSTFSͷվળ w 3JQQFSTFYQΛར༻ w 3JQQFSTFYQ͸SVCZDPEFΛQBSTFͨ͠USFFߏ଄Λฦ͢ w USFFΛUSBWFSTFͯ͠ཉ͍͠৘ใΛऔΓग़ͤ͹0,

    w ίϝϯτͷऔಘʹ͸3JQQFSMFYΛར༻ w 3JQQFSTFYQ͸3VCZͷಈ࡞ʹӨڹ͠ͳ͍৘ใʢDGίϝϯτʣΛऔΓআ͍ͯ͠·͏ɻ ίϝϯτऔಘʹ͸ผͷखஈ͕ඞཁɻ w 3JQQFSMFY͸SVCZDPEFͷUPLFOΛฦ͢ɻAPO@DPNNFOUA͕ίϝϯτͳͷͰɺͦΕ Λऔಘɻ
  6. ©2018 Wantedly, Inc. ZBSETUFFQϦϦʔεޙͷվળ w 3VCZQBSTFSͷվળ w ࣗલ࣮૷͔ΒɺSJQQFSϕʔεͷQBSTFS΁ͱҠߦͨ͠ w ղऍͰ͖ΔSVCZDPEFͷ෯͕޿͕ͬͨ

    w Ϧςϥϧఆ਺ͷܕ෇͚ w ϦςϥϧΛBTTJHOͯ͠࡞Δఆ਺ʹ͸ܕ৘ใΛ෇༩͢ΔΑ͏ʹͳͬͨ w BUUS@XSJUFS BUUS@BDDFTTPSͷTVQQPSU w HFUUFSNFUIPEʹ͍ͭͯ΋ɺܕఆٛΛੜ੒͢ΔΑ͏ʹͳͬͨ
  7. ©2018 Wantedly, Inc. Ϧςϥϧఆ਺ͷܕ෇͚ # lib/sample.rb class MyClass CONSTANT =

    "This is constant" CONSTANT2 = /this is re/ CONSTANT3 = :symbol_value CONSTANT4 = 1..2 CONSTANT5 = 34 CONSTANT6 = 2.34 CONSTANT7 = [1, 2] CONSTANT8 = { a: 3 } CONSTANT9 = true CONSTANT10 = false CONSTANT11 = nil end # sig/sample.rbi MyClass::CONSTANT: String MyClass::CONSTANT2: Regexp MyClass::CONSTANT3: Symbol MyClass::CONSTANT4: Range<any> MyClass::CONSTANT5: Integer MyClass::CONSTANT6: Float MyClass::CONSTANT7: Array<any> MyClass::CONSTANT8: Hash<any, any> MyClass::CONSTANT9: bool MyClass::CONSTANT10: bool MyClass::CONSTANT11: nil
  8. ©2018 Wantedly, Inc. ZBSETUFFQϦϦʔεޙͷվળ w 3VCZQBSTFSͷվળ w ࣗલ࣮૷͔ΒɺSJQQFSϕʔεͷQBSTFS΁ͱҠߦͨ͠ w ղऍͰ͖ΔSVCZDPEFͷ෯͕޿͕ͬͨ

    w Ϧςϥϧఆ਺ͷܕ෇͚ w ϦςϥϧΛBTTJHOͯ͠࡞Δఆ਺ʹ͸ܕ৘ใΛ෇༩͢ΔΑ͏ʹͳͬͨ w BUUS@XSJUFS BUUS@BDDFTTPSͷTVQQPSU w HFUUFSNFUIPEʹ͍ͭͯ΋ɺܕఆٛΛੜ੒͢ΔΑ͏ʹͳͬͨ
  9. ©2018 Wantedly, Inc. BUUS@XSJUFS BUUS@BDDFTTPSͷTVQQPSU # lib/sample.rb class SomeClass #

    @dynamic index, index=, count, count= attr_reader :index attr_writer :index attr_accessor :count end # sig/sample.rbi class SomeClass @index: any @count: any def index: -> any def index=: (any) -> any def count: -> any def count=: (any) -> any end
  10. ©2018 Wantedly, Inc. ·ͱΊ w ZBSETUFFQ͕গͣͭ͠վળʂ w 3VCZQBSTFSͷվળ w Ϧςϥϧఆ਺ͷܕ෇͚

    w BUUS@XSJUFS BUUS@BDDFTTPSͷTVQQPSU w ͜Ε͔Β΋ɺ3VCZͰ)BQQZ)BDLJOH͠Α͏ʂ