承接 shyim/danger-php 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

shyim/danger-php

最新稳定版本:0.3.11

Composer 安装命令:

composer create-project shyim/danger-php

包简介

Port of danger to PHP

README 文档

README

Danger runs during your CI process, and gives teams the chance to automate common code review chores. This project ports Danger to PHP.

Currently only GitHub and Gitlab are supported as Platform

Badges

MIT License codecov

Installation

Composer

Install danger-php using Composer

composer global require shyim/danger-php

Phar Archive

Every release has a phar archive attached

Docker

Use the prebuilt Docker image

Documentation

Disallow multiple commits with same message

<?php declare(strict_types=1);

use Danger\Config;
use Danger\Rule\DisallowRepeatedCommits;

return (new Config())
    ->useRule(new DisallowRepeatedCommits) // Disallows multiple commits with the same message
;

Only allow one commit in Pull Request

<?php declare(strict_types=1);

use Danger\Config;
use Danger\Rule\MaxCommit;

return (new Config())
    ->useRule(new MaxCommit(1))
;

Check for modification on CHANGELOG.md

<?php declare(strict_types=1);

use Danger\Config;
use Danger\Context;

return (new Config())
    ->useRule(function (Context $context): void {
        if (!$context->platform->pullRequest->getFiles()->has('CHANGELOG.md')) {
            $context->failure('Please edit also the CHANGELOG.md');
        }
    })
;

Check for Assignee in PR

<?php declare(strict_types=1);

use Danger\Config;
use Danger\Context;

return (new Config())
    ->useRule(function (Context $context): void {
        if (count($context->platform->pullRequest->assignees) === 0) {
            $context->warning('This PR currently doesn\'t have an assignee');
        }
    })
;

Screenshots

Example Comment

License

MIT

统计信息

  • 总下载量: 36.37k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 85
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 85
  • Watchers: 3
  • Forks: 8
  • 开发语言: PHP

其他信息

  • 授权协议: mit
  • 更新时间: 2021-05-21