Skip to content

SA1008 false positive before comment #3945

@lucky-ly

Description

@lucky-ly

When the opening parenthesis is followed by a comment, adding a whitespace before the comment triggers SA1008.
I think, this should be allowed.

Some code to illustrate:

var query = query.Where(x => someCondition && // this comment is fine
    otherCondition &&// and this is not fine, it triggers SA1003 which is good
    !(// but this is somehow fine too
        (otherCondition1) &&
        (otherCondition2) &&
        (otherCondition3)
    ) &&
    !( // and this comment triggers SA1008 because there is a whitespace
        (otherCondition4) ||
        (otherCondition5) ||
        (otherCondition6)
    ));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions