bristol-su/portal-pipeline

本包最新版本(v1.0.0)无可用许可信息。

Bristol SU Portal 样式

v1.0.0 2021-02-09 00:54 UTC

This package is auto-updated.

Last update: 2024-09-17 07:08:29 UTC


README

使您的编码风格符合Bristol SU Portal指南

安装

拉取此项目

composer require bristol-su/portal-code-style

在您的项目中创建一个 .php_cs.dist 文件。您可以在 ./vendor/bristol-su/portal-code-style/examples/.php_cs.dist.example 中找到一个示例。

在您的项目中创建一个 rector.php 文件。您可以在 ./vendor/bristol-su/portal-code-style/examples/rector.php 中找到一个示例。

将以下内容添加到您的 composer 脚本中

    "scripts": {
        "test": "vendor/bin/phpunit --colors=always --process-isolation --verbose --configuration phpunit.xml",
        "code-style": [
            "vendor/bin/php-cs-fixer fix --config .php_cs --dry-run --verbose --using-cache=no",
            "vendor/bin/rector process --dry-run --output-format=console"
        ],
        "fix-code-style": "vendor/bin/php-cs-fixer fix --config .php_cs --verbose --using-cache=no"
    }

Github Actions

现在您可以使用我们提供的操作设置 GitHub 工作流程。查看所有这些示例,请参阅 ./vendor/bristol-su/portal-code-style/examples/workflow.php

命令

您还可以在本地运行以下命令

composer run test:运行整个测试套件 composer run code-style:执行所有我们的编码检查的dry run,以确保您的代码将通过管道 composer run fix-code-style:自动修复任何格式问题