diff --git a/plugins/todo-backend/src/lib/TodoReader/TodoScmReader.test.ts b/plugins/todo-backend/src/lib/TodoReader/TodoScmReader.test.ts index 1ca836162e..3e074f78a6 100644 --- a/plugins/todo-backend/src/lib/TodoReader/TodoScmReader.test.ts +++ b/plugins/todo-backend/src/lib/TodoReader/TodoScmReader.test.ts @@ -252,7 +252,7 @@ describe('TodoScmReader', () => { files: async () => [ { content: async () => Buffer.from('// TODO: my-todo', 'utf8'), - path: 'my-folder/my-file.js', + path: '', }, ], } as ReadTreeResponse); @@ -261,16 +261,7 @@ describe('TodoScmReader', () => { url: 'https://github.com/backstage/backstage/catalog-info.yaml', }), ).resolves.toEqual({ - items: [ - { - text: 'my-todo', - tag: 'TODO', - lineNumber: 1, - repoFilePath: 'my-folder/my-file.js', - viewUrl: - 'https://github.com/backstage/backstage/my-folder/my-file.js#L1', - }, - ], + items: [], }); expect(reader.readTree).toHaveBeenCalledTimes(1); expect(reader.readTree).toHaveBeenCalledWith( diff --git a/plugins/todo-backend/src/lib/TodoReader/TodoScmReader.ts b/plugins/todo-backend/src/lib/TodoReader/TodoScmReader.ts index 9514a8a2cf..2696f0d54b 100644 --- a/plugins/todo-backend/src/lib/TodoReader/TodoScmReader.ts +++ b/plugins/todo-backend/src/lib/TodoReader/TodoScmReader.ts @@ -92,12 +92,7 @@ export class TodoScmReader implements TodoReader { } const cacheItem = this.cache.get(url); - const filePathFilter = this.filePathFilter; - const newRead = this.doReadTodos( - { url }, - filePathFilter, - cacheItem?.etag, - ).catch(error => { + const newRead = this.doReadTodos({ url }, cacheItem?.etag).catch(error => { if (cacheItem && error.name === 'NotModifiedError') { return cacheItem; } @@ -116,11 +111,10 @@ export class TodoScmReader implements TodoReader { private async doReadTodos( options: ReadTodosOptions, - filePathFilter: (filePath: string) => boolean, etag?: string, ): Promise { const { url } = options; - + const filePathFilter = this.filePathFilter; const tree = await this.reader.readTree(url, { etag, filter(filePath, info) {