diff --git a/src/check-project/check-monorepo-readme.js b/src/check-project/check-monorepo-readme.js index 8a9c63251..9277be95c 100644 --- a/src/check-project/check-monorepo-readme.js +++ b/src/check-project/check-monorepo-readme.js @@ -108,7 +108,7 @@ export async function checkMonorepoReadme (projectDir, repoUrl, defaultBranch, p parsedReadme.children.push(child) }) - const license = parseMarkdown(LICENSE[repoOwner] ?? LICENSE.default) + const license = parseMarkdown(LICENSE(pkg, repoOwner, repoName, defaultBranch)) const structure = parseMarkdown(STRUCTURE(projectDir, projectDirs)) parsedReadme.children = [ diff --git a/src/check-project/check-readme.js b/src/check-project/check-readme.js index 15d8349e4..9d5a8e22a 100644 --- a/src/check-project/check-readme.js +++ b/src/check-project/check-readme.js @@ -116,7 +116,7 @@ export async function checkReadme (projectDir, repoUrl, defaultBranch) { }) const installation = parseMarkdown(INSTALL(pkg)) - const license = parseMarkdown(LICENSE[repoOwner] ?? LICENSE.default) + const license = parseMarkdown(LICENSE(pkg, repoOwner, repoName, defaultBranch)) parsedReadme.children = [ ...installation.children, diff --git a/src/check-project/readme/license.js b/src/check-project/readme/license.js index 8d8984c70..b45caf331 100644 --- a/src/check-project/readme/license.js +++ b/src/check-project/readme/license.js @@ -1,7 +1,8 @@ - -/** @type {Record} */ -export const LICENSE = { - ipfs: ` +/** + * @type {Record string>} + */ +const licenses = { + ipfs: (repoOwner, repoName, defaultBranch) => ` ## License Licensed under either of @@ -11,13 +12,17 @@ Licensed under either of ## Contribute -Feel free to join in. All welcome. Open an [issue](https://github.com/ipfs/js-ipfs-unixfs-importer/issues)! +Contributions welcome! Please check out [the issues](https://github.com/${repoOwner}/${repoName}/issues). + +Also see our [contributing document](https://github.com/ipfs/community/blob/master/CONTRIBUTING_JS.md) for more information on how we work, and about contributing in general. -This repository falls under the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md). +Please be aware that all interactions related to this repo are subject to the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md). + +Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. [![](https://cdn.rawgit.com/jbenet/contribute-ipfs-gif/master/img/contribute.gif)](https://github.com/ipfs/community/blob/master/CONTRIBUTING.md) `, - default: ` + default: (repoOwner, repoName, defaultBranch) => ` ## License Licensed under either of @@ -25,8 +30,18 @@ Licensed under either of * Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / http://www.apache.org/licenses/LICENSE-2.0) * MIT ([LICENSE-MIT](LICENSE-MIT) / http://opensource.org/licenses/MIT) -## Contribution +## Contribute Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. ` } + +/** + * @param {*} pkg + * @param {string} repoOwner + * @param {string} repoName + * @param {string} defaultBranch + */ +export const LICENSE = (pkg, repoOwner, repoName, defaultBranch) => { + return (licenses[repoOwner] ?? licenses.default)(repoOwner, repoName, defaultBranch) +}