Skip to content

Conversation

@thevilledev
Copy link
Contributor

Add new reformat command that converts conftest JSON output to different formats (table, junit, sarif, etc). Supports both positional arguments and stdin input, aligning with existing conftest command patterns.

  • Use positional args for input files: reformat file.json
  • Support stdin input for piping: conftest test | reformat
  • Add comprehensive BATS tests

Fixes #1145

Copy link
Member

@jalseth jalseth left a comment

Choose a reason for hiding this comment

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

Thanks for taking on this FR!

@thevilledev thevilledev force-pushed the feat/reformat-command branch from ea0e8cd to f67ae9c Compare August 16, 2025 20:10
Add new reformat command that converts conftest JSON output to different
formats (table, junit, sarif, etc). Supports both positional arguments
and stdin input, aligning with existing conftest command patterns.

- Use positional args for input files: reformat file.json
- Support stdin input for piping: conftest test | reformat
- Add comprehensive BATS tests

Signed-off-by: Ville Vesilehto <[email protected]>
@thevilledev thevilledev force-pushed the feat/reformat-command branch from f67ae9c to c26c497 Compare August 16, 2025 20:24
@thevilledev thevilledev requested a review from jalseth August 16, 2025 20:44
Copy link
Member

@jalseth jalseth left a comment

Choose a reason for hiding this comment

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

Please fix the tests. You can run locally before sending the PR for review.

Previously worked only when run directly from the reformat test dir.

Signed-off-by: Ville Vesilehto <[email protected]>
@thevilledev
Copy link
Contributor Author

Hopefully fixed now. The test only failed through make test-acceptance.

Copy link
Member

@jalseth jalseth left a comment

Choose a reason for hiding this comment

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

:shipit:

@jalseth jalseth merged commit 30b9a8d into open-policy-agent:master Aug 19, 2025
9 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.

Feature Request: Support for multiple output formats in a single conftest run command

2 participants