Skip to content

Conversation

@berlysia
Copy link

@berlysia berlysia commented Jan 24, 2022

#1200

  1. Adjust structuredDiffForFile for BitBucketServer the same as the others
  2. Remove any from StructuredDiff

chunks:
diff.hunks &&
diff.hunks.map(hunk => ({
content: `@@ -${hunk.sourceLine},${hunk.sourceSpan} +${hunk.destinationLine},${hunk.destinationSpan} @@`,
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nah, that looks right enough to me

Comment on lines +142 to +178
oldStart: hunk.sourceLine,
oldLines: hunk.sourceSpan,
newStart: hunk.destinationLine,
newLines: hunk.destinationSpan,
changes: hunk.segments
.map(segment =>
segment.lines.map(line => ({
type: segmentValues[segment.type] as "add" | "del" | "normal",
content: line.line,
sourceLine: line.source,
destinationLine: line.destination,
}))
)
.reduce((a, b) => a.concat(b), []),
.map(segment => {
const type = segmentValues[segment.type]
if (type === "add") {
return segment.lines.map(line => {
return {
type,
add: true as const,
content: line.line,
ln: line.destination,
}
})
}
if (type === "del") {
return segment.lines.map(line => {
return {
type,
del: true as const,
content: line.line,
ln: line.source,
}
})
}
if (type === "normal") {
return segment.lines.map(line => {
return {
type,
normal: true as const,
content: line.line,
ln1: line.source,
ln2: line.destination,
}
})
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@berlysia berlysia force-pushed the adjust-structured-diff-return-value branch from a4e4035 to dc54972 Compare January 25, 2022 17:22
@berlysia
Copy link
Author

yarn declaration is now passed in my local env

@orta
Copy link
Member

orta commented Jan 29, 2022

Perfect, all this looks great - thanks!

@orta orta merged commit fb66c81 into danger:main Jan 29, 2022
@berlysia berlysia deleted the adjust-structured-diff-return-value branch January 31, 2022 04:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants