Giter Club home page Giter Club logo

Comments (12)

antonioribeiro avatar antonioribeiro commented on May 26, 2024

Check if you have a folder ~/.composer/vendor/pragmarx/laravelcs

On Linux/Mac:

ls -la  ~/.composer/vendor/pragmarx/laravelcs

from laravelcs.

jwalton512 avatar jwalton512 commented on May 26, 2024

Yep, that directory is there -- here are a few pertinent results:

➜  ~  ls -lah ~/.composer/vendor/pragmarx/laravelcs
total 24
drwxr-xr-x   7 jason  staff   238B Dec  9 07:57 .
drwxr-xr-x   3 jason  staff   102B Dec  9 07:57 ..
drwxr-xr-x  15 jason  staff   510B Dec  9 07:57 .git
-rw-r--r--   1 jason  staff   1.5K Dec  9 07:57 LICENSE
drwxr-xr-x   4 jason  staff   136B Dec  9 07:57 Standards
-rw-r--r--   1 jason  staff   455B Dec  9 07:57 composer.json
-rw-r--r--   1 jason  staff   2.7K Dec  9 07:57 readme.md
➜  ~  phpcs ~/Development/laravel-framework/src/Illuminate/Cache/Console/CacheTableCommand.php

FILE: ...nt/laravel-framework/src/Illuminate/Cache/Console/CacheTableCommand.php
--------------------------------------------------------------------------------
FOUND 98 ERRORS AFFECTING 60 LINES
--------------------------------------------------------------------------------
  1 | ERROR | [ ] Missing file doc comment
  7 | ERROR | [ ] Missing class doc comment
  7 | ERROR | [x] Opening brace of a class must be on the line after the
    |       |     definition

... shortened for brevity
➜  ~  phpcs --standard=~/.composer/vendor/pragmarx/laravelcs/Standards/Laravel ~/Development/laravel-framework/src/Illuminate/Cache/Console/CacheTableCommand.php
ERROR: the "~/.composer/vendor/pragmarx/laravelcs/Standards/Laravel" coding standard is not installed. The installed coding standards are MySource, PEAR, PHPCS, PSR1, PSR2, Squiz and Zend

from laravelcs.

antonioribeiro avatar antonioribeiro commented on May 26, 2024

That was tough. Looks like PHP_CodeSniffer doesn't accept standards inside hidden folders like ~/.composer, so copying it to /tmp worked:

cp -a ~/.composer/vendor/pragmarx/laravelcs /tmp
phpcs -v --standard=/tmp/laravelcs/Standards/Laravel/ /tmp/laravelcs/Standards/TestFiles/Filesystem.php

Now I just have to fix this... :(

/cc @mvpasarel

from laravelcs.

antonioribeiro avatar antonioribeiro commented on May 26, 2024

Looks like they knew & fixed it:

http://pear.php.net/package/PHP_CodeSniffer/download/All

  • Standards can now be located within hidden directories (further fix for bug #20323)

This should work on 2.0.0RC2, but I have 2.0.0 (stable) and it's not.

from laravelcs.

antonioribeiro avatar antonioribeiro commented on May 26, 2024

Not sure if it was fixed here or not: squizlabs/PHP_CodeSniffer#254

from laravelcs.

mvpasarel avatar mvpasarel commented on May 26, 2024

Hmm... The problem seems to be from the ~/ because I actually tested it with /Users/mvpasarel/.composer/... and is working with .composer hidden directory.

I can change the readme to use the full path only.

@xsbeats Can you try with the full path please?

from laravelcs.

antonioribeiro avatar antonioribeiro commented on May 26, 2024

You're right! I'll change it. Thanks.

from laravelcs.

mvpasarel avatar mvpasarel commented on May 26, 2024

While you're there, I have a typo as well at Usage wih, please change that too. Thanks.

from laravelcs.

antonioribeiro avatar antonioribeiro commented on May 26, 2024

Done and done.

You can run it using:

phpcs -v --standard=$HOME/.composer/vendor/pragmarx/laravelcs/Standards/Laravel /path/to/folder/or/file

from laravelcs.

antonioribeiro avatar antonioribeiro commented on May 26, 2024

I also opened an issue on CodeSniffer: squizlabs/PHP_CodeSniffer#353, they should use realpath() to convert those paths before start to traverse them...

from laravelcs.

antonioribeiro avatar antonioribeiro commented on May 26, 2024

I also created a pull request to fix it on CodeSniffer: https://github.com/squizlabs/PHP_CodeSniffer/pull/354/files

from laravelcs.

jwalton512 avatar jwalton512 commented on May 26, 2024

thanks @antonioribeiro @mvpasarel. working great now!

from laravelcs.

Related Issues (14)

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.