Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add informations about whitelisting modules into the README.md #35

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,12 @@ or Yarn:
yarn add @brainhubeu/license-auditor
```

In the next step, copy `license-template` directory with `licenses.js`, `blacklist.js`, and `whitelist.js` files, naming it `license` in your project. The first one contains a full list of all currently acknowledged, depreciated, and exceptional software licenses. To whitelist or blacklist the license, you must copy selected licenses from the main file into them.
In the next step, copy `license-template` directory with `licenses.js`, `blacklist.js`, `whitelist.js` and (optionally) `modules.js` files, naming it `license` in your project. The first one contains a full list of all currently acknowledged, depreciated, and exceptional software licenses. To whitelist or blacklist the license, you must copy selected licenses from the main file into them.

Whitelisting stops **License Auditor** from analyzing and displaying any notifications for a given package with whitelisted license type. Blacklisting a license leads to the generation of fail notification log or causes CI job to fail if the blacklisted license is found, which prevents the developer from merging unwanted dependencies into the destination branch. Any license that is included in neither `blacklist.js` nor `whitelist.js`, but is found during packages analyze or merge request, becomes a warning, which developer should address during merge process or further development.

Modules whitelisting, with the usage of the `modules.js` file, allows specifying which licenses should be ignored for which module. If `any` is assigned, all provided licenses are accepted. Please review the [template](./license-template/modules.js) file for examples.

If a given dependency has no license specified, it's marked with `UNKNOWN` and thus the default blacklist contains `UNKNOWN` license to notify about a potentially unwanted license.

For **License Auditor** to work, all project dependencies have to be installed before an audit. **License Auditor** iterates through the `node_modules` and retrieves the license information from them. List of licenses is also available at [spdx site](https://spdx.org/licenses/).
Expand Down
2 changes: 2 additions & 0 deletions examples/ci_example.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ const licenseAuditor = require('@brainhubeu/license-auditor');

const whitelist = require('./license/whitelist');
const blacklist = require('./license/blacklist');
const modules = require('./license/modules');

licenseAuditor({
whitelistedLicenses: whitelist,
blacklistedLicenses: blacklist,
whitelistedModules: modules,
projectPath: process.env.PROJECT_PATH,
ciManager: {
warn,
Expand Down
2 changes: 2 additions & 0 deletions examples/logging_example.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const licenseAuditor = require('@brainhubeu/license-auditor');

const whitelist = require('./license/whitelist');
const blacklist = require('./license/blacklist');
const modules = require('./license/modules');

const warn = msg => {
// eslint-disable-next-line no-console
Expand All @@ -17,6 +18,7 @@ const fail = msg => {
licenseAuditor({
whitelistedLicenses: whitelist,
blacklistedLicenses: blacklist,
whitelistedModules: modules,
projectPath: process.env.PROJECT_PATH,
ciManager: {
warn,
Expand Down
File renamed without changes.