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
phpcs not recognizing installed_paths
#84
Comments
Hi, thank you for reporting this bug! I'm currently in the process of get the currently open merge-requests into a new (minor) release. It could be related to other relative/absolute path issues already reported. I also need to check what the deal was with global/local installs of this plugin and sniffs. Will let you know when I am available to make progress on this issue. |
+1, with another standard, not detected by phpcs event if it says |
Oops, it is working, it was a problem of chmod, when I trying to do it manually by doing :
The real problem is that this library do not say when the process has failed, I mean, that error is not reported by the installer, so we thought it should work at the first place. it may be the same problem @SturmB |
Thanks for the input, @johndodev, but it seems my issue is different. ~/Sites/phpcs/app/public phpcs --config-set installed_paths ./wpcs
Using config file: C:\Users\<username_hidden>\AppData\Roaming\Composer\vendor\squizlabs\php_codesniffer\CodeSniffer.conf
Config value "installed_paths" added successfully
~/Sites/phpcs/app/public phpcs -i
The installed coding standards are MySource, PEAR, PSR1, PSR12, PSR2, Squiz and Zend I wonder if the problem is that I have phpcs installed globally, but I have the WordPress standard installed locally. Must I have them both installed in either one context or the other? |
Ok, I don't know, both are installed locally for me. It seems more an issue of how phpcs handle the config "installed_paths" than an issue in that lib. Maybe try with an absolute path.
|
Yeah. We have another issue that centers around incorrect (or lacking) error reporting. Also, the plugin does not "error out" properly when it encounters problems. It is part of what we are currently looking into with #80
There is definitely some quirky/unintuitive behaviour there. This is another thing I want to get more to grips with before releasing potential fixes (as to avoid fixing one scenario but breaking another one). I would like to thank you both for your further feedback. Please bear with us as we continue to investigate these issues. |
Thanks, @Potherca. It should be noted that I was simply following the instructions in the main phpcs readme. I ran |
FYI: #93 Has been merged. 👍 |
@SturmB Could you do a |
Version v0.6.0 has just been released. Besides several fixes, this version also adds improved debug/verbose output. @SturmB Could you try to reproduce the issue you reported with |
I will do so as soon as I get some time in the next week. It'll be iffy because my dev setup has changed since then. (I'm now using WSL rather than ConEmu, etc.) |
Finally was able to replicate my original setup for this. (Had to disable Hyper-V for a bit.) The result of following the steps in my original post:
As soon as I get a chance, I'll try this same thing with my current WSL setup. |
@SturmB Looking at the output, I think your own hunch was correct. To me this sounds like you're using two distinct installs of PHPCS. One of which has WPCS installed, the other doesn't. Could you try running the below commands for me from the
If my assessment is correct, I'd like to suggest the following which should create a workable situation for you:
If all is right, you should now be able to use the If, at a later point in time, you decide to install more PHPCS standards via And yes, the WPCS install instructions need improvement as they now presume that people only use PHPCS with WPCS and won't have other installs. It's on the never-ending |
Yep, that was it, @jrfnl:
As before, this is with my old setup. Just to confirm while I'm here in a Windows session with Hyper-V disabled (so I can use Local by Flywheel), I'll run through the rest of your steps:
So it seems that your assessment is, indeed, correct. I still have a great deal to learn about Composer, it seems. As well as to make this happen in WSL, which shouldn't be an issue now that I know the culprit of this problem. Thanks so much for your help, @jrfnl! |
@SturmB No problem. I'm just glad we've figured out together. Sorry it took so long. |
Problem/Motivation
phpcs is not seeing the WordPress standards.
Expected behaviour
I expect to see
WordPress
as one of the installed coding standards when I runphpcs -i
.Actual behaviour
WordPress does not show up in the list of installed coding standards.
Steps to reproduce
phpcs
globally withcomposer global require "squizlabs/php_codesniffer=*"
.composer create-project wp-coding-standards/wpcs --no-dev
in the project'sapp/public
directory (the root of the WordPress installation).composer require --dev dealerdirect/phpcodesniffer-composer-installer
from the same directory as the previous step. Notice that it saysinstalled_paths set to ../../../wpcs
phpcs -i
and see that WordPress is not in the list.Proposed changes
I know so little about this process that I have absolutely no proposals for what to change nor how. All I can do is give you my current setup:
OS: Windows 10 1903.
WordPress: 5.2.3
PHP: 7.3.2
MySQL: 5.6.34
Composer: 1.8.6
phpcs: 3.4.2 (stable)
wp-coding-standards: 2.1.1
phpcodesniffer-composer-installer: v0.5.0
I'm sure that I'm just doing something wrong, so please don't make any assumptions; ask me for any clarifications and I'll be happy to provide what I can.
The text was updated successfully, but these errors were encountered: