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

Rule: warn on != in iteration #79

Closed
anderseknert opened this issue Apr 10, 2023 · 0 comments · Fixed by #130
Closed

Rule: warn on != in iteration #79

anderseknert opened this issue Apr 10, 2023 · 0 comments · Fixed by #130

Comments

@anderseknert
Copy link
Member

Using != in iteration is almost always a bug:

"admin" != input.user.roles[_]

What was likely intended:

not "admin" in input.user.roles

Add to new category named "bugs".

anderseknert added a commit that referenced this issue May 26, 2023
Like a few other rules, this won't catch all violations as
we don't yet traverse nested structures like comprehensions
or `every` constructs.

Fixes #79

Signed-off-by: Anders Eknert <anders@styra.com>
anderseknert added a commit that referenced this issue May 26, 2023
Like a few other rules, this won't catch all violations as
we don't yet traverse nested structures like comprehensions
or `every` constructs.

Fixes #79

Signed-off-by: Anders Eknert <anders@styra.com>
anderseknert added a commit that referenced this issue May 26, 2023
Like a few other rules, this won't catch all violations as
we don't yet traverse nested structures like comprehensions
or `every` constructs.

Fixes #79

Signed-off-by: Anders Eknert <anders@styra.com>
anderseknert added a commit that referenced this issue Jun 1, 2023
Like a few other rules, this won't catch all violations as
we don't yet traverse nested structures like comprehensions
or `every` constructs.

Fixes #79

Signed-off-by: Anders Eknert <anders@styra.com>
anderseknert added a commit that referenced this issue Jun 1, 2023
Like a few other rules, this won't catch all violations as
we don't yet traverse nested structures like comprehensions
or `every` constructs.

Fixes #79

Signed-off-by: Anders Eknert <anders@styra.com>
anderseknert added a commit that referenced this issue Jun 1, 2023
Like a few other rules, this won't catch all violations as
we don't yet traverse nested structures like comprehensions
or `every` constructs.

Fixes #79

Signed-off-by: Anders Eknert <anders@styra.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant