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

Add mode to OPA format to migrate to strict mode complaint code #6297

Closed
ashutosh-narkar opened this issue Oct 10, 2023 · 1 comment · Fixed by #6413
Closed

Add mode to OPA format to migrate to strict mode complaint code #6297

ashutosh-narkar opened this issue Oct 10, 2023 · 1 comment · Fixed by #6413

Comments

@ashutosh-narkar
Copy link
Member

ashutosh-narkar commented Oct 10, 2023

In OPA 1.0, some of the strict mode checks will be enabled by default. See #6271 for details. Also with the planned introduction of the rego.v1 import, some constraints will be introduced on the module. In order to help policy authors smoothly transition their existing policies to be compliant with these new changes, we could add a new flag to the opa fmt command to enable this. Ideally we should add this feature before the 1.0 release to help make the transition easier.

@ashutosh-narkar
Copy link
Member Author

ashutosh-narkar commented Nov 1, 2023

In OPA 1.0, a new annotation called additional-annotations will be introduced that will allow users to define custom data outside the custom attribute. opa fmt should annotate modules with this new annotation for cases where custom annotations are defined outside the “custom” block. We can add a new flag to opa fmt called --move-additional-annotations that users can use to move user-defined data under the “custom” block.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging a pull request may close this issue.

2 participants