Comments (16)
@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.
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.
@marcelofabri I'm using BitBucket Cloud
from danger-xcode_summary.
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.
xcode_summary.report 'build/reports/errors.json'
jenkins$ danger --version 5.12.0
from danger-xcode_summary.
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.
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.
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.
In my project , I can not find "build/reports/errors.json"?
from danger-xcode_summary.
@qyhongfan you have to create that file usually with xcpretty-json-formatter.
from danger-xcode_summary.
@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.
@diogot I used :
xcodebuild -workspace ios/AGWorkFlow.xcworkspace -scheme AGWorkFlow -configuration Debug -sdk iphonesimulator | XCPRETTY_JSON_FILE_OUTPUT=xcodebuildResult.json xcpretty -fxcpretty-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
[!] InvalidDangerfile
file: undefined method `project_url' for #Danger::Jenkins:0x007f87658c4878�[0mfrom 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.
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.
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.
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.
These changes were included on #47
from danger-xcode_summary.
Related Issues (19)
- Error running 0.3.0 `no implicit conversion of Symbol into Integer` HOT 4
- [Question]: Setting to report compiler errors only? HOT 1
- Wrong example for ignored_files HOT 1
- Custom text on success report HOT 6
- Result comment contains only test summary messages without failed tests HOT 1
- xcode_summary.ignored_results does not Read Warnings from xcodebuild.json HOT 11
- [Question] Examples - Undefined method `start_with` HOT 2
- xcpretty with xcpretty-json-formatter HOT 5
- xcode_summary not reporting some items in
- Add category parameter to DangerXcodeSummary::Result HOT 1
- Inline mode (probably) doesn't work exactly as people expected. HOT 4
- Problem with displaying emojis HOT 1
- Full path to file in message HOT 3
- Links to files don't work for Bitbucket Server properly
- Possible to report build errors/warnings without running tests? HOT 2
- CircleCI Danger failure after update HOT 1
- False errors with testRepetitionMode HOT 2
- Summary file not found HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from danger-xcode_summary.