Skip to content

Commit d5f0c81

Browse files
authored
Merge pull request #15 from fulll/feat/markdown-todo-list-output
Use markdown TODO list items for file links in markdown output
2 parents 02cc28a + d66ec34 commit d5f0c81

3 files changed

Lines changed: 36 additions & 24 deletions

File tree

README.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -153,15 +153,15 @@ After pressing **Enter**:
153153
3 repos · 6 files · 7 matches selected
154154

155155
- **fulll/auth-service** (2 matches)
156-
- [src/middlewares/featureFlags.ts:2:19](https://github.com/fulll/auth-service/blob/main/src/middlewares/featureFlags.ts#L2)
157-
- [tests/unit/featureFlags.test.ts:1:8](https://github.com/fulll/auth-service/blob/main/tests/unit/featureFlags.test.ts#L1)
156+
- [ ] [src/middlewares/featureFlags.ts:2:19](https://github.com/fulll/auth-service/blob/main/src/middlewares/featureFlags.ts#L2)
157+
- [ ] [tests/unit/featureFlags.test.ts:1:8](https://github.com/fulll/auth-service/blob/main/tests/unit/featureFlags.test.ts#L1)
158158
- **fulll/billing-api**
159-
- [src/flags.ts:3:14](https://github.com/fulll/billing-api/blob/main/src/flags.ts#L3)
160-
- [src/routes/invoices.ts:1:1](https://github.com/fulll/billing-api/blob/main/src/routes/invoices.ts#L1)
161-
- [src/routes/subscriptions.ts:1:1](https://github.com/fulll/billing-api/blob/main/src/routes/subscriptions.ts#L1)
159+
- [ ] [src/flags.ts:3:14](https://github.com/fulll/billing-api/blob/main/src/flags.ts#L3)
160+
- [ ] [src/routes/invoices.ts:1:1](https://github.com/fulll/billing-api/blob/main/src/routes/invoices.ts#L1)
161+
- [ ] [src/routes/subscriptions.ts:1:1](https://github.com/fulll/billing-api/blob/main/src/routes/subscriptions.ts#L1)
162162
- **fulll/frontend-app**
163-
- [src/hooks/useFeatureFlag.ts:1:1](https://github.com/fulll/frontend-app/blob/main/src/hooks/useFeatureFlag.ts#L1)
164-
- [src/components/Dashboard.tsx:4:3](https://github.com/fulll/frontend-app/blob/main/src/components/Dashboard.tsx#L4)
163+
- [ ] [src/hooks/useFeatureFlag.ts:1:1](https://github.com/fulll/frontend-app/blob/main/src/hooks/useFeatureFlag.ts#L1)
164+
- [ ] [src/components/Dashboard.tsx:4:3](https://github.com/fulll/frontend-app/blob/main/src/components/Dashboard.tsx#L4)
165165

166166
<details>
167167
<summary>replay command</summary>
@@ -209,13 +209,13 @@ $ CI=true github-code-search "useFeatureFlag" --org fulll
209209
3 repos · 5 matches selected
210210

211211
- **fulll/auth-service**
212-
- [src/middlewares/featureFlags.ts:2:19](https://github.com/fulll/auth-service/blob/main/src/middlewares/featureFlags.ts#L2)
213-
- [tests/unit/featureFlags.test.ts:1:8](https://github.com/fulll/auth-service/blob/main/tests/unit/featureFlags.test.ts#L1)
212+
- [ ] [src/middlewares/featureFlags.ts:2:19](https://github.com/fulll/auth-service/blob/main/src/middlewares/featureFlags.ts#L2)
213+
- [ ] [tests/unit/featureFlags.test.ts:1:8](https://github.com/fulll/auth-service/blob/main/tests/unit/featureFlags.test.ts#L1)
214214
- **fulll/billing-api**
215-
- [src/flags.ts:3:14](https://github.com/fulll/billing-api/blob/main/src/flags.ts#L3)
216-
- [src/routes/invoices.ts:1:1](https://github.com/fulll/billing-api/blob/main/src/routes/invoices.ts#L1)
215+
- [ ] [src/flags.ts:3:14](https://github.com/fulll/billing-api/blob/main/src/flags.ts#L3)
216+
- [ ] [src/routes/invoices.ts:1:1](https://github.com/fulll/billing-api/blob/main/src/routes/invoices.ts#L1)
217217
- **fulll/frontend-app**
218-
- [src/hooks/useFeatureFlag.ts:1:1](https://github.com/fulll/frontend-app/blob/main/src/hooks/useFeatureFlag.ts#L1)
218+
- [ ] [src/hooks/useFeatureFlag.ts:1:1](https://github.com/fulll/frontend-app/blob/main/src/hooks/useFeatureFlag.ts#L1)
219219

220220
<details>
221221
<summary>replay command</summary>
@@ -276,12 +276,12 @@ github-code-search "useFeatureFlag" --org fulll
276276
2 repos · 3 matches selected
277277

278278
- **fulll/auth-service**
279-
- [src/middlewares/featureFlags.ts:2:19](https://github.com/fulll/auth-service/blob/main/src/middlewares/featureFlags.ts#L2)
279+
- [ ] [src/middlewares/featureFlags.ts:2:19](https://github.com/fulll/auth-service/blob/main/src/middlewares/featureFlags.ts#L2)
280280
- **fulll/billing-api**
281-
- [src/flags.ts:3:14](https://github.com/fulll/billing-api/blob/main/src/flags.ts#L3)
282-
- [src/routes/invoices.ts:1:1](https://github.com/fulll/billing-api/blob/main/src/routes/invoices.ts#L1)
281+
- [ ] [src/flags.ts:3:14](https://github.com/fulll/billing-api/blob/main/src/flags.ts#L3)
282+
- [ ] [src/routes/invoices.ts:1:1](https://github.com/fulll/billing-api/blob/main/src/routes/invoices.ts#L1)
283283
- **fulll/frontend-app**
284-
- [src/hooks/useFeatureFlag.ts:1:1](https://github.com/fulll/frontend-app/blob/main/src/hooks/useFeatureFlag.ts#L1)
284+
- [ ] [src/hooks/useFeatureFlag.ts:1:1](https://github.com/fulll/frontend-app/blob/main/src/hooks/useFeatureFlag.ts#L1)
285285

286286
<details>
287287
<summary>replay command</summary>
@@ -352,22 +352,22 @@ applies the following grouping algorithm:
352352
## squad-backend
353353
354354
- **fulll/billing-api** (3 matches)
355-
- [src/flags.ts:3:14](https://github.com/fulll/billing-api/blob/main/src/flags.ts#L3)
355+
- [ ] [src/flags.ts:3:14](https://github.com/fulll/billing-api/blob/main/src/flags.ts#L3)
356356
357357
## squad-frontend
358358
359359
- **fulll/auth-service** (2 matches)
360-
- [src/middlewares/featureFlags.ts:2:19](...)
360+
- [ ] [src/middlewares/featureFlags.ts:2:19](...)
361361
362362
## squad-frontend + squad-mobile
363363
364364
- **fulll/frontend-app** (1 match)
365-
- [src/hooks/useFeatureFlag.ts:1:1](...)
365+
- [ ] [src/hooks/useFeatureFlag.ts:1:1](...)
366366
367367
## other
368368
369369
- **fulll/legacy-monolith** (1 match)
370-
- [src/legacy.js:5:1](...)
370+
- [ ] [src/legacy.js:5:1](...)
371371
```
372372

373373
### TUI with sections

src/output.test.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,20 @@ describe("buildMarkdownOutput", () => {
204204
it("renders each file as an indented sub-bullet", () => {
205205
const groups = [makeGroup("myorg/repoA", ["src/a.ts", "src/b.ts"])];
206206
const out = buildMarkdownOutput(groups, QUERY, ORG, new Set(), new Set());
207-
expect(out).toContain(" - [src/a.ts](https://github.com/myorg/repoA/blob/main/src/a.ts)");
208-
expect(out).toContain(" - [src/b.ts](https://github.com/myorg/repoA/blob/main/src/b.ts)");
207+
expect(out).toContain(" - [ ] [src/a.ts](https://github.com/myorg/repoA/blob/main/src/a.ts)");
208+
expect(out).toContain(" - [ ] [src/b.ts](https://github.com/myorg/repoA/blob/main/src/b.ts)");
209+
});
210+
211+
it("renders file links as markdown TODO list items (- [ ] [...])", () => {
212+
const groups = [makeGroup("myorg/repoA", ["src/foo.ts"])];
213+
const out = buildMarkdownOutput(groups, QUERY, ORG, new Set(), new Set());
214+
expect(out).toContain(" - [ ] [src/foo.ts](");
215+
});
216+
217+
it("renders file links with location as markdown TODO items", () => {
218+
const groups = [makeGroupWithMatches("myorg/repoA", [{ path: "src/foo.ts", line: 3, col: 5 }])];
219+
const out = buildMarkdownOutput(groups, QUERY, ORG, new Set(), new Set());
220+
expect(out).toContain(" - [ ] [src/foo.ts:3:5](");
209221
});
210222

211223
it("omits deselected repos", () => {

src/output.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,9 @@ export function buildMarkdownOutput(
146146
// absolute line numbers).
147147
const seg = m.textMatches[0]?.matches[0];
148148
if (seg) {
149-
lines.push(` - [${m.path}:${seg.line}:${seg.col}](${m.htmlUrl}#L${seg.line})`);
149+
lines.push(` - [ ] [${m.path}:${seg.line}:${seg.col}](${m.htmlUrl}#L${seg.line})`);
150150
} else {
151-
lines.push(` - [${m.path}](${m.htmlUrl})`);
151+
lines.push(` - [ ] [${m.path}](${m.htmlUrl})`);
152152
}
153153
}
154154
}

0 commit comments

Comments
 (0)