A behat formatter that does output to rdjsonl to be handled by reviewdog
composer require --dev jdeniau/behat-reviewdog-formatter
Configure your behat.yml
file:
default:
extensions:
JDeniau\BehatReviewdogFormatter\ReviewdogFormatterExtension: ~
formatters:
pretty: true
reviewdog: # "reviewdog" here is the "name" given in our formatter
# outputh_path is optional and handled directy by behat
output_path: 'build/logs/behat'
# file_name is optional and a custom parameter that we inject into the printer
file_name: 'reviewdog-behat.json'
# optional, default to true
remove_old_file: true
You can active the extension only for a certain profile by specifying a profile in your command (ex: --profile=ci
)
For example if you want the pretty formatter by default, but both progress and reviewdog on your CI, you can configure it like that:
default:
extensions:
JDeniau\BehatReviewdogFormatter\ReviewdogFormatterExtension: ~
formatters:
pretty: true
ci:
formatters:
pretty: false
progress: true
reviewdog:
output_path: 'build/logs/behat'
file_name: 'reviewdog-behat.json'
# optional, default to true
remove_old_file: true
Want more detail about how you can create your own behat extension ? See how this extension has been made in this blogpost