Skip to content

SA1500 fires for the while clause of do/while statement #2801

@smaillet

Description

@smaillet

The following generates an SA1500 error when it shouldn't:

bool condition = true;
do
{
    condition = DetermineCondition();
} while( condition );

Forcing placement of while onto a separate line is counter to common code style practices. At the very least there should be a configuration option to set how this rule should handle the placement of the while clause.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions