Comments (12)
- Installed plugin
- Installed phpcs globally using composer
- Symlinked
/Users/[user]/.composer/vendor/bin/phpcs
to/usr/local/bin/phpcs
- Restarted vscode
- Worked!
from vscode-phpcs.
@Swift-R me too. I has searched solution with Google since yesterday. But nothing help to resolve this problem. And there is not enough detail in the author's docs
from vscode-phpcs.
From what I've read, the issue is with VSCode itself. It doesn't allow extensions to use anything externally anymore.
from vscode-phpcs.
I was having this same issue. There are two ways I was able to fix:
- Install dependency on project-level (refer to this README)
- Fix phpcs installation.
What I mean to fix phpcs installation is that for some reason installing with pear (via this other method) was causing an issue to not load on VSCode, and also break on console.
I installed it globally with composer, and also this installation should be the only one to be pointed on your PATH:
$ where phpcs
> /Users/gabrieloliveira/.composer/vendor/bin/phpcs
Before this, I had the pear installation and two of composer linked to phpcs, for some reason still didn't work. After I removed the pear and composer duplicated entry, VSCode worked successfully.
from vscode-phpcs.
@Swift-R @oknixus @gwagroves @gabrielboliveira Can you please check whether 0.7.0 fixes your issues?
from vscode-phpcs.
@ikappas looks like it's working now. I've switched back to Atom in the meanwhile for various reasons and it seems that it's working differently. For example, with the exact same code, Atom reports one line having more than 120 characters and a missing namespace while VSCode reports a missing doc comment for a class and a missing blank line before the tags in a doc comment in a method.
Edit: Never mind, I forgot to set the standard to PSR2. It's still not showing the line too long warning though. Another configuration?
from vscode-phpcs.
@Swift-R Are you using global phpcs or project specific with composer?
from vscode-phpcs.
Global
from vscode-phpcs.
@Swift-R I have switched to using stdIn instead of file parsing and setup utf8 encoding similarly to Atom in v.0.8.0. So I am closing this issue and feel free to test 0.8.0 until it is released!
from vscode-phpcs.
This is also an issue for me by the way. I'm running Version 1.10.2 (1.10.2)
, and get the error phpcs: Unable to locate phpcs. Please add phpcs to your global path or use composer depency manager to install it in your project locally.
.
I tried something akin to @gwagroves' fix, so that it now looks like this:
But unfortunately I still get this error.
from vscode-phpcs.
@ikappas I'm having the same problem. How can we help test 0.8.0 before it's oficially released with VSCode?
from vscode-phpcs.
ok it needs to be globally installed via composer for the current versions of VSCode to see it.
Just run:
include_once "/usr/share/pear/PHP/CodeSniffer/autoload.php";
from vscode-phpcs.
Related Issues (20)
- Extension unable to find nested phpcs executable
- PHP 7.4 support HOT 1
- Compiling Errors using VSCode v1.47.3
- unmaintained? HOT 14
- .
- Git diff errors HOT 1
- turn on/off
- use files.associations php files instead of "php" document HOT 4
- Command with xdebug enabled causes invalid json HOT 4
- Do not check coding standards in diff view
- Extension issue HOT 2
- Display Rule Namespaces alongside Errors / Warnings HOT 1
- phpcs: Unknown error ocurred. Please verify that .... returns a valid json object. HOT 1
- Fatal error: Uncaught TypeError: vsprintf(): Argument #2 ($values) must be of type array, string given
- Error occurring on auto_detect_line_endings deprecation HOT 1
- phpcs: Referenced sniff "Drupal" does not exist HOT 3
- phpcs Reports Errors When Opening Git Diffs (and Also in Random Cases) HOT 1
- Unexpected token D in JSON at position 1
- Project stewardship
- Phpcs
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vscode-phpcs.