-
Notifications
You must be signed in to change notification settings - Fork 9
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
ErrorFormat not Taking #2
Comments
One additional thought: I am using Syntastic. I'll look into whether that might be the culprit. |
What version of PHP CodeSniffer are you using? It looks like you are running an older version (based on the error), can you try using: set errorformat+="%f",%l,%c,%t%[a-zA-Z],"%m",%[a-zA-Z0-9_.-] instead, and let me know if this works? If it does not, can you run: Paste in the output, please? I am thinking that vim could have stripped the ending of the error and there might be something I am missing. |
When I run the set errorformat from the vim command prompt, CodeSniff works from then on for that file. The command has to be re-run for each file, unforuntately. I tried adding to the end of my .vimrc, but no luck. I also just tried disabling Syntastic, to see if it was the culprit, but again no luck. PHP_CodeSniffer 1.3.2 stable is installed, just installed via Pear a few days ago. Command-line output of phpcs with CSV report is:
As an additional note, it is worth noting that Syntastic now supports PHPCS as well, so there is a bit of a collision here. There are some things I like better about this modules implementation, namely the use of the QuickFix buffer. |
Does any other plugin set errorformat? Can you list the ones that do? (eg. grep -Rns 'set errorformat' ~/.vim* ) It doesn't look like the version of codesniffer or the error line at this point, but I will keep looking. |
Update: I have tried this plugin under Syntastic and Pathogen but I can still not replicate any problems. |
Closing since I cannot replicate this issue, I think it most likely caused by a conflicting plugin or an old version of PHPCS, but unsure how to fix if I cannot replicate. Feel free to lodge a new issue with replication steps if this is still a problem. |
Actually I can replicate (somewhat intermittently) this issue, but I can make it go away is by running PHPCS on the command line. No clue what the problem is, it appears to be something wrong with the command line but not sure. |
I don't have a lot to go on here, but the short of it is that the errorformat setting is not taking across files. Results from CodeSniff are not being parsed correctly, and appear like
|| "/mnt/sda9/echoditto/greenstreets/sites/greenstreets/index.php",24,1,error,"Break statement indented incorrectly; expected 6 spaces, found 0",DrupalCodingStandard.
until I run the command
set errorformat+="%f",%l,%c,%t%[a-zA-Z],"%m",%[a-zA-Z0-9_.-],%*[0-9]
from the vim command prompt, in each file.
I tried copying that command into .vimrc as a quickfix, with no luck. I've seen with both PEAR and DrupalCodingStandard standards.
Any ideas what might be going on here and how to fix? Perhaps something around the scoping of that setting for particular filetypes?
The text was updated successfully, but these errors were encountered: