Lints your silverstripe php code, checks for potential bugs, and other helpful commands.
Install as global composer package and then try to access the commands, starting with ssu-
from the command line.
# silverstripe
ssu-dev-build
# linting
ssu-lint-all
ssu-lint-compat
ssu-lint-ecs
ssu-lint-js
ssu-lint-rector
ssu-lint-stan
# git
ssu-gitpush
ssu-gitpush-vendor-packages
ssu-remove-origs
# webpack
ssu-npm-install
ssu-npm-build
ssu-npm-watch
composer require --dev sunnysideup/easy-coding-standards:dev-master
composer global require sunnysideup/easy-coding-standards:dev-master
composer global update
~/.bashrc
(or otherwise):PATH=~/.composer/vendor/bin:$PATH
PATH=~/.config/composer/vendor/bin:$PATH
To make the composer vendor/bin
available anywhere
source ~/.bashrc
or restart your computer.
ssu-lint-ecs [dir]
and all the other commands.
Once intalled you can run some simple commands to lint your Silverstripe (and other) code.
Make sure to always run from root of project, even if you are linting a vendor module.
In general commands take one parameter: the dir you wan to lint and a number of flags.
The default is app
.
vendor/bin/ssu-lint-ecs [dir]
If installed globally:
ssu-lint-ecs [dir]
vendor/bin/ssu-lint-rector [dir]
If installed globally:
ssu-lint-rector [dir]
vendor/bin/ssu-lint-stan [dir]
If installed globally:
ssu-lint-stan [dir]
vendor/bin/ssu-lint-compat [dir]
If installed globally:
ssu-lint-compat [dir]
vendor/bin/ssu-lint-all [dir]
If installed globally:
ssu-lint-all [dir]
If you install js standards, like this (you may need to use sudo
):
npm install standard --global
sudo npm install standard --global
Then you can the following command to fix your js:
vendor/bin/ssu-lint-js [dir]
If installed globally:
ssu-lint-js [dir]
You may need to set the right directory - e.g.
Do a quick git push
vendor/bin/ssu-gitpush [dir]
If installed globally:
ssu-gitpush [dir]
Do a quick git push
vendor/bin/ssu-gitpush-vendor-packages vendor/[vendorName]
If installed globally:
ssu-gitpush-vendor-packages vendor/[vendorName]
e.g.
ssu-gitpush-vendor-packages vendor/silverstripe
will git commit and git push ALL SilverStripe vendor packages.
Get all the assets from a website server
vendor/bin/ssu-rsync-assets [webserver:/var/www/websiteroot]
If installed globally:
ssu-rsync-assets [webserver:/var/www/websiteroot]
e.g. browse to your local webroot dir and run:
ssu-rsync-assets [email protected]:/var/www/html
will git commit and git push ALL SilverStripe vendor packages.
Do a quick git push
vendor/bin/ssu-origs [dir]
If installed globally:
ssu-origs [dir]
Do a quick git push
vendor/bin/ssu-dev-build [dir]
If installed globally:
ssu-dev-build [dir]
Find out all your options for any of the functions.
ssu-lint-ecs -h
default: false
Module rating system helping users find modules that are well supported. For more on how the rating system works visit Module standards
Score not correct? Let us know there is a problem