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

feat: add allow only option #103

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

feat: add allow only option #103

wants to merge 9 commits into from

Conversation

neodmy
Copy link
Contributor

@neodmy neodmy commented Sep 15, 2023

Description

  • Add allowOnly option to allow only package licenses complying with the provided list
  • Add a function to check scan inputs
  • Update error messages

Related Issue

#24

Motivation and Context

Users may want to be more strict with the licenses of the packages in their projects. By using allowOnly, they can make sure only packages with certain licenses are allowed.

To achieve the same behaviour with the failOn option, they would need to provide all the SPDX licenses available except the ones they'd like to be banned. With allowOnly, they just need to supply the licenses they need their packages to comply with.

How Has This Been Tested?

I've added tests for the checkArgs util and scan use cases with allowOnly

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@neodmy neodmy self-assigned this Sep 15, 2023
@neodmy neodmy changed the title Feat/add allow only option feat: add allow only option Sep 15, 2023
Copy link
Member

@inigomarquinez inigomarquinez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job, @neodmy !

One question before approving it. 🤔

src/utils.js Outdated Show resolved Hide resolved
src/utils.js Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

2 participants