timoschinkel/codeowners 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

timoschinkel/codeowners

最新稳定版本:2.3.1

Composer 安装命令:

composer require timoschinkel/codeowners

包简介

A parser and matcher for the codeowners file as used by Github, Gitlab and Bitbucket.

README 文档

README

Code Owners allows you to parse code owners files and apply the outcome to all kinds of different result sets ranging from code coverage to static analysis results.

Code Owners files are supported by Github, Gitlab and Bitbucket.

Installation

Use Composer for installation:

composer require timoschinkel/codeowners

Usage

Parse CODEOWNERS file:

<?php

use CodeOwners\Parser;
use CodeOwners\PatternMatcher;

try {
    $patterns = (new Parser())->parseFile($filename);
    $pattern = (new PatternMatcher(...$patterns))->match($filename);
} catch (\CodeOwners\Exception\UnableToParseException $exception) {
    // unable to read or parse file
} catch (\CodeOwners\Exception\NoMatchFoundException $exception) {
    // no match found
}

Alternatively, parsing a string directly is also supported:

<?php

use CodeOwners\Parser;
use CodeOwners\PatternMatcher;

try {
    $patterns = (new Parser())->parseString($contents);
    $pattern = (new PatternMatcher(...$patterns))->match($filename);
} catch (\CodeOwners\Exception\UnableToParseException $exception) {
    // unable to read or parse file
} catch (\CodeOwners\Exception\NoMatchFoundException $exception) {
    // no match found
}

Known limitations

Currently the library does not handle spaces in file paths.

统计信息

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

GitHub 信息

  • Stars: 7
  • Watchers: 2
  • Forks: 5
  • 开发语言: PHP

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2019-02-26