Code Monkey home page Code Monkey logo

Comments (16)

qyhongfan avatar qyhongfan commented on June 12, 2024 2

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

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

from danger-xcode_summary.

marcelofabri avatar marcelofabri commented on June 12, 2024

Are you using Danger with GitHub or something else? I'm not sure html_link is defined in all request sources.

from danger-xcode_summary.

gbero avatar gbero commented on June 12, 2024

@marcelofabri I'm using BitBucket Cloud

from danger-xcode_summary.

marcelofabri avatar marcelofabri commented on June 12, 2024

It seems like this should be supported: https://github.com/danger/danger/blob/bbf5d0d15ec314fc8529bcff62ae8ae04b9d78e4/lib/danger/danger_core/plugins/dangerfile_bitbucket_cloud_plugin.rb#L153

Can you post your Dangerfile and what version of danger you're using?

from danger-xcode_summary.

gbero avatar gbero commented on June 12, 2024

xcode_summary.report 'build/reports/errors.json'
jenkins$ danger --version 5.12.0

from danger-xcode_summary.

marcelofabri avatar marcelofabri commented on June 12, 2024

can you try to use bitbucket_cloud in your Dangerfile to see if it's available?

Something like

message bitbucket_cloud.pr_author

from danger-xcode_summary.

gbero avatar gbero commented on June 12, 2024

yes sorry here's the complete DangerFile

# Make it more obvious that a PR is a work in progress and shouldn't be merged yet
warn("PR is classed as Work in Progress") if bitbucket_cloud.pr_title.include? "[WIP]"

# Warn when there is a big PR
warn("Big PR") if git.lines_of_code > 500

# SwiftLint
swiftlint.lint_files inline_mode: true

# Xcode Summary
xcode_summary.report 'build/reports/errors.json'

Danger runs fine when disabling xcode_summary_report and the first rule (WIP) works fine

from danger-xcode_summary.

marcelofabri avatar marcelofabri commented on June 12, 2024

Unfortunately, I have no idea why it's not working then. I've only used the plugin with GitHub.

But feel free to open a PR if you find this to be a bug on the plugin 💯

from danger-xcode_summary.

qyhongfan avatar qyhongfan commented on June 12, 2024

In my project , I can not find "build/reports/errors.json"?

from danger-xcode_summary.

diogot avatar diogot commented on June 12, 2024

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

from danger-xcode_summary.

qyhongfan avatar qyhongfan commented on June 12, 2024

@diogot I used :
xcodebuild -workspace ios/AGWorkFlow.xcworkspace -scheme AGWorkFlow -configuration Debug -sdk iphonesimulator | XCPRETTY_JSON_FILE_OUTPUT=xcodebuildResult.json xcpretty -f xcpretty-json-formatter && exit ${PIPESTATUS[0]}

xcodebuildResult.json:
{
"warnings": [

],
"ld_warnings": [

],
"compile_warnings": [

],
"errors": [

],
"compile_errors": [
{
"file_name": "CalendarDayCell.swift",
"file_path": "/Users/hurry.qin/Work/AGWorkflow/ios/Sources/RNModules/Calendar/CalendarDayCell.swift:39:11",
"reason": "property 'self.dateModel' not initialized at super.init call",
"line": " super.init(frame: .zero)",
"cursor": " ^"
}
],
"file_missing_errors": [

],
"undefined_symbols_errors": [

],
"duplicate_symbols_errors": [

],
"tests_failures": {
},
"tests_summary_messages": [

]
}

Danger Error:
Danger::DSLError: �[31m
[!] Invalid Dangerfile file: undefined method `project_url' for #Danger::Jenkins:0x007f87658c4878�[0m

from Dangerfile:86

-------------------------------------------

}

xcode_summary.report 'xcodebuildResult.json'

# end

-------------------------------------------

I do not know why?

from danger-xcode_summary.

qyhongfan avatar qyhongfan commented on June 12, 2024

@diogot I used :
xcodebuild -workspace ios/AGWorkFlow.xcworkspace -scheme AGWorkFlow -configuration Debug -sdk iphonesimulator | XCPRETTY_JSON_FILE_OUTPUT=xcodebuildResult.json xcpretty -f xcpretty-json-formatter && exit ${PIPESTATUS[0]}

xcodebuildResult.json:
{
"warnings": [

],
"ld_warnings": [

],
"compile_warnings": [

],
"errors": [

],
"compile_errors": [
{
"file_name": "CalendarDayCell.swift",
"file_path": "/Users/hurry.qin/Work/AGWorkflow/ios/Sources/RNModules/Calendar/CalendarDayCell.swift:39:11",
"reason": "property 'self.dateModel' not initialized at super.init call",
"line": " super.init(frame: .zero)",
"cursor": " ^"
}
],
"file_missing_errors": [

],
"undefined_symbols_errors": [

],
"duplicate_symbols_errors": [

],
"tests_failures": {
},
"tests_summary_messages": [

]
}

Danger Error:
Danger::DSLError: �[31m
[!] Invalid Dangerfile file: undefined method `project_url' for #Danger::Jenkins:0x007f87658c4878�[0m

from Dangerfile:86

-------------------------------------------

}

xcode_summary.report 'xcodebuildResult.json'

# end

-------------------------------------------

I do not know why?

Invalid Dangerfile file: undefined method `project_url' for #Danger

from danger-xcode_summary.

KingOfBrian avatar KingOfBrian commented on June 12, 2024

I am trying to debug locally and I was getting this error. I pointed to this branch and the problem still occurred, not sure if this helps or not, but:

[!] Invalid `Dangerfile` file: undefined method `html_link' for nil:NilClass
 #  from Dangerfile:18
 #  -------------------------------------------
 #  }
 >  xcode_summary.report './output/report-formatted.json'
 #
 #  -------------------------------------------

  /Users/bking/.bundle/ruby/2.3.0/danger-xcode_summary-661bd0318e4d/lib/xcode_summary/plugin.rb:219:in `format_path'
  /Users/bking/.bundle/ruby/2.3.0/danger-xcode_summary-661bd0318e4d/lib/xcode_summary/plugin.rb:249:in `format_compile_warning'
  /Users/bking/.bundle/ruby/2.3.0/danger-xcode_summary-661bd0318e4d/lib/xcode_summary/plugin.rb:169:in `block in warnings'
  /Users/bking/.bundle/ruby/2.3.0/danger-xcode_summary-661bd0318e4d/lib/xcode_summary/plugin.rb:168:in `map'
  /Users/bking/.bundle/ruby/2.3.0/danger-xcode_summary-661bd0318e4d/lib/xcode_summary/plugin.rb:168:in `warnings'
  /Users/bking/.bundle/ruby/2.3.0/danger-xcode_summary-661bd0318e4d/lib/xcode_summary/plugin.rb:134:in `format_summary'
  /Users/bking/.bundle/ruby/2.3.0/danger-xcode_summary-661bd0318e4d/lib/xcode_summary/plugin.rb:108:in `report'
  Dangerfile:18:in `eval_file'
  /Library/Ruby/Gems/2.3.0/gems/danger-6.0.9/lib/danger/danger_core/dangerfile.rb:297:in `eval'
  /Library/Ruby/Gems/2.3.0/gems/danger-6.0.9/lib/danger/danger_core/dangerfile.rb:297:in `eval_file'
  /Library/Ruby/Gems/2.3.0/gems/danger-6.0.9/lib/danger/danger_core/dangerfile.rb:200:in `block in parse'
  /Library/Ruby/Gems/2.3.0/gems/danger-6.0.9/lib/danger/danger_core/dangerfile.rb:197:in `instance_eval'
  /Library/Ruby/Gems/2.3.0/gems/danger-6.0.9/lib/danger/danger_core/dangerfile.rb:197:in `parse'
  /Library/Ruby/Gems/2.3.0/gems/danger-6.0.9/lib/danger/danger_core/dangerfile.rb:273:in `run'
  /Library/Ruby/Gems/2.3.0/gems/danger-6.0.9/lib/danger/commands/dry_run.rb:44:in `run'
  /Library/Ruby/Gems/2.3.0/gems/claide-1.0.2/lib/claide/command.rb:334:in `run'
  /Library/Ruby/Gems/2.3.0/gems/danger-6.0.9/bin/danger:5:in `<top (required)>'
  /usr/local/bin/danger:22:in `load'
  /usr/local/bin/danger:22:in `<top (required)>'

This was caused by:

      "file_name": "XXXViewController.swift",
      "file_path": "/Users/bking/.../XXXViewController.swift:325:19",
      "reason": "value 'state' was defined but never used; consider replacing with boolean test",
      "line": "        guard let state = state else { return }",
      "cursor": "              ~~~~^~~~~~~~"
    },

One of the issues I'm trying to debug is the warnings are not properly showing up... I have a feeling it's not getting to the xcpretty formatter correctly 🤔

from danger-xcode_summary.

diogot avatar diogot commented on June 12, 2024

Hi @KingOfBrian,

Thanks for reporting, it seems not related to this issue, you can open a new one if you like to discuss it.

from danger-xcode_summary.

KingOfBrian avatar KingOfBrian commented on June 12, 2024

Hey @diogot -- I logged a bug for something else that's a bit more problematic to me, and I wouldn't be surprised if they have the same root cause. Thanks!

from danger-xcode_summary.

diogot avatar diogot commented on June 12, 2024

These changes were included on #47

from danger-xcode_summary.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.