Skip to content
This repository was archived by the owner on Aug 7, 2023. It is now read-only.
This repository was archived by the owner on Aug 7, 2023. It is now read-only.

disableWhenNoConfigFile not really working #455

@Cweet

Description

@Cweet

Something that bothered me when working in projects without a config file, it throws errors every time you click on a file, even when I have check on the "disableWhenNoConfigFile". The problem is that this check is not being executed early enough. By moving this check further up, right under "const parameters = ['--report=json'];" this issue is resolved.

// Check if a config file exists and handle it
const confFileNames = [
     '.phpcs.xml', '.phpcs.xml.dist', 'phpcs.xml', 'phpcs.xml.dist',
     'phpcs.ruleset.xml', 'ruleset.xml',
];
const confFile = await helpers.findAsync(fileDir, confFileNames);
if (this.disableWhenNoConfigFile && !confFile) {
     return [];
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions