Skip to content

Update AV1545: Don't use an if-else construct instead of a simple (conditional) assignment#364

Open
dennisdoomen wants to merge 1 commit intodevelopfrom
copilot/pr298-update-av1545
Open

Update AV1545: Don't use an if-else construct instead of a simple (conditional) assignment#364
dennisdoomen wants to merge 1 commit intodevelopfrom
copilot/pr298-update-av1545

Conversation

@dennisdoomen
Copy link
Copy Markdown
Owner

This PR updates guideline AV1545.

It was split out of #298 so the change can be reviewed independently.

Files:

  • _rules/1545.md

Part of the replacement for #298.

Split from #298.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
title: Don't use an `if`-`else` construct instead of a simple (conditional) assignment
severity: 2
---
Express your intentions directly. For example, rather than:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Write conditional expressions using modern, concise syntax. For example, rather than:

---
rule_id: 1545
rule_category: maintainability
title: Don't use an `if`-`else` construct instead of a simple (conditional) assignment
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
title: Use concise conditional expressions instead of `if`-`else` blocks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants