Skip to content

Load CodeSniffer.conf also from current dir, make it confgurable #1263

@scop

Description

@scop

Is your feature request related to a problem?

Path to the CodeSniffer.conf does not appear to be configurable, or at least I have not found how to do it.

The docs refer to "user specific configuration file" but I have not found documentation where that might be.

The only path I have found working for a composer install is vendor/squizlabs/php_codesniffer/CodeSniffer.conf, but that is problematic because if it exists before phpcs is installed (e.g. from a git checkout), it gets somehow removed by composer install. So it's not nicely shareable via git.

Describe the solution you'd like

Would be nice to load the configuration file (in addition to the current location(s) used) from $CURRENT_DIR/.config/CodeSniffer.conf by default, no matter the install method. For rationale for the .config/ dir, see https://github.com/pi0/config-dir. Failing that, looking up from $CURRENT_DIR/CodeSniffer.conf or something like that would also be an improvement.

While at it, could be useful to also make path to the config file configurable via an command line option or an environment variable.

Alternatively, make it possible to set these values via phpcs.xml (see the comment below for more discussion on this).

Additional context (optional)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions