todo-backend: added comment parser tests and tweaks

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2021-03-12 11:06:03 +01:00
parent 6231a9a0d4
commit da6bce39e4
3 changed files with 133 additions and 7 deletions
+2 -2
View File
@@ -38,7 +38,7 @@ export default async function createPlugin({
## 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:
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 add to the list of supported tags by configuring your own version of the built-in parser, for example:
```ts
import {
@@ -52,7 +52,7 @@ const todoReader = TodoScmReader.fromConfig(config, {
logger,
reader,
parser: createTodoParser({
tags: ['TODO', 'FIXME', 'NOTE', 'XXX'],
additionalTags: ['NOTE', 'XXX'],
}),
});
```