coding-standards icon indicating copy to clipboard operation
coding-standards copied to clipboard

Can't install coding-standards per README

Open N6REJ opened this issue 7 years ago • 5 comments

Ok, what have I done wrong? image

N6REJ avatar Dec 25 '17 23:12 N6REJ

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

photodude avatar Dec 27 '17 12:12 photodude

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 :(

N6REJ avatar Dec 27 '17 15:12 N6REJ

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)

photodude avatar Dec 27 '17 15:12 photodude

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.

N6REJ avatar Dec 27 '17 17:12 N6REJ

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

photodude avatar Dec 27 '17 18:12 photodude