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

Adds 'report' output for ion schema validate #160

Merged
merged 1 commit into from
Oct 24, 2024

Conversation

popematt
Copy link
Contributor

Issue #, if available:

None

Description of changes:

  • Adds a module with ansi code constants that can be imported and used in a format!() string. See validate.rs for example usage.
  • Adds more help documentation to the validate command.
  • Fixes a clippy warning in complaint.rs.
  • Adds a new "report" output format for the validate command. "Report" is a rather vague name, so if you have a better idea, please share it with me.

Example usage and output (but ok is green and FAILED is red, just like the cargo test report).

❯ cargo run -- schema -X validate -R 'document' **/*.ion

code-gen-projects/input/good/scalar/empty_value.ion ... ok
code-gen-projects/input/good/scalar/valid_value.ion ... ok
code-gen-projects/input/good/sequence/empty_sequence.ion ... FAILED
code-gen-projects/input/good/sequence/valid_elements.ion ... ok
code-gen-projects/input/good/struct_with_fields/empty_values.ion ... FAILED
code-gen-projects/input/good/struct_with_fields/valid_fields.ion ... ok
code-gen-projects/input/good/struct_with_fields/valid_unordered_fields.ion ... ok

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Copy link
Contributor

@desaikd desaikd left a comment

Choose a reason for hiding this comment

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

Very nice!

There are some clippy warnings, although not related to the files changed.

@popematt popematt merged commit a21602f into amazon-ion:main Oct 24, 2024
3 checks passed
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