jdeniau/behat-reviewdog-formatter

一个将输出转换为 rdjsonl 以供 reviewdog 处理的 behat 格式化器

v0.3.1 2024-09-16 12:05 UTC

This package is auto-updated.

Last update: 2024-09-16 12:05:49 UTC


README

一个将输出转换为 rdjsonl 以供 reviewdog 处理的 behat 格式化器

安装

composer require --dev jdeniau/behat-reviewdog-formatter

用法

配置您的 behat.yml 文件

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

不同配置文件的不同输出

您可以通过在命令中指定配置文件来仅激活扩展,例如(--profile=ci

例如,如果您想默认使用美观的格式化器,但同时在您的 CI 中使用进度和 reviewdog,您可以这样配置:

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

相关

想要了解更多关于如何创建您自己的 behat 扩展的信息?请参阅 这篇博客文章 中是如何制作此扩展的。