Cog-Creators / Cog-Creators/Red-DiscordBot

Cog license indication in info.json

Open
#5,010 2 comments 0 reactions 0 assignees View on GitHub
Category: Cogs - Downloader Status: Needs Discussion Type: Feature
Dominant language
Python
Stars
5.7k
Forks
2.5k
Avg merge
6d 16h
Merged PRs (30d)
1

Description

### Type of feature request

API functionality, Command

### Description of the feature you're suggesting

As it stands, neither the `[p]cog info` command nor the `info.json` format give information about the cog's license, which would be nice to be able to inspect at a glance. The ability for end users to know what rights they have to use the cog are important. For example, some cogs might be licensed under the [AGPL], and thus anyone running a bot would be obligated to provide the source code of that cog.

My first thought, because it's easy for developers and used in many other package managers, would be to include a `license` field within `info.json` that contains an [SPDX license expression][1]. The cog manager would either point to and let the user figure it out (it's not too hard) or parse the expression into hyperlinks. (e.g., `AGPL-3.0-or-later` -> ). The main issue with this approach is proprietary licenses (excluding the Creative Commons suite), but I feel like this is enough of an edge case that proprietary cogs could just not include it in `info.json`.

A major benefit of SPDX license expressions is that, at least in the future, we could provide a summary of licenses used for the entire bot installation. I was imagining some sort of `[p]license` command for summing everything up, if the `[p]cog` command isn't best-suited for that purpose.

Additionally, even if it's not within the bot itself, the cog index would greatly benefit from this as well, since people could filter by licenses if some are impractical for their setup.

[1]: https://spdx.github.io/spdx-spec/appendix-IV-SPDX-license-expressions/
[AGPL]: https://www.gnu.org/licenses/agpl.html

### Anything else?

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.