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 default values #1

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

szymont
Copy link

@szymont szymont commented Mar 27, 2024

  • Add default values for sample(…) function parameters.
    • Default parameter values are added to all the recognised types.
    • If a parameter is not recognised then a placeholder <#default value#> is added instead.
  • Bump macOS deployment target
  • Update .gitignore

@szymont szymont marked this pull request as ready for review March 28, 2024 07:21
Copy link
Owner

@sftnhrd sftnhrd left a comment

Choose a reason for hiding this comment

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

Nice improvement! Would be great to add tests to check implementation

case .decimal: return "Decimal(\(Int.random(in: 0 ... 100))"
case .double: return Double.random(in: 0.0 ... 10.0).description
case .float: return Float.random(in: 0.0 ... 10.0).description
case .url: return "URL(string: \"https://foo.bar/\")"
Copy link
Owner

Choose a reason for hiding this comment

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

It returns optional URL, I'd add ! to avoid errors after generating samples

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.

2 participants