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(spdx_license): include tryParse #817

Merged
merged 2 commits into from
Oct 2, 2023

Conversation

alestiago
Copy link
Contributor

@alestiago alestiago commented Sep 29, 2023

Description

Adds a tryParse method to validate future CLI user inputs when white/black listing certain licenses. unknown will be a valid license type but erroneous input (for example, MIP instead of MIT) should throw an exception for a better user experience.

Changes:

  • Modified parse to throw a FormatException when failed to parse (similar to int.parse)
  • Included tryParse to return null if can't be parsed (similar to int.tryParse)

Type of Change

  • ✨ New feature (non-breaking change which adds functionality)
  • 🛠️ Bug fix (non-breaking change which fixes an issue)
  • ❌ Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 Code refactor
  • ✅ Build configuration change
  • 📝 Documentation
  • 🗑️ Chore

@alestiago alestiago merged commit 8ae689f into main Oct 2, 2023
25 checks passed
@alestiago alestiago deleted the alestiago/spdx-license-try-parse branch October 2, 2023 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new feature or request
Projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants