-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configuration option to set relative paths in include_paths
to be relative to phpcs.xml file.
#2764
Comments
@cdayjr You can set the <config name="installed_paths" value="vendor/phpcompatibility/php-compatibility"/> That way they are only set for that particular project. Or install both the external rulesets + PHPCS via Composer and use the DealerDirect Composer PHPCS plugin to set the |
If I use a relative path that doesn't start with Installing the dealerdirect composer plugin may solve this but I'd rather be explicit about what's installed in the xml file. |
kind of similar problem #2776 |
Another alternative is to announce the path as relative (to the PHP_CodeSniffer installation path inside the vendor directory):
I found it more stable regardless where the
For I have to admit, much more straight forward for paths relative to the XML file I found the (comments against PHP_CodeSniffer 3.6.0) |
@ktomk Thankyou! I've been struggling to figure out why installed_paths wasn't being used in the phpcs.xml when as far as I could tell from these issues, it should be! Using the path relative to the PHP_CodeSniffer installation allows it run as expected. |
This allows running the ruleset from different directories than the free plugin. See: squizlabs/PHP_CodeSniffer#2764 (comment)
This allows running the ruleset from different directories than the free plugin. See: squizlabs/PHP_CodeSniffer#2764 (comment)
@cdayjr Could they please elaborate on the "not planned" close reason?/message? Others are fine that this is closed, at least for now, but we are nevertheless eager to learn more about theirs rationale of the action to close the issue which has been added the Core Component: Config & Ruleset & CLI options label on Jul 31, 2023 by jrfnl Juliette and Type: enhancement label on Dec 15, 2019 by gsherwood Greg Sherwood. Theirs most recently have left a couple of descriptions via that not planned label (Won't fix, can't repro, duplicate, stale), so which one of those in specific and/or any references are much appreciated next to the action itself — for a better understanding. Is this solved in (now upstream) PHPCSStandards/PHP_CodeSniffer (See issue #3932 for more information.) from theirs perspective? Thanks for their reading and sharing any theirs considerations @cdayjr . |
I'm currently having with the
installed_paths
being relative to the PHP_CodeSniffer install in that if I have rulesets installed in a specific project I can't use them without also installing them globally on my system. I'd prefer to keep the rulesets self contained to what they apply to.I think having an option to make that path relative to the XML file would solve the issue completely, as one can easily deal with the directory structure in a project. As an option, if it keeps the default behavior as-is, we wouldn't have to worry about any breakage for anyone's current workflow.
The text was updated successfully, but these errors were encountered: