Skip to content

Feat: Add JSON output test for vet command #250

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

atsai1220
Copy link

Hello!

I'm looking for some guidance on contributing towards #249. I've created a test case here but ultimately it seems like error messages are structured and generated in kcl-lang/kcl/kclvm/error/src/error.rs#L67.

Hope to get the ball rolling with authors' guidance. I imagine updating the error format in the rust repository will have a lot of impact on any downstream services that receive those messages. The first attempt was to try and parse and reformat to JSON the output from kcl-lang/cli/cmd/kcl/commands/vet.go#L111. Thoughts?

I've added a test case here with a suggested output format for JSON in test/e2e/test_suites/test_kcl_vet_output_json_1/stderr. Welcome any feedback.

Thank you!

1. Does this PR affect any open issues?(Y/N) and add issue references:

2. What is the scope of this PR (e.g. component or file name):

cmd/kcl/commands/vet.go

3. Provide a description of the PR(e.g. more details, effects, motivations or doc link):

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Other

4. Are there any breaking changes?(Y/N) and describe the breaking changes(e.g. more details, motivations or doc link):

  • N
  • Y

5. Are there test cases for these changes?(Y/N) select and add more details, references or doc links:

  • Unit test
  • Integration test
  • Benchmark (add benchmark stats below)
  • Manual test (add detailed scripts or steps below)
  • Other

Signed-off-by: Andrew Tsai <[email protected]>
Signed-off-by: atsai1220 <[email protected]>
@atsai1220 atsai1220 marked this pull request as ready for review July 29, 2025 17:34
@Peefy
Copy link
Contributor

Peefy commented Aug 4, 2025

The CI failed. Could u pls fix it?

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.

Vet command should support structured output formats
2 participants