From fd1f6251e448c62f25942233bdb0f55b237c7bf2 Mon Sep 17 00:00:00 2001 From: Ben Word Date: Sun, 3 Apr 2016 17:16:29 -0500 Subject: [PATCH] Use Composer to run PHPCS and PHPMD tests --- .travis.yml | 14 +- composer.json | 10 ++ composer.lock | 350 +++++++++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 363 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index a9980c8..ad62994 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,10 +26,13 @@ cache: apt: true directories: - $HOME/.composer/cache - - bower_components - node_modules - vendor +before_install: + - composer self-update + - git config --global github.accesstoken $GITHUB_OAUTH_TOKEN + install: - source ~/.nvm/nvm.sh && nvm install $TRAVIS_NODE_VERSION - travis_retry npm install -g npm@latest @@ -37,13 +40,8 @@ install: - node -v && npm -v - npm rebuild - travis_retry npm install - - travis_retry composer self-update && composer --version - - export PATH="$HOME/.composer/vendor/bin:$PATH" - - travis_retry composer global require squizlabs/php_codesniffer --prefer-dist - - travis_retry composer global require phpmd/phpmd --prefer-dist - - travis_retry composer install -o --prefer-dist --no-interaction + - composer install -o --prefer-dist --no-interaction script: - npm run build - - phpcs -n - - phpmd src text cleancode,codesize,controversial,design,naming,unusedcode + - composer test diff --git a/composer.json b/composer.json index d28912c..83cf336 100644 --- a/composer.json +++ b/composer.json @@ -31,5 +31,15 @@ "require": { "php": ">=5.5.0", "composer/installers": "~1.0" + }, + "require-dev": { + "squizlabs/php_codesniffer": "^2.5.1", + "phpmd/phpmd": "^2.4.2" + }, + "scripts": { + "test": [ + "vendor/bin/phpcs", + "vendor/bin/phpmd src text cleancode,codesize,controversial,design,naming,unusedcode" + ] } } diff --git a/composer.lock b/composer.lock index 6f8b895..6fae444 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "7382dc6bb77190896306e1eb58b6589c", - "content-hash": "75ad99c892e1d82404c58fe3bd989585", + "hash": "5f4d419852a5551e2b54ef851cab83b4", + "content-hash": "1ee82adf8a4565a48214e5686e6b3293", "packages": [ { "name": "composer/installers", @@ -106,7 +106,351 @@ "time": "2016-01-27 12:54:22" } ], - "packages-dev": [], + "packages-dev": [ + { + "name": "pdepend/pdepend", + "version": "2.2.4", + "source": { + "type": "git", + "url": "https://github.com/pdepend/pdepend.git", + "reference": "b086687f3a01dc6bb92d633aef071d2c5dd0db06" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pdepend/pdepend/zipball/b086687f3a01dc6bb92d633aef071d2c5dd0db06", + "reference": "b086687f3a01dc6bb92d633aef071d2c5dd0db06", + "shasum": "" + }, + "require": { + "php": ">=5.3.7", + "symfony/config": "^2.3.0|^3", + "symfony/dependency-injection": "^2.3.0|^3", + "symfony/filesystem": "^2.3.0|^3" + }, + "require-dev": { + "phpunit/phpunit": "^4.4.0,<4.8", + "squizlabs/php_codesniffer": "^2.0.0" + }, + "bin": [ + "src/bin/pdepend" + ], + "type": "library", + "autoload": { + "psr-4": { + "PDepend\\": "src/main/php/PDepend" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "Official version of pdepend to be handled with Composer", + "time": "2016-03-10 15:15:04" + }, + { + "name": "phpmd/phpmd", + "version": "2.4.2", + "source": { + "type": "git", + "url": "https://github.com/phpmd/phpmd.git", + "reference": "fccbdb6b222f6d7a6d35af1c396ba5435cec76a9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpmd/phpmd/zipball/fccbdb6b222f6d7a6d35af1c396ba5435cec76a9", + "reference": "fccbdb6b222f6d7a6d35af1c396ba5435cec76a9", + "shasum": "" + }, + "require": { + "pdepend/pdepend": "~2.0", + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0", + "squizlabs/php_codesniffer": "^2.0" + }, + "bin": [ + "src/bin/phpmd" + ], + "type": "project", + "autoload": { + "psr-0": { + "PHPMD\\": "src/main/php" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Manuel Pichler", + "email": "github@manuel-pichler.de", + "homepage": "https://github.com/manuelpichler", + "role": "Project Founder" + }, + { + "name": "Other contributors", + "homepage": "https://github.com/phpmd/phpmd/graphs/contributors", + "role": "Contributors" + }, + { + "name": "Marc Würth", + "email": "ravage@bluewin.ch", + "homepage": "https://github.com/ravage84", + "role": "Project Maintainer" + } + ], + "description": "PHPMD is a spin-off project of PHP Depend and aims to be a PHP equivalent of the well known Java tool PMD.", + "homepage": "http://phpmd.org/", + "keywords": [ + "mess detection", + "mess detector", + "pdepend", + "phpmd", + "pmd" + ], + "time": "2016-03-10 17:17:44" + }, + { + "name": "squizlabs/php_codesniffer", + "version": "2.5.1", + "source": { + "type": "git", + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "6731851d6aaf1d0d6c58feff1065227b7fda3ba8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/6731851d6aaf1d0d6c58feff1065227b7fda3ba8", + "reference": "6731851d6aaf1d0d6c58feff1065227b7fda3ba8", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.1.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "bin": [ + "scripts/phpcs", + "scripts/phpcbf" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "classmap": [ + "CodeSniffer.php", + "CodeSniffer/CLI.php", + "CodeSniffer/Exception.php", + "CodeSniffer/File.php", + "CodeSniffer/Fixer.php", + "CodeSniffer/Report.php", + "CodeSniffer/Reporting.php", + "CodeSniffer/Sniff.php", + "CodeSniffer/Tokens.php", + "CodeSniffer/Reports/", + "CodeSniffer/Tokenizers/", + "CodeSniffer/DocGenerators/", + "CodeSniffer/Standards/AbstractPatternSniff.php", + "CodeSniffer/Standards/AbstractScopeSniff.php", + "CodeSniffer/Standards/AbstractVariableSniff.php", + "CodeSniffer/Standards/IncorrectPatternException.php", + "CodeSniffer/Standards/Generic/Sniffs/", + "CodeSniffer/Standards/MySource/Sniffs/", + "CodeSniffer/Standards/PEAR/Sniffs/", + "CodeSniffer/Standards/PSR1/Sniffs/", + "CodeSniffer/Standards/PSR2/Sniffs/", + "CodeSniffer/Standards/Squiz/Sniffs/", + "CodeSniffer/Standards/Zend/Sniffs/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "lead" + } + ], + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "http://www.squizlabs.com/php-codesniffer", + "keywords": [ + "phpcs", + "standards" + ], + "time": "2016-01-19 23:39:10" + }, + { + "name": "symfony/config", + "version": "v3.0.4", + "source": { + "type": "git", + "url": "https://github.com/symfony/config.git", + "reference": "980ee40c28f00acff8906c11b778aab5f0db74c2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/config/zipball/980ee40c28f00acff8906c11b778aab5f0db74c2", + "reference": "980ee40c28f00acff8906c11b778aab5f0db74c2", + "shasum": "" + }, + "require": { + "php": ">=5.5.9", + "symfony/filesystem": "~2.8|~3.0" + }, + "suggest": { + "symfony/yaml": "To use the yaml reference dumper" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Config\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Config Component", + "homepage": "https://symfony.com", + "time": "2016-03-04 07:55:57" + }, + { + "name": "symfony/dependency-injection", + "version": "v3.0.4", + "source": { + "type": "git", + "url": "https://github.com/symfony/dependency-injection.git", + "reference": "6a9058101b591edced21ca3c83c80a3978f5c6b0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/6a9058101b591edced21ca3c83c80a3978f5c6b0", + "reference": "6a9058101b591edced21ca3c83c80a3978f5c6b0", + "shasum": "" + }, + "require": { + "php": ">=5.5.9" + }, + "require-dev": { + "symfony/config": "~2.8|~3.0", + "symfony/expression-language": "~2.8|~3.0", + "symfony/yaml": "~2.8|~3.0" + }, + "suggest": { + "symfony/config": "", + "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them", + "symfony/yaml": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\DependencyInjection\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony DependencyInjection Component", + "homepage": "https://symfony.com", + "time": "2016-03-30 10:41:14" + }, + { + "name": "symfony/filesystem", + "version": "v3.0.4", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "f82499a459dcade2ea56df94cc58b19c8bde3d20" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/f82499a459dcade2ea56df94cc58b19c8bde3d20", + "reference": "f82499a459dcade2ea56df94cc58b19c8bde3d20", + "shasum": "" + }, + "require": { + "php": ">=5.5.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Filesystem Component", + "homepage": "https://symfony.com", + "time": "2016-03-27 10:24:39" + } + ], "aliases": [], "minimum-stability": "stable", "stability-flags": [],