danger-xcode_summary 0.5.3 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (151) hide show
  1. checksums.yaml +4 -4
  2. data/.gitattributes +1 -0
  3. data/.rubocop.yml +4 -0
  4. data/.travis.yml +8 -0
  5. data/Gemfile +2 -0
  6. data/Gemfile.lock +4 -2
  7. data/Guardfile +2 -0
  8. data/README.md +10 -30
  9. data/Rakefile +2 -0
  10. data/danger-xcode_summary.gemspec +3 -2
  11. data/lib/xcode_summary/gem_version.rb +1 -1
  12. data/lib/xcode_summary/plugin.rb +84 -144
  13. data/spec/fixtures/build_error.xcresult/Data/data.0~8rlpy8Zk2MdRSU0KgHQ-dzLsgOGyu-14Vc-N0xpF5NjTgHQgt3Y2C80SFK9G34F8tFCT42Ddo_9fUgkxBW3O9w== +0 -0
  14. data/spec/fixtures/build_error.xcresult/Data/data.0~IRr5bjJHBy3PCL5WuT9beYwr1YJflTZAOvsiw4f8sjvfJO1N516fkBcRW8rzgz3AkdAAidUfmPabPcZq3iarbA== +0 -0
  15. data/spec/fixtures/build_error.xcresult/Data/data.0~M95TCFtTnRKHBi17FlVGNc2kRMfbb_nRcsKPCf3ttPQyiTHHtDZhXhZ7cyeQ_qQ4zMKPS6y7I0oN4BKz0S4Uwg== +1 -0
  16. data/spec/fixtures/build_error.xcresult/Data/data.0~R8E9aNLCgS5_YXRF2Ugae_CaCFKR0ScZt9yP6r7ov-20PVARt7VwmAHWg2P6EBKQXm2TML95dp7BNnz9vunkBw== +0 -0
  17. data/spec/fixtures/build_error.xcresult/Data/data.0~YHIIkYp8-XSCi9oQYeEXZLa8EYpvUizVzEQGN5YmnJtTfJ4ujBdfy2EVAk8cUl8jtQskdFE84I-7eu59N9_pLA== +1 -0
  18. data/spec/fixtures/build_error.xcresult/Data/data.0~oBktD27DLW9QTHTv0MDsoaN2N6qCqZMwiFJeX7RwARc9fFan5V2awd_aThA9ZdCFTmHTSrdRglfQ5-ry9bJBUQ== +0 -0
  19. data/spec/fixtures/build_error.xcresult/Data/data.0~sMF2ys5sALLwuAv5pBXjiul46mqlgymNeLHDD_y99cE5gPqv8vL-IHIBlpnlNYSO4VvKHlaNafxanp-NDJTh-A== +0 -0
  20. data/spec/fixtures/build_error.xcresult/Data/refs.0~8rlpy8Zk2MdRSU0KgHQ-dzLsgOGyu-14Vc-N0xpF5NjTgHQgt3Y2C80SFK9G34F8tFCT42Ddo_9fUgkxBW3O9w== +0 -0
  21. data/spec/fixtures/build_error.xcresult/Data/refs.0~IRr5bjJHBy3PCL5WuT9beYwr1YJflTZAOvsiw4f8sjvfJO1N516fkBcRW8rzgz3AkdAAidUfmPabPcZq3iarbA== +0 -0
  22. data/spec/fixtures/build_error.xcresult/Data/refs.0~M95TCFtTnRKHBi17FlVGNc2kRMfbb_nRcsKPCf3ttPQyiTHHtDZhXhZ7cyeQ_qQ4zMKPS6y7I0oN4BKz0S4Uwg== +0 -0
  23. data/spec/fixtures/build_error.xcresult/Data/refs.0~R8E9aNLCgS5_YXRF2Ugae_CaCFKR0ScZt9yP6r7ov-20PVARt7VwmAHWg2P6EBKQXm2TML95dp7BNnz9vunkBw== +0 -0
  24. data/spec/fixtures/build_error.xcresult/Data/refs.0~YHIIkYp8-XSCi9oQYeEXZLa8EYpvUizVzEQGN5YmnJtTfJ4ujBdfy2EVAk8cUl8jtQskdFE84I-7eu59N9_pLA== +0 -0
  25. data/spec/fixtures/build_error.xcresult/Data/refs.0~oBktD27DLW9QTHTv0MDsoaN2N6qCqZMwiFJeX7RwARc9fFan5V2awd_aThA9ZdCFTmHTSrdRglfQ5-ry9bJBUQ== +0 -0
  26. data/spec/fixtures/build_error.xcresult/Data/refs.0~sMF2ys5sALLwuAv5pBXjiul46mqlgymNeLHDD_y99cE5gPqv8vL-IHIBlpnlNYSO4VvKHlaNafxanp-NDJTh-A== +0 -0
  27. data/spec/fixtures/build_error.xcresult/Info.plist +29 -0
  28. data/spec/fixtures/pr_json.json +2 -2
  29. data/spec/fixtures/swiftlint.xcresult/Data/data.0~0-xWm2AiZ5I3ekRhpAO8g4-GGm1rZIaTIaO2e60GD8nRSProBd-a_Yc1i7HKUd7bcVhfz2trCFFjRoELo2Srsw== +1 -0
  30. data/spec/fixtures/swiftlint.xcresult/Data/data.0~0OZeLqccmhzjAKAPA0eS1xbrEYM0PXX1u6A91vWH_ALTk8ho004_4kSNB9wC5XH28w-WgXxARYsmR5za20WacA== +0 -0
  31. data/spec/fixtures/swiftlint.xcresult/Data/data.0~0S6H6SLQKxWYgRYf_D_1IY-6QHDo-BsTnbSwsmikZV81avlhu5M1VAH-NOUVMY64xcmrqOJTvhE3NuQQTem2Cw== +1 -0
  32. data/spec/fixtures/swiftlint.xcresult/Data/data.0~2kkEPYCm3NJ7Qa1mJdA2u8iJvxvealDfVga3ndyyZs38sQL36q1IX7MYvrKo4eDbd-nyAQ96ZvSgaqpY4LJS1g== +0 -0
  33. data/spec/fixtures/swiftlint.xcresult/Data/data.0~3_PlvRIvUTDBxcDG2Xfka2hgB7TiNgptAFA36_GXRa52Nvcr0scZcjFMT5dD_zIOEF07s48D6roAaO5Fuhqm4A== +0 -0
  34. data/spec/fixtures/swiftlint.xcresult/Data/data.0~4G0wQRF6xQNh3N32d9TJzcahHXtF9nsz9VnT8U0otA3r2iR598yAPi99CNnJ6RdVZdbjKKM5mOz4wlM-xL99GQ== +0 -0
  35. data/spec/fixtures/swiftlint.xcresult/Data/data.0~4ybc14a0wWeJTE6Wyco_E5GMC4AV1uhumwDmYN_qe_Xatx7ngcL09_ef5aIBySSqpNNu4zcclYpHn9GrlNRuFQ== +1 -0
  36. data/spec/fixtures/swiftlint.xcresult/Data/data.0~6gayYzI1pf7Ae5plNUTUjxPN56sJMCVjiFgbL47tofr0MkqR24pCBQ_WR8ObwxOF1d0CMgO6xzegongDrChlJg== +1 -0
  37. data/spec/fixtures/swiftlint.xcresult/Data/data.0~8IYU0zHEOjhUXKlujKg1LRsjykPpzvWzofthV0L5wC4B7k8gHyaZ-7cZuqFSoPtzJazWCx-EKgYEH2IqJWzfEg== +0 -0
  38. data/spec/fixtures/swiftlint.xcresult/Data/data.0~8sQuTfDcyJlc0Fi-_NLh3a8jvYBs_okTaD87IqdKyCzN32fu0jp6ApVWBgFD38xL2_Q87YDxQ6IxUZv7NNvqow== +1 -0
  39. data/spec/fixtures/swiftlint.xcresult/Data/data.0~CJoU5w7TNA2we8IxsH6JLXhJ2Tgwn4MNMGYzl5g5KiXF8gJQm6HlNTnQ1LSu2ISGxTLCQ9g-epXuzLU5utBfFA== +0 -0
  40. data/spec/fixtures/swiftlint.xcresult/Data/data.0~E-76cUuxKNsc00En6QiGIdNWgUkhPKWbzbY-g7Xs1I8QHEMM8XUyKPxeMCp0ZXs_s4n1v1-sgg4Cr_BgvCBB6Q== +1 -0
  41. data/spec/fixtures/swiftlint.xcresult/Data/data.0~ES9w2o-hBWjCbFGFTzMnh3Y8PpOwPGSGtWZ9X9jy-xdmxdZNKNzsKpz5MRG0TSYYKul6Y0HPDMb6NUx1KCvp1g== +0 -0
  42. data/spec/fixtures/swiftlint.xcresult/Data/data.0~H9Ox0jwnLyzNmCS9JM53xW5lgvG9wCoyFrOocfEMniMt9ZomGQCEAkcpEABl2RAkEJrYWhbW_Rrvy0_m93Jnnw== +0 -0
  43. data/spec/fixtures/swiftlint.xcresult/Data/data.0~LCIporNdr1dPYSczSS8zeRwLlf3Cq-xsjXgA0FzrCLqqpRmUcrJDAa5R7STT0lyZeGi2M13jXHyGZ5rZ7qCrrQ== +0 -0
  44. data/spec/fixtures/swiftlint.xcresult/Data/data.0~LpdFNGBXQ0G_AiEBUv6jWVmPykDLvumWlLqe9FOU9Sautm_uAIUhkdYsC3Ai7CHCV6Ec_A9EgLa5dzbuBuSm0Q== +1 -0
  45. data/spec/fixtures/swiftlint.xcresult/Data/data.0~MPQdxkf7R97XmBRC6k_HRasY3Wpzf6Ji9mPhXyPVbkbZreWJ4iOdeDBLCRqR2Jn_ffDNfJCvU4gSl6NdwqltzA== +0 -0
  46. data/spec/fixtures/swiftlint.xcresult/Data/data.0~Mbg926q5J0cd3yItw2ktYihgAmF3Bs3imeg-AgyGMQYnQx0IUUFlnuY3xldjSVaGFNU4N892Usibic6TZXFbTw== +0 -0
  47. data/spec/fixtures/swiftlint.xcresult/Data/data.0~OZKuCYOwI0z3jDNmJQ-bb0OUCKuFWw1iz9Na6m-M3pOyVRqP09YONvdvG1ezCE57EI5b8Ym9g8hX1ZVZJg124w== +1 -0
  48. data/spec/fixtures/swiftlint.xcresult/Data/data.0~P1yCjbYuC-f-Yp5vY3jDumuu5B5U2_SdjxLObNcTH3XZMXTGlY9I20IlZP6UkWOIIPSr4IYewBY82b4sq82ldw== +0 -0
  49. data/spec/fixtures/swiftlint.xcresult/Data/data.0~PgE51YCf92l9xvNpSiVbHOmsnaRpxz_zGezAUjflsYK7nfGH7YRTDdb1jnNn0WlHUlme8-fO8fPQRJ9n51hfPg== +1 -0
  50. data/spec/fixtures/swiftlint.xcresult/Data/data.0~QLGQgkmvGM1G0GFHWwBAJoAn881RCWKI51niXWwchH2k_1ahgBUMANJWO98yUC5HwqptnBQLC0aoD4GE7Zb3Yg== +1 -0
  51. data/spec/fixtures/swiftlint.xcresult/Data/data.0~QdTITudcOZvjswLWT8gvlQMZHVJJ5yA_GP2ZKrevsgAbABDadn3tsrUH4rbPPD0HZeZVi5oDNPTcqoaMnueJ6A== +0 -0
  52. data/spec/fixtures/swiftlint.xcresult/Data/data.0~TNVRLj0efZi3RNElgmBqJ-AnCofs0p8pnjLDsQw2TMFPfg6driapeVvOlnsFyOS_27P7ZHNiLt2xJ9kiE57VlA== +0 -0
  53. data/spec/fixtures/swiftlint.xcresult/Data/data.0~Vo-bwGSGWiUUFgBwAGdskHUHwVQh0q8hYJmYmmyHI4AVhbtLsMeJQyYvHOuTuPmJcJsX_4bDig3Mg1GPwE9oWw== +1 -0
  54. data/spec/fixtures/swiftlint.xcresult/Data/data.0~YBV5ZYd3le3PYE4Xz7kCb4sj6ZJ25X18ArIVKxMOCZHZ479XzQByz07m8qpm3hIL3oUPozbag-zRSomHuRfKLQ== +1 -0
  55. data/spec/fixtures/swiftlint.xcresult/Data/data.0~ZYx73XhABxgrY0rQpAJbZMCn_MDQFCJimII9c-ninClo_0ZErb0fGcXrX-8AkQ_8ngCyX1YyDzb825PzreCLFg== +0 -0
  56. data/spec/fixtures/swiftlint.xcresult/Data/data.0~_Vk-6Z65ePcSA8pCiCFHA53AP-PRZ6KqdEH_Su2CQbd3QM7P-By063lIn7SyLdlE1ENrRCOL_9VFHwb6Q2de4A== +0 -0
  57. data/spec/fixtures/swiftlint.xcresult/Data/data.0~aBrGz65aeXPVqACvo49xELHeqBawlmly6M_SmRa-iT99yzTiBp2st43mhwZEOVIgvsBEHLkKbH5oQpqjWgkueA== +0 -0
  58. data/spec/fixtures/swiftlint.xcresult/Data/data.0~amieE2Vo8zyuqmVg_XehREgJFzuJaWOzAODZVk_7d1g6p6Y_sPmomY580XqThK7-5nyr3Z3ZX8PBps4zPLU86A== +0 -0
  59. data/spec/fixtures/swiftlint.xcresult/Data/data.0~bC3ChphZGxwicYgFPaTJhJvXLOQJmKnAxXU_qdERqu-B1727kHJX61TfzqMUqRiPUwu5E9r_5RH_xoRYJ2L6gQ== +1 -0
  60. data/spec/fixtures/swiftlint.xcresult/Data/data.0~dKm5kNy23i7r5zU946OFV5V5VysbNcVshgmPE1cDjnTybi4d2hDYQHf5DDhl2cd8blicZGSNT1U56_sMCeKgGA== +0 -0
  61. data/spec/fixtures/swiftlint.xcresult/Data/data.0~fOlw5DSt-BTx_3MEsZueO9WvR0v7M_4Qox6aT8izuwPfWLYDmQLCsC3_Hymzu9pvNdnU-hnLmqI7VHwds0tZJg== +0 -0
  62. data/spec/fixtures/swiftlint.xcresult/Data/data.0~fQN-Kpy21p-A8sCOyS-jK7ytWncDa2hFDzVN8GFtbxfcsSDqHuHlelgGVDfMRGaCjl0_YvECcpxkOXMSCMz-yA== +0 -0
  63. data/spec/fixtures/swiftlint.xcresult/Data/data.0~fg_OE_1GIKhnHZVCf6vX3IBffLrmbWUH4AsgsdCfNDOxp0B_FS01mzFt8QUR8SFpl0wzqzGZLqQjyYhO6RevrQ== +1 -0
  64. data/spec/fixtures/swiftlint.xcresult/Data/data.0~gan-cZ22YZhS_xIHkTo3QDwbZPFY4kFjFla450U2lB0YvYEyKbq78RSwEXNISk5oLbXL4hT7MUx_j9YlvordmQ== +0 -0
  65. data/spec/fixtures/swiftlint.xcresult/Data/data.0~gullQKRfJbsVcDBXIhfPjmm5JnaE0Beei-34BEkBv4R4RAuRHQMSnctdI5JXfKywafaWXcpQiYYRa9ukH7dA8w== +0 -0
  66. data/spec/fixtures/swiftlint.xcresult/Data/data.0~ifHHINpGjhER45qG-5imtXxa30gPYyHpFGHLw-i9F-M4nTjIGxvHkfprtACth9aAoeu7xyBFp9i0NZuPFaK-qQ== +0 -0
  67. data/spec/fixtures/swiftlint.xcresult/Data/data.0~j4nemHY9VBZOlHsEur0YydlrsprTU9r-MZEFaCsZ71qzr_Y2j_wX_zeb8BIyCfQq6WCHDuJGwCvDxYGxFHFKJQ== +1 -0
  68. data/spec/fixtures/swiftlint.xcresult/Data/data.0~jLNWr6BK3vDe2KRCbTLDhymPjtRFa0UT1BKEjXSbv29IXEwjhP4bUKt6LMUdkCtM4FvPlQ8z7YOpAYFoZFSPOA== +0 -0
  69. data/spec/fixtures/swiftlint.xcresult/Data/data.0~jLxEh4TDlOXovDeeA90ahrPFfK6KWCWAM1RveDzpglwOI01s2gFfzKcZ5uuMA4PDXedeCvNf2DqCdKJIcgHnVQ== +1 -0
  70. data/spec/fixtures/swiftlint.xcresult/Data/data.0~lDipbRFZoMGAPyIHXNVPjW96huFRLV5fDc8iChQGTp2D1rW9Y3yat6jqgAUFtF94uKKChvQXQU2YOrKELWTWRQ== +0 -0
  71. data/spec/fixtures/swiftlint.xcresult/Data/data.0~m1Fg2athRJukt11SG2HxPjSj8K7CqPcdkSiJSNtxUGsVPezdEjZT_PPnBkROObmplPJ7SQmO9ccwDfGagdcKLg== +0 -0
  72. data/spec/fixtures/swiftlint.xcresult/Data/data.0~oRMi0sbQLktfDDDGUS-SqBKpdDiD6HCztVES_ShfGr0KVcYENoIq7y9oUSDWL5B_P2gkdtWG8JEsJLxPbdWOZA== +0 -0
  73. data/spec/fixtures/swiftlint.xcresult/Data/data.0~oRai0E4F38qqrWTBu_VggauLdzUNvBJ9uOpjjW4rdru1cdBUSmJsWp7wGRoTaegMas7lrFfF7hqYW76UAkN_Aw== +1 -0
  74. data/spec/fixtures/swiftlint.xcresult/Data/data.0~oc4kwngaTuUPiuwoua8qsQolC7-ZoEhH98wttJsSLjXvqDEIcMSdd0Y06IcfLovOve5P5sgs01gVV9FxgA9Cgg== +0 -0
  75. data/spec/fixtures/swiftlint.xcresult/Data/data.0~pfWL_0E_rKWkISZ_-ykT-jtTq0T1Bs4pRoI0Rvd1L48EF2pJwep6TzEd_f2AXvlBLDYPKU_8b0hRyDco495MuA== +0 -0
  76. data/spec/fixtures/swiftlint.xcresult/Data/data.0~qvKb6_pMbXLkop24YkPLBvBGPB0vTCJVE1x5_F3lvNeXSrkS-aTEVLcbm50ypOEDTvq5lWbE3WCTmiwTrycTtA== +1 -0
  77. data/spec/fixtures/swiftlint.xcresult/Data/data.0~rWtEuNODRlqS4h5IKE2daTjC3jn_FFVbc5AFmP9pWRCMe5Pnl26q-RtgyD_RKEch9v3KhAMX6v_o_6tAvVJqCA== +0 -0
  78. data/spec/fixtures/swiftlint.xcresult/Data/data.0~ryOJ0LA52DIkg1NBt38A9g4laq_cWjst7WaY2GqaYbfcPtErYNGwwseRWOUJ888fdbPpei28zwb3FQmyyY0P7A== +1 -0
  79. data/spec/fixtures/swiftlint.xcresult/Data/data.0~ufMI-FnN2y3q-eI9BtVFtGpA8_fkrqmtH5a6cmoMsFqJdZ7LAFu1X1f-KhV78VbCx3NJFw-Z37YrEEheJ0aoew== +0 -0
  80. data/spec/fixtures/swiftlint.xcresult/Data/data.0~vFXD8mGF6_qQ0OnB0Wcon_YnvTiD4pn7MUywowp2zOVLErpHH1Ub9F67rFgJUj5qH44PC8HGhivGatweCwtA1g== +0 -0
  81. data/spec/fixtures/swiftlint.xcresult/Data/data.0~xgcJ3zOq4tRMu41EmxgQwt9WxpLQm2v2wbY1e8CAQ8EEYhNYnBcMTAFjYWFgIg4LKguSsH1Djbu9dtiDJ6ZXww== +1 -0
  82. data/spec/fixtures/swiftlint.xcresult/Data/data.0~ygm24RJKzu1R3AxMJebgBRXDXv1XqRs_UZUYB9XNRQlwNRqHlLdmUDM2A0c5MZ0rM9Rzk8J6DVpUtgbXCqdEig== +1 -0
  83. data/spec/fixtures/swiftlint.xcresult/Data/data.0~z0TKqUleKKN7fLZIVvFv3iQkQDn9im3HWNWKHBCNC0CrWtbKyMM79u3yFkfV0iz5I-pyszXp3C532_0QdYPUlA== +0 -0
  84. data/spec/fixtures/swiftlint.xcresult/Data/data.0~zs6Rgx87_LJyVnCSv0mqZMG6J9lpsTcTg9rpJsB_IBDSH2MQBeY5mGj-C3dLPzD8HFtKiumJ9EcGo-mGYqnZvQ== +0 -0
  85. data/spec/fixtures/swiftlint.xcresult/Data/refs.0~0-xWm2AiZ5I3ekRhpAO8g4-GGm1rZIaTIaO2e60GD8nRSProBd-a_Yc1i7HKUd7bcVhfz2trCFFjRoELo2Srsw== +0 -0
  86. data/spec/fixtures/swiftlint.xcresult/Data/refs.0~0OZeLqccmhzjAKAPA0eS1xbrEYM0PXX1u6A91vWH_ALTk8ho004_4kSNB9wC5XH28w-WgXxARYsmR5za20WacA== +0 -0
  87. data/spec/fixtures/swiftlint.xcresult/Data/refs.0~0S6H6SLQKxWYgRYf_D_1IY-6QHDo-BsTnbSwsmikZV81avlhu5M1VAH-NOUVMY64xcmrqOJTvhE3NuQQTem2Cw== +0 -0
  88. data/spec/fixtures/swiftlint.xcresult/Data/refs.0~2kkEPYCm3NJ7Qa1mJdA2u8iJvxvealDfVga3ndyyZs38sQL36q1IX7MYvrKo4eDbd-nyAQ96ZvSgaqpY4LJS1g== +0 -0
  89. data/spec/fixtures/swiftlint.xcresult/Data/refs.0~3_PlvRIvUTDBxcDG2Xfka2hgB7TiNgptAFA36_GXRa52Nvcr0scZcjFMT5dD_zIOEF07s48D6roAaO5Fuhqm4A== +0 -0
  90. data/spec/fixtures/swiftlint.xcresult/Data/refs.0~4G0wQRF6xQNh3N32d9TJzcahHXtF9nsz9VnT8U0otA3r2iR598yAPi99CNnJ6RdVZdbjKKM5mOz4wlM-xL99GQ== +0 -0
  91. data/spec/fixtures/swiftlint.xcresult/Data/refs.0~4ybc14a0wWeJTE6Wyco_E5GMC4AV1uhumwDmYN_qe_Xatx7ngcL09_ef5aIBySSqpNNu4zcclYpHn9GrlNRuFQ== +0 -0
  92. data/spec/fixtures/swiftlint.xcresult/Data/refs.0~6gayYzI1pf7Ae5plNUTUjxPN56sJMCVjiFgbL47tofr0MkqR24pCBQ_WR8ObwxOF1d0CMgO6xzegongDrChlJg== +0 -0
  93. data/spec/fixtures/swiftlint.xcresult/Data/refs.0~8IYU0zHEOjhUXKlujKg1LRsjykPpzvWzofthV0L5wC4B7k8gHyaZ-7cZuqFSoPtzJazWCx-EKgYEH2IqJWzfEg== +0 -0
  94. data/spec/fixtures/swiftlint.xcresult/Data/refs.0~8sQuTfDcyJlc0Fi-_NLh3a8jvYBs_okTaD87IqdKyCzN32fu0jp6ApVWBgFD38xL2_Q87YDxQ6IxUZv7NNvqow== +0 -0
  95. data/spec/fixtures/swiftlint.xcresult/Data/refs.0~CJoU5w7TNA2we8IxsH6JLXhJ2Tgwn4MNMGYzl5g5KiXF8gJQm6HlNTnQ1LSu2ISGxTLCQ9g-epXuzLU5utBfFA== +0 -0
  96. data/spec/fixtures/swiftlint.xcresult/Data/refs.0~E-76cUuxKNsc00En6QiGIdNWgUkhPKWbzbY-g7Xs1I8QHEMM8XUyKPxeMCp0ZXs_s4n1v1-sgg4Cr_BgvCBB6Q== +0 -0
  97. data/spec/fixtures/swiftlint.xcresult/Data/refs.0~ES9w2o-hBWjCbFGFTzMnh3Y8PpOwPGSGtWZ9X9jy-xdmxdZNKNzsKpz5MRG0TSYYKul6Y0HPDMb6NUx1KCvp1g== +0 -0
  98. data/spec/fixtures/swiftlint.xcresult/Data/refs.0~H9Ox0jwnLyzNmCS9JM53xW5lgvG9wCoyFrOocfEMniMt9ZomGQCEAkcpEABl2RAkEJrYWhbW_Rrvy0_m93Jnnw== +0 -0
  99. data/spec/fixtures/swiftlint.xcresult/Data/refs.0~LCIporNdr1dPYSczSS8zeRwLlf3Cq-xsjXgA0FzrCLqqpRmUcrJDAa5R7STT0lyZeGi2M13jXHyGZ5rZ7qCrrQ== +0 -0
  100. data/spec/fixtures/swiftlint.xcresult/Data/refs.0~LpdFNGBXQ0G_AiEBUv6jWVmPykDLvumWlLqe9FOU9Sautm_uAIUhkdYsC3Ai7CHCV6Ec_A9EgLa5dzbuBuSm0Q== +0 -0
  101. data/spec/fixtures/swiftlint.xcresult/Data/refs.0~MPQdxkf7R97XmBRC6k_HRasY3Wpzf6Ji9mPhXyPVbkbZreWJ4iOdeDBLCRqR2Jn_ffDNfJCvU4gSl6NdwqltzA== +0 -0
  102. data/spec/fixtures/swiftlint.xcresult/Data/refs.0~Mbg926q5J0cd3yItw2ktYihgAmF3Bs3imeg-AgyGMQYnQx0IUUFlnuY3xldjSVaGFNU4N892Usibic6TZXFbTw== +0 -0
  103. data/spec/fixtures/swiftlint.xcresult/Data/refs.0~OZKuCYOwI0z3jDNmJQ-bb0OUCKuFWw1iz9Na6m-M3pOyVRqP09YONvdvG1ezCE57EI5b8Ym9g8hX1ZVZJg124w== +0 -0
  104. data/spec/fixtures/swiftlint.xcresult/Data/refs.0~P1yCjbYuC-f-Yp5vY3jDumuu5B5U2_SdjxLObNcTH3XZMXTGlY9I20IlZP6UkWOIIPSr4IYewBY82b4sq82ldw== +0 -0
  105. data/spec/fixtures/swiftlint.xcresult/Data/refs.0~PgE51YCf92l9xvNpSiVbHOmsnaRpxz_zGezAUjflsYK7nfGH7YRTDdb1jnNn0WlHUlme8-fO8fPQRJ9n51hfPg== +0 -0
  106. data/spec/fixtures/swiftlint.xcresult/Data/refs.0~QLGQgkmvGM1G0GFHWwBAJoAn881RCWKI51niXWwchH2k_1ahgBUMANJWO98yUC5HwqptnBQLC0aoD4GE7Zb3Yg== +0 -0
  107. data/spec/fixtures/swiftlint.xcresult/Data/refs.0~QdTITudcOZvjswLWT8gvlQMZHVJJ5yA_GP2ZKrevsgAbABDadn3tsrUH4rbPPD0HZeZVi5oDNPTcqoaMnueJ6A== +0 -0
  108. data/spec/fixtures/swiftlint.xcresult/Data/refs.0~TNVRLj0efZi3RNElgmBqJ-AnCofs0p8pnjLDsQw2TMFPfg6driapeVvOlnsFyOS_27P7ZHNiLt2xJ9kiE57VlA== +0 -0
  109. data/spec/fixtures/swiftlint.xcresult/Data/refs.0~Vo-bwGSGWiUUFgBwAGdskHUHwVQh0q8hYJmYmmyHI4AVhbtLsMeJQyYvHOuTuPmJcJsX_4bDig3Mg1GPwE9oWw== +0 -0
  110. data/spec/fixtures/swiftlint.xcresult/Data/refs.0~YBV5ZYd3le3PYE4Xz7kCb4sj6ZJ25X18ArIVKxMOCZHZ479XzQByz07m8qpm3hIL3oUPozbag-zRSomHuRfKLQ== +0 -0
  111. data/spec/fixtures/swiftlint.xcresult/Data/refs.0~ZYx73XhABxgrY0rQpAJbZMCn_MDQFCJimII9c-ninClo_0ZErb0fGcXrX-8AkQ_8ngCyX1YyDzb825PzreCLFg== +0 -0
  112. data/spec/fixtures/swiftlint.xcresult/Data/refs.0~_Vk-6Z65ePcSA8pCiCFHA53AP-PRZ6KqdEH_Su2CQbd3QM7P-By063lIn7SyLdlE1ENrRCOL_9VFHwb6Q2de4A== +0 -0
  113. data/spec/fixtures/swiftlint.xcresult/Data/refs.0~aBrGz65aeXPVqACvo49xELHeqBawlmly6M_SmRa-iT99yzTiBp2st43mhwZEOVIgvsBEHLkKbH5oQpqjWgkueA== +0 -0
  114. data/spec/fixtures/swiftlint.xcresult/Data/refs.0~amieE2Vo8zyuqmVg_XehREgJFzuJaWOzAODZVk_7d1g6p6Y_sPmomY580XqThK7-5nyr3Z3ZX8PBps4zPLU86A== +0 -0
  115. data/spec/fixtures/swiftlint.xcresult/Data/refs.0~bC3ChphZGxwicYgFPaTJhJvXLOQJmKnAxXU_qdERqu-B1727kHJX61TfzqMUqRiPUwu5E9r_5RH_xoRYJ2L6gQ== +0 -0
  116. data/spec/fixtures/swiftlint.xcresult/Data/refs.0~dKm5kNy23i7r5zU946OFV5V5VysbNcVshgmPE1cDjnTybi4d2hDYQHf5DDhl2cd8blicZGSNT1U56_sMCeKgGA== +0 -0
  117. data/spec/fixtures/swiftlint.xcresult/Data/refs.0~fOlw5DSt-BTx_3MEsZueO9WvR0v7M_4Qox6aT8izuwPfWLYDmQLCsC3_Hymzu9pvNdnU-hnLmqI7VHwds0tZJg== +0 -0
  118. data/spec/fixtures/swiftlint.xcresult/Data/refs.0~fQN-Kpy21p-A8sCOyS-jK7ytWncDa2hFDzVN8GFtbxfcsSDqHuHlelgGVDfMRGaCjl0_YvECcpxkOXMSCMz-yA== +0 -0
  119. data/spec/fixtures/swiftlint.xcresult/Data/refs.0~fg_OE_1GIKhnHZVCf6vX3IBffLrmbWUH4AsgsdCfNDOxp0B_FS01mzFt8QUR8SFpl0wzqzGZLqQjyYhO6RevrQ== +0 -0
  120. data/spec/fixtures/swiftlint.xcresult/Data/refs.0~gan-cZ22YZhS_xIHkTo3QDwbZPFY4kFjFla450U2lB0YvYEyKbq78RSwEXNISk5oLbXL4hT7MUx_j9YlvordmQ== +0 -0
  121. data/spec/fixtures/swiftlint.xcresult/Data/refs.0~gullQKRfJbsVcDBXIhfPjmm5JnaE0Beei-34BEkBv4R4RAuRHQMSnctdI5JXfKywafaWXcpQiYYRa9ukH7dA8w== +0 -0
  122. data/spec/fixtures/swiftlint.xcresult/Data/refs.0~ifHHINpGjhER45qG-5imtXxa30gPYyHpFGHLw-i9F-M4nTjIGxvHkfprtACth9aAoeu7xyBFp9i0NZuPFaK-qQ== +0 -0
  123. data/spec/fixtures/swiftlint.xcresult/Data/refs.0~j4nemHY9VBZOlHsEur0YydlrsprTU9r-MZEFaCsZ71qzr_Y2j_wX_zeb8BIyCfQq6WCHDuJGwCvDxYGxFHFKJQ== +0 -0
  124. data/spec/fixtures/swiftlint.xcresult/Data/refs.0~jLNWr6BK3vDe2KRCbTLDhymPjtRFa0UT1BKEjXSbv29IXEwjhP4bUKt6LMUdkCtM4FvPlQ8z7YOpAYFoZFSPOA== +0 -0
  125. data/spec/fixtures/swiftlint.xcresult/Data/refs.0~jLxEh4TDlOXovDeeA90ahrPFfK6KWCWAM1RveDzpglwOI01s2gFfzKcZ5uuMA4PDXedeCvNf2DqCdKJIcgHnVQ== +0 -0
  126. data/spec/fixtures/swiftlint.xcresult/Data/refs.0~lDipbRFZoMGAPyIHXNVPjW96huFRLV5fDc8iChQGTp2D1rW9Y3yat6jqgAUFtF94uKKChvQXQU2YOrKELWTWRQ== +0 -0
  127. data/spec/fixtures/swiftlint.xcresult/Data/refs.0~m1Fg2athRJukt11SG2HxPjSj8K7CqPcdkSiJSNtxUGsVPezdEjZT_PPnBkROObmplPJ7SQmO9ccwDfGagdcKLg== +0 -0
  128. data/spec/fixtures/swiftlint.xcresult/Data/refs.0~oRMi0sbQLktfDDDGUS-SqBKpdDiD6HCztVES_ShfGr0KVcYENoIq7y9oUSDWL5B_P2gkdtWG8JEsJLxPbdWOZA== +0 -0
  129. data/spec/fixtures/swiftlint.xcresult/Data/refs.0~oRai0E4F38qqrWTBu_VggauLdzUNvBJ9uOpjjW4rdru1cdBUSmJsWp7wGRoTaegMas7lrFfF7hqYW76UAkN_Aw== +0 -0
  130. data/spec/fixtures/swiftlint.xcresult/Data/refs.0~oc4kwngaTuUPiuwoua8qsQolC7-ZoEhH98wttJsSLjXvqDEIcMSdd0Y06IcfLovOve5P5sgs01gVV9FxgA9Cgg== +0 -0
  131. data/spec/fixtures/swiftlint.xcresult/Data/refs.0~pfWL_0E_rKWkISZ_-ykT-jtTq0T1Bs4pRoI0Rvd1L48EF2pJwep6TzEd_f2AXvlBLDYPKU_8b0hRyDco495MuA== +0 -0
  132. data/spec/fixtures/swiftlint.xcresult/Data/refs.0~qvKb6_pMbXLkop24YkPLBvBGPB0vTCJVE1x5_F3lvNeXSrkS-aTEVLcbm50ypOEDTvq5lWbE3WCTmiwTrycTtA== +0 -0
  133. data/spec/fixtures/swiftlint.xcresult/Data/refs.0~rWtEuNODRlqS4h5IKE2daTjC3jn_FFVbc5AFmP9pWRCMe5Pnl26q-RtgyD_RKEch9v3KhAMX6v_o_6tAvVJqCA== +0 -0
  134. data/spec/fixtures/swiftlint.xcresult/Data/refs.0~ryOJ0LA52DIkg1NBt38A9g4laq_cWjst7WaY2GqaYbfcPtErYNGwwseRWOUJ888fdbPpei28zwb3FQmyyY0P7A== +0 -0
  135. data/spec/fixtures/swiftlint.xcresult/Data/refs.0~ufMI-FnN2y3q-eI9BtVFtGpA8_fkrqmtH5a6cmoMsFqJdZ7LAFu1X1f-KhV78VbCx3NJFw-Z37YrEEheJ0aoew== +0 -0
  136. data/spec/fixtures/swiftlint.xcresult/Data/refs.0~vFXD8mGF6_qQ0OnB0Wcon_YnvTiD4pn7MUywowp2zOVLErpHH1Ub9F67rFgJUj5qH44PC8HGhivGatweCwtA1g== +0 -0
  137. data/spec/fixtures/swiftlint.xcresult/Data/refs.0~xgcJ3zOq4tRMu41EmxgQwt9WxpLQm2v2wbY1e8CAQ8EEYhNYnBcMTAFjYWFgIg4LKguSsH1Djbu9dtiDJ6ZXww== +0 -0
  138. data/spec/fixtures/swiftlint.xcresult/Data/refs.0~ygm24RJKzu1R3AxMJebgBRXDXv1XqRs_UZUYB9XNRQlwNRqHlLdmUDM2A0c5MZ0rM9Rzk8J6DVpUtgbXCqdEig== +0 -0
  139. data/spec/fixtures/swiftlint.xcresult/Data/refs.0~z0TKqUleKKN7fLZIVvFv3iQkQDn9im3HWNWKHBCNC0CrWtbKyMM79u3yFkfV0iz5I-pyszXp3C532_0QdYPUlA== +0 -0
  140. data/spec/fixtures/swiftlint.xcresult/Data/refs.0~zs6Rgx87_LJyVnCSv0mqZMG6J9lpsTcTg9rpJsB_IBDSH2MQBeY5mGj-C3dLPzD8HFtKiumJ9EcGo-mGYqnZvQ== +0 -0
  141. data/spec/fixtures/swiftlint.xcresult/Info.plist +29 -0
  142. data/spec/spec_helper.rb +3 -0
  143. data/spec/xcode_summary_spec.rb +90 -105
  144. metadata +274 -17
  145. data/spec/fixtures/errors.json +0 -31
  146. data/spec/fixtures/ld_warnings.json +0 -31
  147. data/spec/fixtures/summary.json +0 -44
  148. data/spec/fixtures/summary_messages.json +0 -5
  149. data/spec/fixtures/summary_with_empty_line.json +0 -37
  150. data/spec/fixtures/test_errors.json +0 -11
  151. data/spec/fixtures/warnings_errors.json +0 -32
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3207822c2dfeb0e69985f941835fa80d06ed3d0ae43e27576a2bcc72bfe8aea3
4
- data.tar.gz: 17cb5713024a7874cf08d0f1fb1708bfacf53d865f889eaa1b76dbe2fa28342f
3
+ metadata.gz: e30986734f1f4563b6c7f58e5765cb2b00be9bf4cc86ae03c88485d429009e3e
4
+ data.tar.gz: 570891d22c3fbb5a9b2cdbb61dab1833ac8570013e0c2689886b78702cbff368
5
5
  SHA512:
6
- metadata.gz: 8ee02ac8c805c7f49a739e4384b656cfe24e81c04f2ff0ae108b0e78616d4b84a5ed846fa9784af99801016254434fe027541b1f4044f26265e31363de25147d
7
- data.tar.gz: ba9211234bc2a64d42fbabee964bbe55ad12e18a48b6e6f7df53d4dee15809c20bb7e4615e66cf669d49ed4e86378cd7678c2f8b3f164b101f1a1e3cafb880ea
6
+ metadata.gz: dac17c30dbeaf27f6b026c82f213a8d6ede70623c05bd811ab352957dde61b9a7c402ebca595146b161b8a82c3405e7cc93002c950363aa4262bee9d17267f76
7
+ data.tar.gz: 32db5f742803b7cc51d46be5825a644be65d40c89b790db6cfad3e15312b099f58912b7febb542767ee0dd8ef63fd703a059ae20c2b80ee1765bdea8dbdbf05b
data/.gitattributes ADDED
@@ -0,0 +1 @@
1
+ *.xcresult binary
data/.rubocop.yml CHANGED
@@ -1,3 +1,7 @@
1
+ AllCops:
2
+ NewCops: enable
3
+ SuggestExtensions: false
4
+
1
5
  # kind_of? is a good way to check a type
2
6
  Style/ClassCheck:
3
7
  EnforcedStyle: kind_of?
data/.travis.yml CHANGED
@@ -3,9 +3,17 @@ cache:
3
3
  directories:
4
4
  - bundle
5
5
 
6
+ os: osx
7
+ osx_image: xcode11
8
+
6
9
  rvm:
7
10
  - 2.6.0
8
11
  - 2.5.3
9
12
 
13
+ # install bundler 2.x
14
+ before_install:
15
+ - gem update --system
16
+ - gem install bundler
17
+
10
18
  script:
11
19
  - bundle exec rake spec
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  # Specify your gem's dependencies in danger-xcode_summary.gemspec
data/Gemfile.lock CHANGED
@@ -1,8 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- danger-xcode_summary (0.5.3)
4
+ danger-xcode_summary (1.0.0)
5
5
  danger-plugin-api (~> 1.0)
6
+ xcresult (~> 0.2)
6
7
 
7
8
  GEM
8
9
  remote: https://rubygems.org/
@@ -137,6 +138,7 @@ GEM
137
138
  unicode-display_width (>= 1.1.1, < 3)
138
139
  thor (1.1.0)
139
140
  unicode-display_width (2.0.0)
141
+ xcresult (0.2.1)
140
142
  yard (0.9.26)
141
143
 
142
144
  PLATFORMS
@@ -156,4 +158,4 @@ DEPENDENCIES
156
158
  yard
157
159
 
158
160
  BUNDLED WITH
159
- 2.2.17
161
+ 2.2.26
data/Guardfile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # A guardfile for making Danger Plugins
2
4
  # For more info see https://github.com/guard/guard#readme
3
5
 
data/README.md CHANGED
@@ -6,12 +6,6 @@
6
6
 
7
7
  A [Danger](http://danger.systems) plugin that shows all build errors, warnings and unit tests results generated from `xcodebuild`.
8
8
 
9
- You need to use [xcpretty](https://github.com/supermarin/xcpretty) with
10
- [xcpretty-json-formatter](https://github.com/marcelofabri/xcpretty-json-formatter)
11
- to generate a JSON file that this plugin can read.
12
-
13
- **Using [danger-swift](https://github.com/danger/swift)**? You may want to take a look at [danger-swift-xcodesummary](https://github.com/f-meloni/danger-swift-xcodesummary).
14
-
15
9
  ## How does it look?
16
10
 
17
11
  <table>
@@ -62,24 +56,6 @@ to generate a JSON file that this plugin can read.
62
56
  </tbody>
63
57
  </table>
64
58
 
65
- <table>
66
- <thead>
67
- <tr>
68
- <th width="50"></th>
69
- <th width="100%">
70
- 1 Message
71
- </th>
72
- </tr>
73
- </thead>
74
- <tbody>
75
- <tr>
76
- <td><g-emoji alias="book" fallback-src="https://assets-cdn.github.com/images/icons/emoji/unicode/1f4d6.png">📖</g-emoji></td>
77
- <td>Executed 5 tests, with 1 failure (0 unexpected) in 0.032 (0.065) seconds</td>
78
- </tr>
79
- </tr>
80
- </tbody>
81
- </table>
82
-
83
59
  ## Installation
84
60
 
85
61
  Add this line to your Gemfile:
@@ -93,9 +69,13 @@ gem 'danger-xcode_summary'
93
69
  Just add this line to your `Dangerfile`:
94
70
 
95
71
  ```ruby
96
- xcode_summary.report 'xcodebuild.json'
72
+ xcode_summary.report 'MyApp.xcresult'
97
73
  ```
98
74
 
75
+ You need to pass the path of the `xcresult` generated after compiling your app.
76
+ By default, this is inside the `DerivedData` for your project, but you can use the `-resultBundlePath`
77
+ flag when calling `xcodebuild` to customize its path. You can read more about it in this [blog post from the folks at PSPDFKit](https://pspdfkit.com/blog/2021/deflaking-ci-tests-with-xcresults/#using-xcresult-bundles).
78
+
99
79
  You can also ignore warnings from certain files by setting `ignored_files`:
100
80
  Warning: `ignored_files` patterns applied on relative paths.
101
81
 
@@ -105,10 +85,10 @@ xcode_summary.ignored_files = 'Pods/**'
105
85
 
106
86
  # Ignoring specific warnings
107
87
  xcode_summary.ignored_results { |result|
108
- result.message.start_with? 'ld' # Ignore ld_warnings
88
+ result.message.include? 'ld' # Ignore ld_warnings
109
89
  }
110
90
 
111
- xcode_summary.report 'xcodebuild.json'
91
+ xcode_summary.report 'MyApp.xcresult'
112
92
  ```
113
93
 
114
94
  You can use `ignores_warnings` to supress warnings and shows only errors.
@@ -123,13 +103,13 @@ When this value is enabled, each warnings and errors are commented on each lines
123
103
  ```ruby
124
104
  # Comment on each lines
125
105
  xcode_summary.inline_mode = true
126
- xcode_summary.report 'xcodebuild.json'
106
+ xcode_summary.report 'MyApp.xcresult'
127
107
  ```
128
108
 
129
- You can get warning and error number by calling `warning_error_count`. The return will be a JSON string contains warning and error count, e.g {"warnings":1,"errors":3}:
109
+ You can get warning and error number by calling `warning_error_count`. The return will be a JSON string contains warning and error count, e.g `{"warnings":1,"errors":3}`:
130
110
 
131
111
  ```ruby
132
- result = xcode_summary.warning_error_count 'xcodebuild.json'
112
+ result = xcode_summary.warning_error_count 'MyApp.xcresult'
133
113
  ```
134
114
 
135
115
  ## License
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'bundler/gem_tasks'
2
4
  require 'rspec/core/rake_task'
3
5
  require 'rubocop/rake_task'
@@ -1,6 +1,6 @@
1
- # coding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
- lib = File.expand_path('../lib', __FILE__)
3
+ lib = File.expand_path('lib', __dir__)
4
4
 
5
5
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
6
6
  require 'xcode_summary/gem_version.rb'
@@ -23,6 +23,7 @@ Gem::Specification.new do |spec|
23
23
 
24
24
  spec.required_ruby_version = ">= 2.4.0"
25
25
 
26
+ spec.add_dependency 'xcresult', '~> 0.2'
26
27
  spec.add_runtime_dependency 'danger-plugin-api', '~> 1.0'
27
28
 
28
29
  # General ruby development
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module XcodeSummary
4
- VERSION = '0.5.3'
4
+ VERSION = '1.0.0'
5
5
  end
@@ -1,20 +1,19 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'json'
4
+ require 'xcresult'
4
5
 
5
6
  module Danger
6
7
  # Shows all build errors, warnings and unit tests results generated from `xcodebuild`.
7
- # You need to use [xcpretty](https://github.com/supermarin/xcpretty)
8
- # with [xcpretty-json-formatter](https://github.com/marcelofabri/xcpretty-json-formatter)
9
- # to generate a JSON file that this plugin can read.
8
+ # You need to use the `xcresult` produced by Xcode 11. It's located in the Derived Data folder.
10
9
  # @example Showing summary
11
10
  #
12
- # xcode_summary.report 'xcodebuild.json'
11
+ # xcode_summary.report 'build.xcresult'
13
12
  #
14
13
  # @example Filtering warnings in Pods
15
14
  #
16
15
  # xcode_summary.ignored_files = '**/Pods/**'
17
- # xcode_summary.report 'xcodebuild.json'
16
+ # xcode_summary.report 'build.xcresult'
18
17
  #
19
18
  # @see diogot/danger-xcode_summary
20
19
  # @tags xcode, xcodebuild, format
@@ -44,18 +43,6 @@ module Danger
44
43
  # @return [Block]
45
44
  attr_accessor :ignored_results
46
45
 
47
- # Defines if the test summary will be sticky or not.
48
- # Defaults to `false`.
49
- # @param [Boolean] value
50
- # @return [Boolean]
51
- attr_accessor :sticky_summary
52
-
53
- # Defines if the build summary is shown or not.
54
- # Defaults to `true`.
55
- # @param [Boolean] value
56
- # @return [Boolean]
57
- attr_accessor :test_summary
58
-
59
46
  # Defines if using inline comment or not.
60
47
  # Defaults to `false`.
61
48
  # @param [Boolean] value
@@ -83,14 +70,6 @@ module Danger
83
70
  @ignored_results ||= block
84
71
  end
85
72
 
86
- def sticky_summary
87
- @sticky_summary || false
88
- end
89
-
90
- def test_summary
91
- @test_summary.nil? ? true : @test_summary
92
- end
93
-
94
73
  def inline_mode
95
74
  @inline_mode || false
96
75
  end
@@ -107,28 +86,32 @@ module Danger
107
86
  end
108
87
  # rubocop:enable Lint/DuplicateMethods
109
88
 
110
- # Reads a file with JSON Xcode summary and reports it.
89
+ # Reads a `.xcresult` and reports it.
111
90
  #
112
- # @param [String] file_path Path for Xcode summary in JSON format.
91
+ # @param [String] file_path Path for xcresult bundle.
113
92
  # @return [void]
114
93
  def report(file_path)
115
- if File.file?(file_path)
116
- xcode_summary = JSON.parse(File.read(file_path), symbolize_names: true)
94
+ if File.exist?(file_path)
95
+ xcode_summary = XCResult::Parser.new(path: file_path)
117
96
  format_summary(xcode_summary)
118
97
  else
119
98
  fail 'summary file not found'
120
99
  end
121
100
  end
122
101
 
123
- # Reads a file with JSON Xcode summary and reports its warning and error count.
102
+ # Reads a `.xcresult` and reports its warning and error count.
124
103
  #
125
- # @param [String] file_path Path for Xcode summary in JSON format.
104
+ # @param [String] file_path Path for xcresult bundle.
126
105
  # @return [String] JSON string with warningCount and errorCount
127
106
  def warning_error_count(file_path)
128
- if File.file?(file_path)
129
- xcode_summary = JSON.parse(File.read(file_path), symbolize_names: true)
130
- warning_count = warnings(xcode_summary).count
131
- error_count = errors(xcode_summary).count
107
+ if File.exist?(file_path)
108
+ xcode_summary = XCResult::Parser.new(path: file_path)
109
+ warning_count = 0
110
+ error_count = 0
111
+ xcode_summary.actions_invocation_record.actions.each do |action|
112
+ warning_count += warnings(action).count
113
+ error_count += errors(action).count
114
+ end
132
115
  result = { warnings: warning_count, errors: error_count }
133
116
  result.to_json
134
117
  else
@@ -139,102 +122,83 @@ module Danger
139
122
  private
140
123
 
141
124
  def format_summary(xcode_summary)
142
- messages(xcode_summary).each { |s| message(s, sticky: sticky_summary) }
143
- warnings(xcode_summary).each do |result|
144
- if inline_mode && result.location
145
- warn(result.message, sticky: false, file: result.location.file_name, line: result.location.line)
146
- else
147
- warn(result.message, sticky: false)
125
+ xcode_summary.actions_invocation_record.actions.each do |action|
126
+ warnings(action).each do |result|
127
+ if inline_mode && result.location
128
+ warn(result.message, sticky: false, file: result.location.file_path, line: result.location.line)
129
+ else
130
+ warn(result.message, sticky: false)
131
+ end
148
132
  end
149
- end
150
- # rubocop:disable Lint/UnreachableLoop
151
- errors(xcode_summary).each do |result|
152
- if inline_mode && result.location
153
- fail(result.message, sticky: false, file: result.location.file_name, line: result.location.line)
154
- else
155
- fail(result.message, sticky: false)
133
+ # rubocop:disable Lint/UnreachableLoop
134
+ errors(action).each do |result|
135
+ if inline_mode && result.location
136
+ fail(result.message, sticky: false, file: result.location.file_path, line: result.location.line)
137
+ else
138
+ fail(result.message, sticky: false)
139
+ end
156
140
  end
141
+ # rubocop:enable Lint/UnreachableLoop
157
142
  end
158
- # rubocop:enable Lint/UnreachableLoop
159
143
  end
160
144
 
161
- def messages(xcode_summary)
162
- if test_summary
163
- [
164
- xcode_summary[:tests_summary_messages]
165
- ].flatten.uniq.compact.map(&:strip)
166
- else
167
- []
168
- end
169
- end
170
-
171
- def warnings(xcode_summary)
172
- if ignores_warnings
173
- return []
174
- end
145
+ def warnings(action)
146
+ return [] if ignores_warnings
175
147
 
176
148
  warnings = [
177
- xcode_summary.fetch(:warnings, []).map { |message| Result.new(message, nil) },
178
- xcode_summary.fetch(:ld_warnings, []).map { |message| Result.new(message, nil) },
179
- xcode_summary.fetch(:compile_warnings, {}).map do |h|
180
- Result.new(format_compile_warning(h), parse_location(h))
181
- end
182
- ].flatten.uniq.compact.reject { |result| result.message.nil? }
149
+ action.action_result.issues.warning_summaries,
150
+ action.build_result.issues.warning_summaries
151
+ ].flatten.compact.map do |summary|
152
+ result = Result.new(summary.message, parse_location(summary.document_location_in_creating_workspace))
153
+ Result.new(format_warning(result), result.location)
154
+ end
155
+ warnings = warnings.uniq.reject { |result| result.message.nil? }
183
156
  warnings.delete_if(&ignored_results)
184
157
  end
185
158
 
186
- def errors(xcode_summary)
159
+ def errors(action)
187
160
  errors = [
188
- xcode_summary.fetch(:errors, []).map { |message| Result.new(message, nil) },
189
- xcode_summary.fetch(:compile_errors, {}).map do |h|
190
- Result.new(format_compile_warning(h), parse_location(h))
191
- end,
192
- xcode_summary.fetch(:file_missing_errors, {}).map do |h|
193
- Result.new(format_format_file_missing_error(h), parse_location(h))
194
- end,
195
- xcode_summary.fetch(:undefined_symbols_errors, {}).map do |h|
196
- Result.new(format_undefined_symbols(h), nil)
197
- end,
198
- xcode_summary.fetch(:duplicate_symbols_errors, {}).map do |h|
199
- Result.new(format_duplicate_symbols(h), nil)
200
- end,
201
- xcode_summary.fetch(:tests_failures, {}).map do |test_suite, failures|
202
- failures.map do |failure|
203
- Result.new(format_test_failure(test_suite, failure), parse_test_location(failure))
204
- end
205
- end
206
- ].flatten.uniq.compact.reject { |result| result.message.nil? }
207
- errors.delete_if(&ignored_results)
208
- end
161
+ action.action_result.issues.error_summaries,
162
+ action.build_result.issues.error_summaries
163
+ ].flatten.compact.map do |summary|
164
+ result = Result.new(summary.message, parse_location(summary.document_location_in_creating_workspace))
165
+ Result.new(format_warning(result), result.location)
166
+ end
167
+
168
+ test_failures = [
169
+ action.action_result.issues.test_failure_summaries,
170
+ action.build_result.issues.test_failure_summaries
171
+ ].flatten.compact.map do |summary|
172
+ result = Result.new(summary.message, parse_location(summary.document_location_in_creating_workspace))
173
+ Result.new(format_test_failure(result, summary.producing_target, summary.test_case_name),
174
+ result.location)
175
+ end
209
176
 
210
- def parse_location(input)
211
- file_path, line, _column = input[:file_path].split(':')
212
- file_name = relative_path(file_path)
213
- Location.new(file_name, file_path, line.to_i)
177
+ results = (errors + test_failures).uniq.reject { |result| result.message.nil? }
178
+ results.delete_if(&ignored_results)
214
179
  end
215
180
 
216
- def parse_test_location(failure)
217
- path, line = failure[:file_path].split(':')
218
- file_name = relative_path(path)
219
- Location.new(file_name, path, line.to_i)
181
+ def parse_location(document_location)
182
+ return nil if document_location.nil?
183
+
184
+ file_path = document_location.url.gsub('file://', '').split('#').first
185
+ file_name = file_path.split('/').last
186
+ fragment = document_location.url.split('#').last
187
+ params = CGI.parse(fragment).transform_values(&:first)
188
+ line = params['StartingLineNumber'].to_i + 1 # StartingLineNumber is 0-based, but we need a 1-based value
189
+ Location.new(file_name, relative_path(file_path), line)
220
190
  end
221
191
 
222
- def format_path(path)
192
+ def format_path(file_path, line)
223
193
  if plugin
224
- clean_path, line = parse_filename(path)
225
- path = "#{clean_path}#L#{line}" if clean_path && line
194
+ path = file_path
195
+ path += "#L#{line}" if line
226
196
  plugin.html_link(path)
227
197
  else
228
- path
198
+ file_path
229
199
  end
230
200
  end
231
201
 
232
- def parse_filename(path)
233
- regex = /^(.*?):(\d*):?\d*$/
234
- match = path.match(regex)
235
- match&.captures
236
- end
237
-
238
202
  def relative_path(path)
239
203
  return nil if project_root.nil?
240
204
 
@@ -242,8 +206,6 @@ module Danger
242
206
  end
243
207
 
244
208
  def should_ignore_warning?(path)
245
- parsed = parse_filename(path)
246
- path = parsed.first || path
247
209
  ignored_files.any? { |pattern| File.fnmatch(pattern, path) }
248
210
  end
249
211
 
@@ -251,44 +213,22 @@ module Danger
251
213
  reason.gsub('>', '\>').gsub('<', '\<')
252
214
  end
253
215
 
254
- def format_compile_warning(input)
255
- path = relative_path(input[:file_path])
256
- return nil if should_ignore_warning?(path)
257
-
258
- path_link = format_path(path)
259
-
260
- warning = "**#{path_link}**: #{escape_reason(input[:reason])} <br />"
261
- if input[:line] && !input[:line].empty?
262
- "#{warning}" \
263
- "```\n" \
264
- "#{input[:line]}\n" \
265
- '```'
266
- else
267
- warning
268
- end
269
- end
216
+ def format_warning(result)
217
+ return escape_reason(result.message) if result.location.nil?
270
218
 
271
- def format_format_file_missing_error(input)
272
- path = relative_path(input[:file_path])
273
- path_link = format_path(path)
274
- "**#{escape_reason(input[:reason])}**: #{path_link}"
275
- end
219
+ path = result.location.file_path
220
+ return nil if should_ignore_warning?(path)
276
221
 
277
- def format_undefined_symbols(input)
278
- "#{input[:message]} <br />" \
279
- "> Symbol: #{input[:symbol]} <br />" \
280
- "> Referenced from: #{input[:reference]}"
281
- end
222
+ path_link = format_path(path, result.location.line)
282
223
 
283
- def format_duplicate_symbols(input)
284
- "#{input[:message]} <br />" \
285
- "> #{input[:file_paths].map { |path| path.split('/').last }.join('<br /> ')}"
224
+ "**#{path_link}**: #{escape_reason(result.message)}"
286
225
  end
287
226
 
288
- def format_test_failure(suite_name, failure)
289
- path = relative_path(failure[:file_path])
290
- path_link = format_path(path)
291
- "**#{suite_name}**: #{failure[:test_case]}, #{escape_reason(failure[:reason])} <br /> #{path_link}"
227
+ def format_test_failure(result, producing_target, test_case_name)
228
+ path = result.location.file_path
229
+ path_link = format_path(path, result.location.line)
230
+ suite_name = "#{producing_target}.#{test_case_name}"
231
+ "**#{suite_name}**: #{escape_reason(result.message)} <br /> #{path_link}"
292
232
  end
293
233
  end
294
234
  end