joomla / coding-standards

Joomla Coding Standards Definition
https://developer.joomla.org/coding-standards/basic-guidelines.html
GNU General Public License v2.0
128 stars 129 forks source link

Can't install coding-standards per README #215

Open N6REJ opened 6 years ago

N6REJ commented 6 years ago

Ok, what have I done wrong? image

photodude commented 6 years ago

It's due to the current release being listed as alpha

The command line is modified as per the instructions note on " make sure you allow usage of alpha software in Composer: "

composer property-set minimum-stability "alpha"

Then it should work you may need to do the following as well.

composer require joomla/coding-standards "~2.0@alpha"

Once we solve #206 we should be ready to have a stable release

N6REJ commented 6 years ago

ok, it ran that time but it made a folder called "vendor" in the root www folder which is not where it should be. Things are a mess now :(

photodude commented 6 years ago

See composer documentation on how to set the path for installing a package. https://getcomposer.org/doc/faqs/how-do-i-install-a-package-to-a-custom-path-for-my-framework.md

Note: I haven't done this... This is just my general understanding of the process, I have very little personal experience in using composer this way.

for my local setup I installed PHPCS via PEAR and just downloaded the git zip of our coding standard and in a folder and told PHPCS where that folder is as per the readme instruction here (or in the PHPCS wiki)

N6REJ commented 6 years ago

ok, got it MOSTLY.. a couple of changes were required..

1 had to change composer.bat to

SET COMPOSER_HOME=%~dp0 @php "%~dp0composer.phar" %*

2 run the following

composer global config minimum-stability alpha composer global require squizlabs/php_codesniffer "~2.8" composer global require joomla/coding-standards "~2.0@alpha"

3 point nb to "C:\neard\tools\composer\composer1.4.2\vendor\squizlabs\php_codesniffer\scripts\phpcs"

However the joomla coding standard does not appear.

photodude commented 6 years ago

it should install in the vendor/joomla folder, you can tel PHPCS where that is with something like the following. (this installs the Joomla standard and the example rulesets, make sure you put your paths in).

vendor/bin/phpcs --config-set installed_paths vendor/joomla/coding-standards,vendor/joomla/coding-standards/Joomla/ExampleRulesets