todo-backend: add support for configuring the default parser
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -35,3 +35,24 @@ export default async function createPlugin({
|
||||
return await createRouter({ todoService });
|
||||
}
|
||||
```
|
||||
|
||||
## Parser Configuration
|
||||
|
||||
The `TodoScmReader` accepts a `TodoParser` option, which can be used to configure your own parser. The default one is based on [Leasot](https://github.com/pgilad/leasot) and supports a wide range of languages. You can change the list of supported tags by configuring your own version of the built-in parser, for example:
|
||||
|
||||
```ts
|
||||
import {
|
||||
TodoScmReader,
|
||||
createTodoParser,
|
||||
} from '@backstage/plugin-todo-backend';
|
||||
|
||||
// ...
|
||||
|
||||
const todoReader = TodoScmReader.fromConfig(config, {
|
||||
logger,
|
||||
reader,
|
||||
parser: createTodoParser({
|
||||
tags: ['TODO', 'FIXME', 'NOTE', 'XXX'],
|
||||
}),
|
||||
});
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user