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: support validate in args definition #87

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

Conversation

peterroe
Copy link
Contributor

πŸ”— Linked issue

Fix: #84

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme, or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@peterroe peterroe changed the title feat: support validate in args definition feat: support validate in args definition Oct 12, 2023
Copy link

codecov bot commented Mar 18, 2024

Codecov Report

Attention: Patch coverage is 0% with 39 lines in your changes missing coverage. Please review.

Please upload report for BASE (main@7ee947b). Learn more about missing BASE report.

Files with missing lines Patch % Lines
src/args.ts 0.00% 17 Missing ⚠️
src/types.ts 0.00% 9 Missing ⚠️
playground/commands/deploy.ts 0.00% 8 Missing ⚠️
src/command.ts 0.00% 5 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff           @@
##             main     #87   +/-   ##
======================================
  Coverage        ?   0.00%           
======================================
  Files           ?      13           
  Lines           ?     950           
  Branches        ?      13           
======================================
  Hits            ?       0           
  Misses          ?     937           
  Partials        ?      13           

β˜” View full report in Codecov by Sentry.
πŸ“’ Have feedback on the report? Share it here.

@onmax onmax mentioned this pull request Apr 10, 2024
1 task
if (argDef.validate) {
const word = argDef.validate(value) || "";
if (argDef.required && typeof word === "string") {
return (
Copy link

@janniks janniks May 29, 2024

Choose a reason for hiding this comment

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

Should validate always fail and show the failure string if it's a string (even if not an required arg)?

Copy link

@janniks janniks left a comment

Choose a reason for hiding this comment

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

Looks good to me, had one comment. πŸ‘

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support validator in args definition
3 participants