phpcq / author-validation
检查特定文件中所有作者是否在版权头部被提及。
1.5.2
2022-12-28 10:47 UTC
Requires
- php: ^5.6 || ^7.1
- ext-json: *
- ext-posix: *
- bit3/git-php: ^1.5
- cache/doctrine-adapter: ^1.0
- doctrine/cache: ^1.5
- phpspec/php-diff: ^1.0
- sebastian/phpcpd: ^3.0 || ^4.1 || ^5.0 || ^6.0
- symfony/console: ^3.0 || ^4.0 || ^5.0
- symfony/finder: ^3.0 || ^4.0 || ^5.0
- symfony/process: ^3.0 || ^4.0 || ^5.0
- symfony/yaml: ^3.0 || ^4.0 || ^5.0
Requires (Dev)
- phpcq/all-tasks: ^1.3
README
验证PHP文件、composer.json、bower.json或packages.json中的作者信息。
这有助于确保在所有PHP文件、composer.json
、bower.json
和packages.json
中提及的所有作者(从git历史记录)。
用法
在composer.json
的require-dev
部分添加
"phpcq/author-validation": "~1.0"
调用二进制文件
./vendor/bin/check-author.php
可选地传递要检查的路径
./vendor/bin/check-author.php /path/to/some/repository/also/with/subdir
配置
可选地可以传递到配置文件的路径(默认为.check-author.yml),该文件将被使用。
# Example .check-author.yml
# Map multiple authors to a single one (aliasing of contributors).
mapping:
# original: alias
"John Doe <john@example.org>": "John Doe <jd@example.org>"
# or original: [multiple aliases]
"John Doe <john@example.org>": ["John Doe <jd@example.org>", "Acme Inc <info@example.org>"]
# or
"John Doe <john@example.org>":
- "John Doe <jd@example.org>"
- "Acme Inc <info@example.org>"
# Ignore commits from these authors (equivalent to cmd line parameter --ignore=...)
ignore:
- Build Bot <bot@example.org>
# If present, scan only these and not the whole base dir (equivalent to cmd line arguments).
# Values must either be absolute paths or relative to the current directory.
include:
- src
# Paths to exclude from scanning (equivalent to cmd line parameter --exclude=...)
exclude:
- Foo.php
- /tests/*
- */languages
# Enforce copy-left author for certain files.
copy-left:
"John Doe <jd@example.org>": "/library"
# or
"John Doe <jd@example.org>": ["/library", "File.php"]
# or
"John Doe <jd@example.org>":
- "File.php"
# Add additional author metadata. It is used by some comparator handlers when outputting diff format.
# Author metadata of the config file is prioritized over extracted metadata from the files.
metadata:
"John Doe <jd@example.org>":
role: "Translator"
homepage: "http:/www.example.org"