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

format: Output list and diff changes with --fail flag (#4508) #4710

Merged
merged 1 commit into from
Jun 5, 2022

Conversation

davidkuridza
Copy link
Contributor

The change enables using --diff and --list together with --fail as discussed in #4508, for example:

$ opa fmt [path [...]] --list --fail; exit $?
path/to/file-1.rego
path/to/file-2.rego
unexpected diff
2

Previously, the same command returned only the error:

$ opa fmt [path [...]] --list --fail; exit $?
unexpected diff
2

anderseknert
anderseknert previously approved these changes May 27, 2022
Copy link
Member

@anderseknert anderseknert left a comment

Choose a reason for hiding this comment

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

Nice! LGTM.

@ashutosh-narkar
Copy link
Member

@anderseknert can we merge this ?

…ent#4508)

The change enables using --diff and --list together with --fail as
discussed in open-policy-agent#4508, for example:

	$ opa fmt [path [...]] --list --fail; exit $?
	path/to/file-1.rego
	path/to/file-2.rego
	unexpected diff
	2

Previously, the same command returned only the error:

	$ opa fmt [path [...]] --list --fail; exit $?
	unexpected diff
	2

Signed-off-by: David Kuridža <david@kuridza.si>
@anderseknert
Copy link
Member

@ashutosh-narkar sorry, not sure how I missed this. Yes, let's have this merged.

Copy link
Member

@anderseknert anderseknert left a comment

Choose a reason for hiding this comment

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

LGTM! Test failure is unrelated (Mac OS runner flakey).

@anderseknert anderseknert merged commit 6e5c0fc into open-policy-agent:main Jun 5, 2022
@anderseknert
Copy link
Member

Thanks for contributing, @davidkuridza 👍

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.

None yet

3 participants