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

Inconsistent Warning Detection of 'Operator == Used in Void Context' #835

Open
MAN98 opened this issue Feb 18, 2021 · 0 comments
Open

Inconsistent Warning Detection of 'Operator == Used in Void Context' #835

MAN98 opened this issue Feb 18, 2021 · 0 comments
Labels
Status: Untriaged An issue that has yet to be triaged. Type: Bug Does not work as expected.

Comments

@MAN98
Copy link

MAN98 commented Feb 18, 2021

Version:

Chef Workstation 21.2.278

Environment:

VS Code running in Windows 10

Scenario:

Running cookstyle does not consistently catch the warning around the "Void Context" use of Operator ==. We use node attributes (i.e. node.default['7z']['install'] = true) to indicate if a particular new software or tool would be installed in the set of named_run_list in our Policyfile. We accidentally used a '==' operator instead of '=' in the recipe we run to set attributes but cookstyle did not give us any warnings. It was only when we added another line of code after that wherein cookstyle gave us the warning.

Steps to Reproduce:

In the last line of any recipe or new rb file, add a line of node.default['7z']['install'] == true
save then run cookstyle . -a
No warnings are logged or shown by cookstyle.

Add another line of code after that like node.default['7z']['version'] == '10.0'
save then run cookstyle . -a
Warning will now be caught on the line node.default['7z']['install'] == true but would still now catch the second line that also falls into the warning category

Expected Result:

cookstyle should give the warning for the Operator == used in void context no matter where the line of code is whether its the last line of code in a recipe or in the first or middle.

Actual Result:

cookstyle not consistently giving the warning message for Operator == used in void context

@MAN98 MAN98 added Status: Untriaged An issue that has yet to be triaged. Type: Bug Does not work as expected. labels Feb 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Untriaged An issue that has yet to be triaged. Type: Bug Does not work as expected.
Projects
None yet
Development

No branches or pull requests

1 participant