Skip to content

Adds 'report' output for ion schema validate#160

Merged
popematt merged 1 commit intoamazon-ion:mainfrom
popematt:build-tool-report
Oct 24, 2024
Merged

Adds 'report' output for ion schema validate#160
popematt merged 1 commit intoamazon-ion:mainfrom
popematt:build-tool-report

Conversation

@popematt
Copy link
Copy Markdown
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
Copy Markdown
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
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