Skip to content

Lint/AssignmentInCondition #9316

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

Merged

Conversation

mhashizume
Copy link
Contributor

@mhashizume mhashizume commented Apr 8, 2024

This commit takes variable assignments in conditionals and wraps them in parentheses to make the intention more explicit.

@mhashizume mhashizume added the maintenance Maintenance chores are excluded from changelogs label Apr 8, 2024
@mhashizume mhashizume force-pushed the maint/main/assignmentincondition branch from 70e588b to 2cd8d29 Compare April 8, 2024 20:18
@mhashizume mhashizume marked this pull request as ready for review April 8, 2024 20:57
@mhashizume mhashizume requested a review from a team as a code owner April 8, 2024 20:57
Prior to this commit the static loader class used variable assignment in
conditionals unnecessarily and made a comparison (name_authority ==
Pcore::RUNTIME_NAME_AUTHORITY) that was always true.

This commit simplifies the conditionals to both remove the redundant
comparison and variable assignment in conditional.
@mhashizume mhashizume force-pushed the maint/main/assignmentincondition branch from 2cd8d29 to 1e888de Compare April 9, 2024 16:59
This commit takes variable assignments in conditionals and wraps them in
parentheses to make the intention more explicit.
@mhashizume mhashizume force-pushed the maint/main/assignmentincondition branch from 1e888de to 0cf25bb Compare April 9, 2024 17:03
@mhashizume mhashizume requested a review from joshcooper April 9, 2024 17:20
@joshcooper joshcooper merged commit 3b6ad90 into puppetlabs:main Apr 10, 2024
9 checks passed
@mhashizume mhashizume deleted the maint/main/assignmentincondition branch April 10, 2024 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Maintenance chores are excluded from changelogs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants