jdeniau / behat-reviewdog-formatter
A behat formatter that does output to rdjsonl to be handled by reviewdog
Installs: 3 691
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- behat/behat: ^3
Requires (Dev)
- friends-of-behat/mink-extension: ^2.7
- friends-of-behat/symfony-extension: ^2.5
- mockery/mockery: ^1.6
- php-mock/php-mock-phpunit: ^2.9
- phpstan/extension-installer: ^1.3
- phpstan/phpstan: ^1.10
- phpstan/phpstan-mockery: ^1.1
- phpstan/phpstan-phpunit: ^1.3
- phpunit/phpunit: ^10.5
Suggests
- friends-of-behat/mink-extension: To extract data from mink context.
- friends-of-behat/symfony-extension: To extract data from symfony context.
README
A behat formatter that does output to rdjsonl to be handled by reviewdog
Installation
composer require --dev jdeniau/behat-reviewdog-formatter
Usage
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
Different output per profile
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
Related
Want more detail about how you can create your own behat extension ? See how this extension has been made in this blogpost