whotrades / bitbucket-code-style
此包的最新版本(v1.0.2)没有可用的许可证信息。
用于在 atlassian bitbucket 集成代码风格检查的机器人(支持 phpcs 和 cpplint)
v1.0.2
2023-11-22 08:06 UTC
Requires
- php: >=7.0
- guzzlehttp/guzzle: ~6.3
- monolog/monolog: ~1.23|^2.7
- squizlabs/php_codesniffer: 3.*
This package is auto-updated.
Last update: 2024-09-22 09:59:08 UTC
README
用于集成 phpcs 和 atlassian bitbucket 的脚本。该脚本检查 pull request 是否符合代码风格,并使用找到的错误评论。更多信息请参阅 https://habrahabr.ru/post/303348/
phpcs-bitbucket 工作原理
phpcs-bitbucket 工作结果
应用程序的工作结果是 atlassian bitbucket 中关于代码风格错误的评论
安装和配置
- 克隆存储库
- 运行 composer install
- 将 configuration.ini-dist 重命名为 configuration.ini
- 在 configuration.ini 中指定您的 atlassian bitbucket 的链接和登录名密码,并指定检查标准
运行
可以通过两种方式运行应用程序
- 使用控制台:运行命令
php app.php <branch> <slug> <repo>
(例如,对于存储库 https://example.com/projects/WT/repos/sparta/browse,slug 将等于 WT,而 repo - sparta - 使用 HTTP 请求:
index.php?slug=<slug>&branch=<branch>&repo=<repo>
与 pull request 集成
在 atlassian stash 中添加 webhook,指定 phpcs-bitbucket 中的 index.php 的链接,并带有参数 index.php?branch=${refChange.refId}&repo=${project.key}&slug=${repository.slug}