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

ライブラリとSwiftLintの辛いお話

28f57a43ae8eba102877b7a3d64f688a?s=47 Kohei Tabata
February 14, 2017

 ライブラリとSwiftLintの辛いお話

28f57a43ae8eba102877b7a3d64f688a?s=128

Kohei Tabata

February 14, 2017
Tweet

Transcript

  1. ϥΠϒϥϦͱSwiftLintͷ ਏ͍͓࿩ 2017/02/14 SwiftѪ޷ձ@21Cafe

  2. ࣗݾ঺հ ɾKohei Tabata(@nerd0geek1) ɾSaib Studio LLC ɾiOS/MacOS/tvOS Developer ɾWAmazingɹɹ ͱ͍͏ελʔτΞοϓͰ

    ɹiOSΞϓϦ։ൃͷ͓ख఻͍ Said Studio LLC Kohei Tabata Next! Remote quick-zip plus
  3. Έͳ͞Μɺ Swift͸޷͖Ͱ͢ΑͶʁ

  4. ϥΠϒϥϦ΋ ॻ͍ͨΓ͠·͢ΑͶʁ

  5. ͦͯ͠ɺ SwiftLint΋޷͖Ͱ͢ΑͶʁ

  6. Agenda ɾSwiftLintͱ͸ ɾϥΠϒϥϦ΁ಋೖ͢Δࡍͷམͱ݀͠ ɾͭΒΈ ɾAggregateΛ׆༻ͯ͠ ɾ·ͱΊ

  7. SwiftLintͱ͸ ɾSwiftLintͱ͸ɺRealm͕ࣾ։ൃɾӡ༻͍ͯ͠ΔSwift༻ͷLintπʔϧ ɾSwiftʹର͔ͯ͠ͳΓଟ͘ͷछྨͷLintΛ࣮ߦ͢Δ͜ͱ͕Ͱ͖Δ ɹɾforce_unwrapΛߦ͍ͬͯΔՕॴΛΤϥʔͱ͢Δ ɹɾΫϥεɺϑΝΠϧͷߦ਺ʹԠͯ͡ܯࠂɺΤϥʔΛදࣔ ɹɾetc… ɾৄ͍͠ΧελϚΠζ΋.swiftlint.ymlΛฤू͢Δ͜ͱͰՄೳ

  8. ϥΠϒϥϦ΁ಋೖ͢Δࡍͷམͱ݀͠ SwiftLintΛϥΠϒϥϦ΁ಋೖ͢Δࡍʹɺ௨ৗͷΞϓϦͱಉ༷ͷํ๏Ͱಋೖͯ͠͠·͏ͱ ϥΠϒϥϦͷར༻ऀ͕ਏ͘ͳΔέʔε͕ଘࡏ͢Δ(mixpanel-swiftͰମݧ)

  9. ϥΠϒϥϦ΁ಋೖ͢Δࡍͷམͱ݀͠ SwiftLintΛϥΠϒϥϦ΁ಋೖ͢Δࡍʹɺ௨ৗͷΞϓϦͱಉ༷ͷํ๏Ͱಋೖͯ͠͠·͏ͱ ϥΠϒϥϦͷར༻ऀ͕ਏ͘ͳΔέʔε͕ଘࡏ͢Δ(mixpanel-swiftͰମݧ) ϥΠϒϥϦͷSwiftLintͷόʔδϣϯͱϢʔβʔͷSwiftLintͷόʔδϣϯ͕ҟͳΔ৔߹

  10. ϥΠϒϥϦ΁ಋೖ͢Δࡍͷམͱ݀͠ SwiftLintΛϥΠϒϥϦ΁ಋೖ͢Δࡍʹɺ௨ৗͷΞϓϦͱಉ༷ͷํ๏Ͱಋೖͯ͠͠·͏ͱ ϥΠϒϥϦͷར༻ऀ͕ਏ͘ͳΔέʔε͕ଘࡏ͢Δ(mixpanel-swiftͰମݧ) ϥΠϒϥϦɿ0.13.2 Ϣʔβʔɹɿ0.13.2 ϥΠϒϥϦͷSwiftLintͷόʔδϣϯͱϢʔβʔͷSwiftLintͷόʔδϣϯ͕ҟͳΔ৔߹

  11. ϥΠϒϥϦ΁ಋೖ͢Δࡍͷམͱ݀͠ SwiftLintΛϥΠϒϥϦ΁ಋೖ͢Δࡍʹɺ௨ৗͷΞϓϦͱಉ༷ͷํ๏Ͱಋೖͯ͠͠·͏ͱ ϥΠϒϥϦͷར༻ऀ͕ਏ͘ͳΔέʔε͕ଘࡏ͢Δ(mixpanel-swiftͰମݧ) ϥΠϒϥϦɿ0.13.2 Ϣʔβʔɹɿ0.13.2 ϥΠϒϥϦͷSwiftLintͷόʔδϣϯͱϢʔβʔͷSwiftLintͷόʔδϣϯ͕ҟͳΔ৔߹

  12. ϥΠϒϥϦ΁ಋೖ͢Δࡍͷམͱ݀͠ SwiftLintΛϥΠϒϥϦ΁ಋೖ͢Δࡍʹɺ௨ৗͷΞϓϦͱಉ༷ͷํ๏Ͱಋೖͯ͠͠·͏ͱ ϥΠϒϥϦͷར༻ऀ͕ਏ͘ͳΔέʔε͕ଘࡏ͢Δ(mixpanel-swiftͰମݧ) ϥΠϒϥϦɿ0.13.2 Ϣʔβʔɹɿ0.13.2 ϥΠϒϥϦɿ0.13.2 Ϣʔβʔɹɿ0.16.0 ϥΠϒϥϦͷSwiftLintͷόʔδϣϯͱϢʔβʔͷSwiftLintͷόʔδϣϯ͕ҟͳΔ৔߹

  13. ϥΠϒϥϦ΁ಋೖ͢Δࡍͷམͱ݀͠ SwiftLintΛϥΠϒϥϦ΁ಋೖ͢Δࡍʹɺ௨ৗͷΞϓϦͱಉ༷ͷํ๏Ͱಋೖͯ͠͠·͏ͱ ϥΠϒϥϦͷར༻ऀ͕ਏ͘ͳΔέʔε͕ଘࡏ͢Δ(mixpanel-swiftͰମݧ) ϥΠϒϥϦɿ0.13.2 Ϣʔβʔɹɿ0.13.2 ϥΠϒϥϦɿ0.13.2 Ϣʔβʔɹɿ0.16.0 ϥΠϒϥϦͷSwiftLintͷόʔδϣϯͱϢʔβʔͷSwiftLintͷόʔδϣϯ͕ҟͳΔ৔߹

  14. ͭΒΈͷݪҼ ઌఔͷ໰୊͸ͳͥൃੜͯ͠͠·͔ͬͨʁ →Ϗϧυ࣌ʹͷΈ࣮ߦ͍ͨ͠Script͕Archive࣌ʹ΋࣮ߦ͞Εͯ͠·͍ͬͯͨ͜ͱ ཧ૝ ݱঢ়

  15. None
  16. Aggregateͱ͸ʁ ɾBuild Phase౳Λ੔ཧ͢ΔͨΊͷ΋ͷ ɹAdd Target > Cross-platform > Aggregate͔Β௥ՃՄೳɻ

  17. Aggregateͷ׆༻๏ ɾRealmͷϓϩδΣΫτͰ͸ɺSwiftLintͷScriptͷΈΛؚΉAggregateΛ௥Ճ͠ɺ ɹͦΕΛݺͼग़͢Α͏ʹͯ͠ར༻͍ͯ͠Δɻ

  18. Aggregateͷ׆༻๏ ɾϥΠϒϥϦຊମͷBuild SchemeΛฤू͠ɺϏϧυ࣌(ΞʔΧΠϒ࣌)ʹͷΈ ɹSwiftLint͕૸ΔΑ͏ʹ͢Δ͜ͱ΋Ͱ͖Δ

  19. ·ͱΊ ɾSwiftLintʹΑΓɺιʔείʔυΛखܰʹ੍ޚ͢Δ͜ͱ͕Ͱ͖Δ ɾͦͷ൒໘ɺࠓճͷΑ͏ͳ໰୊ʹ௚໘͢Δ͜ͱ΋ɻ ɾAggregateΛར༻͢Δ͜ͱͰରԠՄೳ ɾAggregate͸ࠓճͷ໰୊Ҏ֎ʹ΋෯޿͘Ԡ༻Ͱ͖ΔͷͰɺ ɹࠓޙ΋ͦͷ఺Λௐ΂͍͖͍ͯͨɻ

  20. ࠷ޙʹએ఻ 2/21ʹOrigami͞ΜͰfastlaneษڧձ΍Γ·͢ʂ

  21. WAmazingͰ͸iOSΤϯδχΞΛืू͍ͯ͠·͢ʂ We are hiring!! They

  22. ͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ɻ

  23. ࢀߟ ɾManaging Xcode ɹ(https://pewpewthespells.com/blog/managing_xcode.html#target-agg) ɾSwiftLint ɹ(https://github.com/realm/SwiftLint) ɾmixpanel-swift ɹ(https://github.com/mixpanel/mixpanel-swift/issues/57) ɾrealm-cocoa ɹ(https://github.com/realm/realm-cocoa)