Skip to content

VSCode PR diffs #1614

Open
Open
@mikebronner

Description

@mikebronner

When reviewing PRs in VSCode, I get the following linter error:

Class name App\Actions\MyAction does not match filepath STDIN.
(SlevomatCodingStandard.Files.TypeNameMatchesFileName.NoMatchBetweenTypeNameAndFileName)phpcs

I believe this is due to the diffed files being displayed from memory. Is there a recommended way to set up the linter to not throw errors for this circumstance?

I have tried the following rule, but not quite sure how to structure the rule, as it basically needs to apply to any namespace:

	<rule ref="SlevomatCodingStandard.Files.TypeNameMatchesFileName">
        <properties>
            <property name="rootNamespaces" type="array">
                <element key="STDIN" value="App"/>
                <element key="tests" value="ValmarCodingStandard\Tests"/>
            </property>
        </properties>
    </rule>

Thanks for your assistance!

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