grep as a linter, but we want to add more context to the matches. We could define a custom linter like so:
trunk follows for a parser is that it will:
- execute the linter’s
runfield, asserting that either:- the linter’s exit code is in
success_codes, or - the linter’s exit code is not in
error_codes;
- the linter’s exit code is in
- execute
parser.run,- with the
read_output_fromof the linter execution fed toparser.runasstdin, - assert that the exit code of the parser is 0, and then
- with the
- use
outputto determine how it should parse the parser’sstdout.
parser.runtime to node or python so that you can write your parser in Javascript or Python instead, if you so prefer! You can find plenty of examples of python parsers in our plugins repo.
- node
- python
NodeRemember to run
chmod u+x todo-finder-parser.js so that trunk can run it!