master
Anton Smirnov 2022-06-05 13:33:10 +03:00
parent dafd5497a4
commit d3d8570336
9 changed files with 154 additions and 1 deletions

1
.gitignore vendored
View File

@ -1,4 +1,5 @@
/.idea
/reports
/docs/html
vendor
composer.lock

View File

@ -2,7 +2,7 @@
"name": "arokettu/composer-license-manager",
"type": "composer-plugin",
"description": "License management plugin for Composer",
"keywords": ["composer", "license"],
"keywords": ["composer", "composer plugin", "license", "licenses", "license management"],
"license": "MIT",
"authors": [
{
@ -13,6 +13,9 @@
}
],
"support": {
"source": "https://gitlab.com/sandfox/composer-license-manager",
"issues": "https://gitlab.com/sandfox/composer-license-manager/-/issues",
"chat": "https://gitter.im/arokettu/community"
},
"config": {
"platform": {

22
docs/_templates/sidebar/brand.html vendored Normal file
View File

@ -0,0 +1,22 @@
<a class="sidebar-brand{% if logo %} centered{% endif %}" href="{{ pathto(master_doc) }}">
{% block brand_content %}
{%- if logo_url %}
<div class="sidebar-logo-container">
<img class="sidebar-logo" src="{{ logo_url }}" alt="Logo"/>
</div>
{%- endif %}
{%- if theme_light_logo and theme_dark_logo %}
<div class="sidebar-logo-container">
<img class="sidebar-logo only-light" src="{{ pathto('_static/' + theme_light_logo, 1) }}" alt="Light Logo"/>
<img class="sidebar-logo only-dark" src="{{ pathto('_static/' + theme_dark_logo, 1) }}" alt="Dark Logo"/>
</div>
{%- endif %}
{% if not theme_sidebar_hide_name %}
<span class="sidebar-brand-text">{{ docstitle if docstitle else project }}</span>
{%- endif %}
{% endblock brand_content %}
</a>
{%- if current_version -%}
<div class="sidebar-brand">{{ current_version }}</div>
{%- endif -%}

2
docs/cli.rst Normal file
View File

@ -0,0 +1,2 @@
Command Line Interface
######################

10
docs/conf.py Normal file
View File

@ -0,0 +1,10 @@
from datetime import datetime
project = 'Composer License Manager'
author = 'Anton Smirnov'
copyright = '{} {}'.format(datetime.now().year, author)
language = 'en'
html_title = project
html_theme = 'furo'
templates_path = ["_templates"]

70
docs/config.rst Normal file
View File

@ -0,0 +1,70 @@
Configuration
#############
The plugin is configured in the ``extras`` section of the ``composer.json`` file.
Example
=======
.. code-block:: json
{
"extras": {
"arokettu/composer-license-manager": {
"licenses": {
"allowed": ["MIT", "LGPL-*"],
"forbidden": ["GPL-3.0", "AGPL-*"],
"allow-empty": true
}
"packages": {
"allowed": ["foo/bar", "safenamespace/*"]
},
"enforced": true
}
}
}
Licenses
========
Licenses section configures desired and undesired licenses.
``"allowed"``
Whitelisted licenses. Allows globs in prefix form (``*`` as the last character).
Default: ``["*"]``
``"forbidden"``
Blacklisted licenses. Allows globs in prefix form (``*`` as the last character).
Default: ``[]``
``"allow-empty"``
Allow packages with no license set.
Default: ``false``
Check order:
#. exact forbidden licenses
#. exact allowed licenses
#. licenses forbidden by glob
#. licenses allowed by glob
License identifiers are checked in case insensitive manner.
SPDX License expressions like ``(MIT OR LGPL)`` are not evaluated and must be specified exactly.
They are also ignored by globs except for match-all glob ``"*"``.
Multiple specified licenses are treated like a disjunction so if any of the licenses conform to the policy, the package is considered conforming to the policy.
Packages
========
Package exceptions to the policy enforcement.
``"allowed"``
Whitelisted packages. Allows globs in prefix form (``*`` as the last character).
Default: ``[]``
Enforcement
===========
``"enforced"``
If true, the license policy is enforced during package installation and update,
refer to :ref:`licensepolicyenforcement` for further info.
Default: ``true``

4
docs/enforcement.rst Normal file
View File

@ -0,0 +1,4 @@
.. _licensepolicyenforcement:
Policy Enforcement
##################

40
docs/index.rst Normal file
View File

@ -0,0 +1,40 @@
Composer License Manager
########################
|Packagist| |GitLab| |GitHub| |Bitbucket| |Gitea|
License management plugin for Composer.
Installation
============
.. code-block:: bash
composer require 'arokettu/composer-license-manager'
Documentation
=============
.. toctree::
config
cli
enforcement
License
=======
The library is available as open source under the terms of the `MIT License`_.
.. _MIT License: https://opensource.org/licenses/MIT
.. |Packagist| image:: https://img.shields.io/packagist/v/arokettu/composer-license-manager.svg?style=flat-square
:target: https://packagist.org/packages/arokettu/composer-license-manager
.. |GitHub| image:: https://img.shields.io/badge/get%20on-GitHub-informational.svg?style=flat-square&logo=github
:target: https://github.com/arokettu/composer-license-manager
.. |GitLab| image:: https://img.shields.io/badge/get%20on-GitLab-informational.svg?style=flat-square&logo=gitlab
:target: https://gitlab.com/sandfox/composer-license-manager
.. |Bitbucket| image:: https://img.shields.io/badge/get%20on-Bitbucket-informational.svg?style=flat-square&logo=bitbucket
:target: https://bitbucket.org/sandfox/composer-license-manager
.. |Gitea| image:: https://img.shields.io/badge/get%20on-Gitea-informational.svg?style=flat-square&logo=gitea
:target: https://sandfox.org/sandfox/composer-license-manager

1
docs/requirements.txt Normal file
View File

@ -0,0 +1 @@
furo