-
Notifications
You must be signed in to change notification settings - Fork 34
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
prefer-some-in-iteration
no longer reporting violation as expected
#901
Comments
anderseknert
added a commit
that referenced
this issue
Jul 7, 2024
This was due to an unfortunate combination of trying to be lenient about `coll[_]` used in the position of a function arg (as that's not *directly* replaceable by `some .. in` **but** not excluding operators like `:=` from functions (where it _should_ be replaced by `some .. in`) **and** many tests for this rule missing to provide the built-in functions as a mocked dependency. Will need to think some about how to best avoid this to happen again. Fixes #901 Signed-off-by: Anders Eknert <[email protected]>
anderseknert
added a commit
that referenced
this issue
Jul 7, 2024
This was due to an unfortunate combination of trying to be lenient about `coll[_]` used in the position of a function arg (as that's not *directly* replaceable by `some .. in` **but** not excluding operators like `:=` from functions (where it _should_ be replaced by `some .. in`) **and** many tests for this rule missing to provide the built-in functions as a mocked dependency. Will need to think some about how to best avoid this to happen again. Also: - Replace `ast.policy` in tests with `ast.with_rego_v1` - Fix docs that used `=` for assignment rather than `:=` Fixes #901 Signed-off-by: Anders Eknert <[email protected]>
charlieegan3
pushed a commit
that referenced
this issue
Jul 8, 2024
This was due to an unfortunate combination of trying to be lenient about `coll[_]` used in the position of a function arg (as that's not *directly* replaceable by `some .. in` **but** not excluding operators like `:=` from functions (where it _should_ be replaced by `some .. in`) **and** many tests for this rule missing to provide the built-in functions as a mocked dependency. Will need to think some about how to best avoid this to happen again. Also: - Replace `ast.policy` in tests with `ast.with_rego_v1` - Fix docs that used `=` for assignment rather than `:=` Fixes #901 Signed-off-by: Anders Eknert <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Taking the example from the prefer-some-in-iteration rule doesn't seem to report the violation:
The text was updated successfully, but these errors were encountered: