You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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 categoryExpected 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
The text was updated successfully, but these errors were encountered: