-
-
Notifications
You must be signed in to change notification settings - Fork 368
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
[WIP] Support inline comments #99
Changes from all commits
88810e2
9337cde
1e1a765
4089070
30bd208
7fe319d
7ca3831
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
export type MarkdownString = string | ||
export type Filename = string | ||
export type LineNumber = string |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,7 +66,6 @@ export class Executor { | |
process.exitCode = 1 | ||
} | ||
|
||
// Delete the message if there's nothing to say | ||
const {fails, warnings, messages, markdowns} = results | ||
|
||
const failureCount = [...fails, ...warnings].length | ||
|
@@ -75,6 +74,7 @@ export class Executor { | |
this.d(results) | ||
|
||
if (failureCount + messageCount === 0) { | ||
// Delete the message if there's nothing to say | ||
console.log("No messages are collected.") | ||
await this.platform.deleteMainComment() | ||
} else { | ||
|
@@ -84,6 +84,7 @@ export class Executor { | |
console.log("Found some message, writing it down") | ||
} | ||
const comment = githubResultsTemplate(results) | ||
// TODO filter out Danger items that contain file/line info | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe this is the area where we could filter out results that contained a complete There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, this is where you want to find:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This function only accepts the |
||
await this.platform.updateOrCreateComment(comment) | ||
} | ||
} | ||
|
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.
results.markdowns: Array
differs in that it currently acceptsMarkdownString
as its type, whereasfails
,warns
, andmessages
acceptViolation
as its type. To keep parity with the Danger-rb API,markdown()
should be able to accept{ file, line }
options, so I believe movingmarkdowns
fromArray<MarkdownString>
toArray<Violation>
is the appropriate change.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.
Yeah, this makes sense 👍