8000 Support input types by evilmarty · Pull Request #44 · evilmarty/ilc · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Support input types #44

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

Merged
merged 9 commits into from
Mar 9, 2025
Merged

Support input types #44

merged 9 commits into from
Mar 9, 2025

Conversation

evilmarty
Copy link
Owner
  • Add support for input type
  • Make default value type agnostic
  • Make input options value any type
  • Add boolean type
  • Update README to include boolean types
  • Add number type
  • Parse env vars into appropriate types
  • Support numbers when parsing args and fix up defaults
  • Update README about numbers

Description

Add support for specifying input types, such as string, number, and boolean. Also added additional configuration to validate numbers with min and max.

Checklist

  • All tests are passing
  • New tests were created to address changes in pr (and tests are passing)
  • Updated README and/or documentation, if necessary

Thanks for contributing!

@evilmarty evilmarty requested a review from Copilot March 9, 2025 00:26
Copy link
@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

PR Overview

This PR adds support for input types—including string, number, and boolean—by updating input parsing, validation, and default handling. Key changes include:

  • Changing the type of input default and option values to be type-agnostic and adding min/max validation for number types.
  • Updating YAML unmarshalling to support both sequence and mapping representations of options while validating type consistency.
  • Extending tests and documentation to cover the new input types and their behavior.

Reviewed Changes

File Description
config.go Updated input option structure, YAML unmarshalling, parsing, and validation to support number and boolean types.
utils_test.go Added tests to verify type conversion in ToFloat64.
config_test.go Extended tests for input parsing, default values, and error handling for new types.
utils.go Added a new implementation of ToFloat64 (potential duplicate).
command_set_test.go Added tests for argument parsing with number and boolean types.
command_set.go Updated default value handling and environment variable parsing for typed inputs.
README.md Updated documentation to describe the new input type support and configuration options.
prompt.go Modified prompt functions to return non-string types where applicable.

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (1)

utils.go:123

  • The function ToFloat64 appears to be defined twice in utils.go, which may lead to duplicate symbol errors. Consider removing the redundant implementation.
func ToFloat64(value any) float64 {

@evilmarty evilmarty merged commit cee93a7 into main Mar 9, 2025
1 check passed
@evilmarty evilmarty deleted the input-types branch March 9, 2025 00:35
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.

1 participant
0