Giter Club home page Giter Club logo

Comments (12)

gwagroves avatar gwagroves commented on September 27, 2024 5
  • 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.

oknixus avatar oknixus commented on September 27, 2024

@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.

mignz avatar mignz commented on September 27, 2024

From what I've read, the issue is with VSCode itself. It doesn't allow extensions to use anything externally anymore.

from vscode-phpcs.

gabrielboliveira avatar gabrielboliveira commented on September 27, 2024

I was having this same issue. There are two ways I was able to fix:

  1. Install dependency on project-level (refer to this README)
  2. 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.

ikappas avatar ikappas commented on September 27, 2024

@Swift-R @oknixus @gwagroves @gabrielboliveira Can you please check whether 0.7.0 fixes your issues?

from vscode-phpcs.

mignz avatar mignz commented on September 27, 2024

@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.

ikappas avatar ikappas commented on September 27, 2024

@Swift-R Are you using global phpcs or project specific with composer?

from vscode-phpcs.

mignz avatar mignz commented on September 27, 2024

Global

from vscode-phpcs.

ikappas avatar ikappas commented on September 27, 2024

@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.

joneslloyd avatar joneslloyd commented on September 27, 2024

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:
screen shot 2017-03-29 at 16 29 26

But unfortunately I still get this error.

from vscode-phpcs.

grEvenX avatar grEvenX commented on September 27, 2024

@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.

Wrenbjor avatar Wrenbjor commented on September 27, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.