Skip to content

Commit

Permalink
feat!: use allowlist for allowed licenses (#153)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: The `packageWhitelist` field has been renamed to `packageAllowlist`.
  • Loading branch information
JustinBeckwith committed Jan 22, 2021
1 parent 0853376 commit d24827f
Show file tree
Hide file tree
Showing 8 changed files with 309 additions and 613 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
on:
push:
branches:
- master
- main
pull_request:
name: ci
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node: [10, 12, 13]
node: [10, 12, 14, 15]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
- run: node --version
Expand All @@ -27,9 +27,9 @@ jobs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/setup-node@v2
with:
node-version: 12
node-version: 14
- run: npm ci
- run: npm test
- name: coverage
Expand All @@ -41,17 +41,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/setup-node@v2
with:
node-version: 12
node-version: 14
- run: npm ci
- run: npm run lint
licence-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/setup-node@v2
with:
node-version: 12
node-version: 14
- run: npm ci
- run: npm run license-check
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,12 @@ const DEFAULT_GREEN_LICENSES = [
];
```

You can also whitelist some npm packages and they will be considered "green"
You can also allowlist some npm packages and they will be considered "green"
even when they have non-green licenses or no licenses. It's useful when
`jsgl` is unable to verify the validness of a certain package's license for
some reason. For example, when a package doesn't specify its license in its
`package.json` but has a separate `LICENSE` file, `jsgl` can't verify that.
You can whitelist that package to make `jsgl` not complain about that
You can allowlist that package to make `jsgl` not complain about that
package.

A typical configuration file looks like this:
Expand All @@ -141,7 +141,7 @@ A typical configuration file looks like this:
"BSD-3-Clause",
...
],
"packageWhitelist": [
"packageAllowlist": [
/* packages considered ok */
"foo",
"bar", // inline comment
Expand All @@ -153,7 +153,7 @@ A typical configuration file looks like this:
```

The `greenLicenses` section is for the custom license list and the
`packageWhitelist` section is for the package whitelist.
`packageAllowlist` section is for the package allowlist.

Note that comments are allowed in `js-green-licenses.json`.

Expand Down Expand Up @@ -310,7 +310,7 @@ A `LicenseChecker` object emits following events during its processing.

[actions-image]: https://github.com/google/js-green-licenses/workflows/ci/badge.svg
[actions-url]: https://github.com/google/js-green-licenses/actions
[codecov-image]: https://codecov.io/gh/google/js-green-licenses/branch/master/graph/badge.svg
[codecov-image]: https://codecov.io/gh/google/js-green-licenses/branch/main/graph/badge.svg
[codecov-url]: https://codecov.io/gh/google/js-green-licenses
[david-image]: https://david-dm.org/google/js-green-licenses.svg
[david-url]: https://david-dm.org/google/js-green-licenses
Expand Down

0 comments on commit d24827f

Please sign in to comment.