Skip to content

Commit 044fd5a

Browse files
authored
style: reformat the repo with oxfmt (#59)
* chore: add oxfmt formatting commands (#58) * chore: add oxfmt formatting commands * chore: sync the bun lockfile * style: reformat the repo with oxfmt
1 parent 903865b commit 044fd5a

83 files changed

Lines changed: 2017 additions & 718 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/benchmarks.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ on:
55
branches:
66
- main
77
paths-ignore:
8-
- '**/*.md'
9-
- 'docs/**'
10-
- 'assets/**'
11-
- 'LICENSE'
8+
- "**/*.md"
9+
- "docs/**"
10+
- "assets/**"
11+
- "LICENSE"
1212
workflow_dispatch:
1313

1414
concurrency:

.github/workflows/ci.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ on:
55
branches:
66
- main
77
paths-ignore:
8-
- '**/*.md'
9-
- 'docs/**'
10-
- 'assets/**'
11-
- 'LICENSE'
8+
- "**/*.md"
9+
- "docs/**"
10+
- "assets/**"
11+
- "LICENSE"
1212

1313
concurrency:
1414
group: main-ci-${{ github.workflow }}-${{ github.ref }}
@@ -30,6 +30,9 @@ jobs:
3030
- name: Install dependencies
3131
run: bun install --frozen-lockfile
3232

33+
- name: Format check
34+
run: bun run format:check
35+
3336
- name: Typecheck
3437
run: bun run typecheck
3538

.github/workflows/pr-ci.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ name: CI
33
on:
44
pull_request:
55
paths-ignore:
6-
- '**/*.md'
7-
- 'docs/**'
8-
- 'assets/**'
9-
- 'LICENSE'
6+
- "**/*.md"
7+
- "docs/**"
8+
- "assets/**"
9+
- "LICENSE"
1010

1111
concurrency:
1212
group: pr-ci-${{ github.workflow }}-${{ github.ref }}
@@ -33,6 +33,9 @@ jobs:
3333
- name: Install dependencies
3434
run: bun install --frozen-lockfile
3535

36+
- name: Format check
37+
run: bun run format:check
38+
3639
- name: Typecheck
3740
run: bun run typecheck
3841

README.md

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<img width="384" height="384" alt="image" src="https://github.com/user-attachments/assets/85c5ba93-9de1-4757-87ae-4520b8fd659f" />
22

3-
43
# hunk - TUI diff tool that's AI-friendly
54

65
[![CI status](https://img.shields.io/github/actions/workflow/status/modem-dev/hunk/ci.yml?branch=main&style=for-the-badge&label=CI)](https://github.com/modem-dev/hunk/actions/workflows/ci.yml?branch=main)
@@ -54,20 +53,20 @@ git diff --no-color | hunk patch - # review a patch from stdin
5453

5554
## Feature comparison
5655

57-
| Capability | hunk | difftastic | delta | diff |
58-
| --- | --- | --- | --- | --- |
59-
| Dedicated interactive review UI |||||
60-
| Multi-file review stream with navigation sidebar |||||
61-
| Agent / AI rationale sidecar |||||
62-
| Split diffs |||||
63-
| Stacked diffs |||||
64-
| Auto responsive layouts |||||
65-
| Themes |||||
66-
| Syntax highlighting |||||
67-
| Syntax-aware / structural diffing |||||
68-
| Mouse support inside the diff viewer |||||
69-
| Runtime toggles for wrapping / line numbers / hunk metadata |||||
70-
| Pager-compatible mode |||||
56+
| Capability | hunk | difftastic | delta | diff |
57+
| ----------------------------------------------------------- | ---- | ---------- | ----- | ---- |
58+
| Dedicated interactive review UI | | | | |
59+
| Multi-file review stream with navigation sidebar | | | | |
60+
| Agent / AI rationale sidecar | | | | |
61+
| Split diffs | | | | |
62+
| Stacked diffs | | | | |
63+
| Auto responsive layouts | | | | |
64+
| Themes | | | | |
65+
| Syntax highlighting | | | | |
66+
| Syntax-aware / structural diffing | | | | |
67+
| Mouse support inside the diff viewer | | | | |
68+
| Runtime toggles for wrapping / line numbers / hunk metadata | | | | |
69+
| Pager-compatible mode | | | | |
7170

7271
## Git integration
7372

bin/hunk.cjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,9 @@ if (bunBinary) {
111111
run(bunBinary, [entrypoint, ...process.argv.slice(2)]);
112112
}
113113

114-
const printablePackages = hostCandidates().map((candidate) => `"${candidate.packageName}"`).join(" or ");
114+
const printablePackages = hostCandidates()
115+
.map((candidate) => `"${candidate.packageName}"`)
116+
.join(" or ");
115117
console.error(
116118
printablePackages.length > 0
117119
? `Failed to locate a matching prebuilt Hunk binary. Try reinstalling hunkdiff or manually installing ${printablePackages}.`

docs/prebuilt-binaries-plan.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,8 @@ dist/
180180
hunkdiff-linux-x64/
181181
hunkdiff-darwin-arm64/
182182
```
183-
```
183+
184+
````
184185
185186
The checked-in repo should contain templates and scripts, not prebuilt binaries.
186187
@@ -283,7 +284,7 @@ Top-level `package.json` should eventually look more like this:
283284
"hunkdiff-linux-x64": "0.3.0"
284285
}
285286
}
286-
```
287+
````
287288

288289
Notably:
289290

examples/3-agent-review-demo/after/src/search.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ export function searchCommands(query: string, commands: Command[]) {
3535
return { command, score };
3636
})
3737
.filter((entry) => entry.score > 0)
38-
.sort((left, right) => right.score - left.score || left.command.label.localeCompare(right.command.label))
38+
.sort(
39+
(left, right) =>
40+
right.score - left.score || left.command.label.localeCompare(right.command.label),
41+
)
3942
.map((entry) => entry.command);
4043
}

examples/5-pager-tour/after.ts

Lines changed: 36 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,33 +4,51 @@ export const tourLine03 = "Keep the main review stream in view instead of bounci
44
export const tourLine04 = "Use the same layout long enough to build a reading rhythm.";
55
export const tourLine05 = "Stick with the default theme until the patch itself feels familiar.";
66
export const tourLine06 = "Capture the main intent before you zoom into any implementation detail.";
7-
export const tourLine07 = "Pause on surprising hunks before you decide whether the change makes sense.";
8-
export const tourLine08 = "Large diffs get easier once you scan the visible anchors and move with intent.";
9-
export const tourLine09 = "Review notes should stay next to the code they explain, not in a detached summary.";
10-
export const tourLine10 = "A steady reading order helps people narrate the patch without losing context.";
7+
export const tourLine07 =
8+
"Pause on surprising hunks before you decide whether the change makes sense.";
9+
export const tourLine08 =
10+
"Large diffs get easier once you scan the visible anchors and move with intent.";
11+
export const tourLine09 =
12+
"Review notes should stay next to the code they explain, not in a detached summary.";
13+
export const tourLine10 =
14+
"A steady reading order helps people narrate the patch without losing context.";
1115
export const tourLine11 = "Give every changed block one clear reason to exist before you move on.";
12-
export const tourLine12 = "Leave enough room for careful follow-up comments when the diff raises questions.";
16+
export const tourLine12 =
17+
"Leave enough room for careful follow-up comments when the diff raises questions.";
1318
export const tourLine13 = "Unchanged spacing between sections keeps separate hunks easy to spot.";
1419
export const tourLine14 = "Short stretches of context make larger edits feel trustworthy.";
1520
export const tourLine15 = "Preview the next stop before you jump ahead with a bigger movement.";
16-
export const tourLine16 = "Use a calm pace when the patch mixes code, copy, and structural cleanup.";
21+
export const tourLine16 =
22+
"Use a calm pace when the patch mixes code, copy, and structural cleanup.";
1723
export const tourLine17 = "Complex refactors still benefit from a simple review rhythm.";
18-
export const tourLine18 = "A single-file walkthrough can teach the whole keyboard model surprisingly fast.";
24+
export const tourLine18 =
25+
"A single-file walkthrough can teach the whole keyboard model surprisingly fast.";
1926
export const tourLine19 = "Consistency matters more than memorizing every shortcut in one pass.";
2027
export const tourLine20 = "Line-by-line movement should feel steady, local, and predictable.";
2128
export const tourLine21 = "Page jumps should land near the next cluster of interesting changes.";
22-
export const tourLine22 = "Home and End are perfect when you want to reset your bearings instantly.";
23-
export const tourLine23 = "The best demos let you try scrolling without any setup or repo plumbing.";
24-
export const tourLine24 = "Readable filler text makes navigation practice feel intentional instead of synthetic.";
29+
export const tourLine22 =
30+
"Home and End are perfect when you want to reset your bearings instantly.";
31+
export const tourLine23 =
32+
"The best demos let you try scrolling without any setup or repo plumbing.";
33+
export const tourLine24 =
34+
"Readable filler text makes navigation practice feel intentional instead of synthetic.";
2535
export const tourLine25 = "A few distinct hunks are better than one endless wall of edits.";
2636
export const tourLine26 = "Split view is great when you want both sides visible at once.";
2737
export const tourLine27 = "Stack view can feel calmer when lines are long or heavily wrapped.";
28-
export const tourLine28 = "Pager mode should stay familiar to people who already live in git diff and less.";
29-
export const tourLine29 = "Clean copy changes are useful because they are easy to scan while you learn.";
30-
export const tourLine30 = "Repeated line structure makes scrolling behavior obvious to first-time users.";
31-
export const tourLine31 = "A review tool should reward curiosity instead of punishing it with awkward jumps.";
32-
export const tourLine32 = "Watch how the current hunk stays visually anchored while you move around it.";
33-
export const tourLine33 = "Try paging down first, then refine your position one line at a time with ↑ and ↓.";
34-
export const tourLine34 = "When you overshoot, small upward steps should feel immediate and unsurprising.";
38+
export const tourLine28 =
39+
"Pager mode should stay familiar to people who already live in git diff and less.";
40+
export const tourLine29 =
41+
"Clean copy changes are useful because they are easy to scan while you learn.";
42+
export const tourLine30 =
43+
"Repeated line structure makes scrolling behavior obvious to first-time users.";
44+
export const tourLine31 =
45+
"A review tool should reward curiosity instead of punishing it with awkward jumps.";
46+
export const tourLine32 =
47+
"Watch how the current hunk stays visually anchored while you move around it.";
48+
export const tourLine33 =
49+
"Try paging down first, then refine your position one line at a time with ↑ and ↓.";
50+
export const tourLine34 =
51+
"When you overshoot, small upward steps should feel immediate and unsurprising.";
3552
export const tourLine35 = "The footer hints are there to help you build muscle memory on demand.";
36-
export const tourLine36 = "Once the basics feel good, hunk jumps become the faster path between review beats.";
53+
export const tourLine36 =
54+
"Once the basics feel good, hunk jumps become the faster path between review beats.";

examples/README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ Each folder tells a small review story and includes the exact command to run fro
66

77
## Quick menu
88

9-
| Example | Best for | Command |
10-
| --- | --- | --- |
11-
| `1-hello-diff` | fastest first run | `hunk diff examples/1-hello-diff/before.ts examples/1-hello-diff/after.ts` |
12-
| `2-mini-app-refactor` | realistic multi-file review | `hunk patch examples/2-mini-app-refactor/change.patch` |
13-
| `3-agent-review-demo` | inline agent rationale | `hunk patch examples/3-agent-review-demo/change.patch --agent-context examples/3-agent-review-demo/agent-context.json` |
14-
| `4-ui-polish` | screenshot-friendly TSX diff | `hunk diff examples/4-ui-polish/before.tsx examples/4-ui-polish/after.tsx` |
15-
| `5-pager-tour` | line scrolling, paging, and hunk jumps | `hunk diff --pager examples/5-pager-tour/before.ts examples/5-pager-tour/after.ts` |
16-
| `6-readme-screenshot` | README screenshot with agent notes | `hunk patch examples/6-readme-screenshot/change.patch --agent-context examples/6-readme-screenshot/agent-context.json --mode split --theme midnight` |
9+
| Example | Best for | Command |
10+
| --------------------- | -------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
11+
| `1-hello-diff` | fastest first run | `hunk diff examples/1-hello-diff/before.ts examples/1-hello-diff/after.ts` |
12+
| `2-mini-app-refactor` | realistic multi-file review | `hunk patch examples/2-mini-app-refactor/change.patch` |
13+
| `3-agent-review-demo` | inline agent rationale | `hunk patch examples/3-agent-review-demo/change.patch --agent-context examples/3-agent-review-demo/agent-context.json` |
14+
| `4-ui-polish` | screenshot-friendly TSX diff | `hunk diff examples/4-ui-polish/before.tsx examples/4-ui-polish/after.tsx` |
15+
| `5-pager-tour` | line scrolling, paging, and hunk jumps | `hunk diff --pager examples/5-pager-tour/before.ts examples/5-pager-tour/after.ts` |
16+
| `6-readme-screenshot` | README screenshot with agent notes | `hunk patch examples/6-readme-screenshot/change.patch --agent-context examples/6-readme-screenshot/agent-context.json --mode split --theme midnight` |
1717

1818
## Notes
1919

knip.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
{
22
"$schema": "https://unpkg.com/knip@latest/schema.json",
3-
"project": [
4-
"src/**/*.{ts,tsx}",
5-
"scripts/**/*.ts",
6-
"test/**/*.{ts,tsx}",
7-
"bin/**/*.cjs"
8-
],
3+
"project": ["src/**/*.{ts,tsx}", "scripts/**/*.ts", "test/**/*.{ts,tsx}", "bin/**/*.cjs"],
94
"ignoreDependencies": ["bun"]
105
}

0 commit comments

Comments
 (0)