danger-xcode_summary: undefined method `html_link' for nil:NilClass

I’m getting the following error while trying to use xcode_summary, any help ?

[00:36:36]: ▸ [!] Invalid `Dangerfile` file: undefined method `html_link' for nil:NilClass
[00:36:36]: ▸ #  from Dangerfile:11
[00:36:36]: ▸ #  -------------------------------------------
[00:36:36]: ▸ #  # Xcode Summary
[00:36:36]: ▸ >  xcode_summary.report 'build/reports/errors.json'
[00:36:36]: ▸ #
[00:36:36]: ▸ #  -------------------------------------------

build/reports/errors.json :

server:mykit jenkins$ cat build/reports/errors.json 
{
  "warnings": [

  ],
  "ld_warnings": [

  ],
  "compile_warnings": [
    {
      "file_name": "MyFile.swift",
      "file_path": "/Users/Shared/Jenkins/Home/workspace/mykit/MYKIT/MyFile.swift:183:7",
      "reason": "initialization of immutable value 'myVar' was never used; consider replacing with assignment to '_' or removing it",
      "line": "                let myVar = \"\"",
      "cursor": "                ~~~~^~~~~"
    },
    {
      "file_name": "MyFile.swift",
      "file_path": "/Users/Shared/Jenkins/Home/workspace/mykit/MYKIT/MyFile.swift:183:7",
      "reason": "initialization of immutable value 'myVar' was never used; consider replacing with assignment to '_' or removing it",
      "line": "                let myVar = \"\"",
      "cursor": "                ~~~~^~~~~"
    },
    {
      "file_name": "MyFile.swift",
      "file_path": "/Users/Shared/Jenkins/Home/workspace/mykit/MYKIT/MyFile.swift:183:7",
      "reason": "initialization of immutable value 'myVar' was never used; consider replacing with assignment to '_' or removing it",
      "line": "                let myVar = \"\"",
      "cursor": "                ~~~~^~~~~"
    },
    {
      "file_name": "MyFile.swift",
      "file_path": "/Users/Shared/Jenkins/Home/workspace/mykit/MYKIT/MyFile.swift:183:7",
      "reason": "initialization of immutable value 'myVar' was never used; consider replacing with assignment to '_' or removing it",
      "line": "                let myVar = \"\"",
      "cursor": "                ~~~~^~~~~"
    },
    {
      "file_name": "MyFile.swift",
      "file_path": "/Users/Shared/Jenkins/Home/workspace/mykit/MYKIT/MyFile.swift:183:7",
      "reason": "initialization of immutable value 'myVar' was never used; consider replacing with assignment to '_' or removing it",
      "line": "                let myVar = \"\"",
      "cursor": "                ~~~~^~~~~"
    },
    {
      "file_name": "MyFile.swift",
      "file_path": "/Users/Shared/Jenkins/Home/workspace/mykit/MYKIT/MyFile.swift:183:7",
      "reason": "initialization of immutable value 'myVar' was never used; consider replacing with assignment to '_' or removing it",
      "line": "                let myVar = \"\"",
      "cursor": "                ~~~~^~~~~"
    },
    {
      "file_name": "MyFile.swift",
      "file_path": "/Users/Shared/Jenkins/Home/workspace/mykit/MYKIT/MyFile.swift:183:7",
      "reason": "initialization of immutable value 'myVar' was never used; consider replacing with assignment to '_' or removing it",
      "line": "                let myVar = \"\"",
      "cursor": "                ~~~~^~~~~"
    },
    {
      "file_name": "MyFile.swift",
      "file_path": "/Users/Shared/Jenkins/Home/workspace/mykit/MYKIT/MyFile.swift:183:7",
      "reason": "initialization of immutable value 'myVar' was never used; consider replacing with assignment to '_' or removing it",
      "line": "                let myVar = \"\"",
      "cursor": "                ~~~~^~~~~"
    },
    {
      "file_name": "MyFile.swift",
      "file_path": "/Users/Shared/Jenkins/Home/workspace/mykit/MYKIT/MyFile.swift:183:7",
      "reason": "initialization of immutable value 'myVar' was never used; consider replacing with assignment to '_' or removing it",
      "line": "                let myVar = \"\"",
      "cursor": "                ~~~~^~~~~"
    },
    {
      "file_name": "MyFile.swift",
      "file_path": "/Users/Shared/Jenkins/Home/workspace/mykit/MYKIT/MyFile.swift:183:7",
      "reason": "initialization of immutable value 'myVar' was never used; consider replacing with assignment to '_' or removing it",
      "line": "                let myVar = \"\"",
      "cursor": "                ~~~~^~~~~"
    },
    {
      "file_name": "MyFile.swift",
      "file_path": "/Users/Shared/Jenkins/Home/workspace/mykit/MYKIT/MyFile.swift:183:7",
      "reason": "initialization of immutable value 'myVar' was never used; consider replacing with assignment to '_' or removing it",
      "line": "                let myVar = \"\"",
      "cursor": "                ~~~~^~~~~"
    },
    {
      "file_name": "MyFile.swift",
      "file_path": "/Users/Shared/Jenkins/Home/workspace/mykit/MYKIT/MyFile.swift:183:7",
      "reason": "initialization of immutable value 'myVar' was never used; consider replacing with assignment to '_' or removing it",
      "line": "                let myVar = \"\"",
      "cursor": "                ~~~~^~~~~"
    },
    {
      "file_name": "MyFile.swift",
      "file_path": "/Users/Shared/Jenkins/Home/workspace/mykit/MYKIT/MyFile.swift:183:7",
      "reason": "initialization of immutable value 'myVar' was never used; consider replacing with assignment to '_' or removing it",
      "line": "                let myVar = \"\"",
      "cursor": "                ~~~~^~~~~"
    },
    {
      "file_name": "MyFile.swift",
      "file_path": "/Users/Shared/Jenkins/Home/workspace/mykit/MYKIT/MyFile.swift:183:7",
      "reason": "initialization of immutable value 'myVar' was never used; consider replacing with assignment to '_' or removing it",
      "line": "                let myVar = \"\"",
      "cursor": "                ~~~~^~~~~"
    },
    {
      "file_name": "MyFile.swift",
      "file_path": "/Users/Shared/Jenkins/Home/workspace/mykit/MYKIT/MyFile.swift:183:7",
      "reason": "initialization of immutable value 'myVar' was never used; consider replacing with assignment to '_' or removing it",
      "line": "                let myVar = \"\"",
      "cursor": "                ~~~~^~~~~"
    }
  ],
  "errors": [

  ],
  "compile_errors": [

  ],
  "file_missing_errors": [

  ],
  "undefined_symbols_errors": [

  ],
  "duplicate_symbols_errors": [

  ],
  "tests_failures": {
  },
  "tests_summary_messages": [
    "\t Executed 89 tests, with 0 failures (0 unexpected) in 0.249 (0.509) seconds\n"
  ]

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 2
  • Comments: 16 (3 by maintainers)

Most upvoted comments

@qyhongfan you have to create that file usually with xcpretty-json-formatter.

Thank you! I have used [xcpretty-json-formatter] and created error.json