Skip to content
This repository was archived by the owner on Jul 1, 2023. It is now read-only.

Commit 7b9bbc2

Browse files
yns88facebook-github-bot
authored andcommitted
Better lint messages for hackfmt
Reviewed By: BobertForever Differential Revision: D14690061 fbshipit-source-id: 1d351b6f8de403aefb19fb667149a23386f5b356
1 parent 545adb5 commit 7b9bbc2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/StringDiff.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public static function characters(string $a, string $b): this {
3434
return new self(Str\split($a, ''), Str\split($b, ''));
3535
}
3636

37-
public function getUnifiedDiff(int $context = 3): string {
37+
public function getHunks(int $context): vec<vec<DiffOp<string>>> {
3838
$hunks = vec[];
3939

4040
$remaining = $this->getDiff();
@@ -77,7 +77,11 @@ public function getUnifiedDiff(int $context = 3): string {
7777
$hunks[] = Vec\take($remaining, $end);
7878
$remaining = Vec\drop($remaining, $end);
7979
}
80+
return $hunks;
81+
}
8082

83+
public function getUnifiedDiff(int $context = 3): string {
84+
$hunks = $this->getHunks($context);
8185
return Vec\map($hunks, $hunk ==> $this->getUnifiedDiffHunk($hunk))
8286
|> Vec\filter_nulls($$)
8387
|> Str\join($$, "");

0 commit comments

Comments
 (0)