dzunke / panaly-codeowners
A Panaly plugin that makes it able to write paths from a CODEOWNERS file to metrics
Requires
- php: ^8.2
- dzunke/panaly: dev-main
- psr/log: ^3.0
- symfony/finder: ^7.0
- timoschinkel/codeowners: ^2.1
Requires (Dev)
- doctrine/coding-standard: ^12.0
- phpstan/phpstan: ^1.10
- phpstan/phpstan-deprecation-rules: ^1.1
- phpstan/phpstan-strict-rules: ^1.5
- phpunit/phpunit: ^11.1
- symfony/var-dumper: ^7.0
This package is auto-updated.
Last update: 2024-12-13 18:50:56 UTC
README
The plugin to the Panaly Project Analyzer can be utilized to enable metrics which are supporting paths receiving them from a CODEOWNERS file.
Example Configuration
# panaly.dist.yaml plugins: DZunke\PanalyCodeOwners\CodeOwnersPlugin: codeowners: CODEOWNERS exclude_directories: [ 'vendor' ] replace: - metric: filesystem.file_count type: relative write: paths option: paths owners: [ '@Hulk', '@DrStrange' ] groups: ownership: title: "Information around the Project Ownership" metrics: unowned_directories: ~ owned_files_count: owners: [ '@my_owner_group' ] owned_files_list: owners: [ '@my_owner_group' ] owned_directories_count: owners: [ '@my_owner_group', '@another_owner_group' ] owned_directories_list: owners: [ '@my_owner_group', '@another_owner_group' ]
Options for single metric replacement
Available Metrics
Unowned Directories
The directory count with the name unowned_directories
gives an Table
result with a listing of all unowned directories.
Beware that the list can be very long. There are no options available. The CODEOWNER file from the plugin options is utilized.
Owned Files Count
The file count with the name owned_files_count
gives an IntegerValue
result with a summarization of all owned files
of specific owners. The owners option has to be given to let the metric work correct, otherwise it will return a zero value.
Owned Files Listing
The file count with the name owned_files_list
gives an Table
result with a listing of all owned files with relative path
of specific owners. The owners option has to be given to let the metric work correct, otherwise it will return an empty list.
Owned Directories Count
The directory count with the name owned_directories_count
gives an IntegerValue
result with a summarization of all
owned directories of specific owners. The owners option has to be given to let the metric work correct, otherwise it will
return a zero value.
Owned Directory Listing
The file count with the name owned_directories_list
gives an Table
result with a listing of all owned directories
with relative path of specific owners. The owners option has to be given to let the metric work correct, otherwise it
will return an empty list.
Known Problems
- There is no general specification for the
CODEOWNERS
file, so currently just the Github specification is supported- For example the Gitlab specification with sections and section owners is not supported
Thanks and License
Panaly Project Analyzer - CODEOWNERS Plugin © 2024+, Denis Zunke. Released utilizing the MIT License.