Skip to content

TabAndSpace.DoubleSpace incorrectly detects within the line #423

@utdrmac

Description

@utdrmac

The documentation for this sniff clearly states the following:

Check for any line starting with 2 spaces

However, the sniff will incorrectly trigger on line 2 in this example:

	private array $bufferRequests = [];
	private bool $inBuffer        = false;

The first 2 characters of both lines are tab. The failure of this sniff is that it is checking the entire contents of the line, looking for double space. This is not what the docs say this sniff does. Furthermore, as currently implemented, this behavior conflicts with Generic.Formatting.MultipleStatementAlignment which says that multiple assignment lines should be aligned, as the example above shows.

Please fix this sniff to correctly, and only, search the beginning of the line for violation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions