New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve danger swift edit #94
Conversation
@@ -26,6 +26,12 @@ private final class DangerRunner { | |||
logger.logInfo("Ran with: \(CommandLine.arguments.joined(separator: " "))") | |||
|
|||
let cliLength = CommandLine.arguments.count | |||
|
|||
guard cliLength - 2 > 0 else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -65,72 +71,142 @@ public func Danger() -> DangerDSL { | |||
return DangerRunner.shared.dsl | |||
} | |||
|
|||
extension DangerDSL { | |||
/// Fails on the Danger report | |||
public var fails: [Violation] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added this to allow people that are using multiple files to use danger to post messages etc. with typing and auto complete, without have to import Danger
in all the files (given you have a global instance of danger defined on the Dangerfile, and that the multiple files will be copied on the Dangerfile when danger is executed)
(It works also with the import anyway)
@@ -51,6 +59,24 @@ extension Script { | |||
let fileName = importPath.split(separator: "/").last | |||
return folder.path + "Sources/\(name)/\(fileName ?? "")" | |||
} | |||
|
|||
private func generateXCodeProjWithConfig(configPath: String) throws { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be better if we could pass to Marathon the xcconfig for the xcodeproj in the arguments, maybe worth propose that on the Marathon repo
OK, yeah, I think this idea is 👍 |
This might be a little bit controversial in some points, i will try to put as much as possible details, images and inline comments about what i'm trying to do
PR Goal
If you run
danger-swift edit
you will see that, with no syntax highlighting, no auto competition.The reason for that was that it was not correctly overriding the
OTHER_SWIFT_FLAGS
.But once i did override them correctly (was enough remove the
,
let before = "-DXcode\","
to fix that) the syntax highlighting was correct, but it was not compiling.In order to make it compile i had to link the danger library, this is why i though that was a good idea to actually use the
--xcconfig-overrides
option on thegenerate-xcodeproj
commandThis is the result