From e98098ea18ba9ef33b1d5a34932e975400ff4186 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Federico=20Moy=C3=A1?= Date: Wed, 30 Sep 2020 08:28:16 -0300 Subject: [PATCH 1/2] Update PHP Codesniffer --- Dockerfile | 12 +- Runner.php => Executor.php | 78 +++++----- composer.json | 7 +- composer.lock | 300 +++++++++++++++++++++++++------------ engine.php | 4 +- 5 files changed, 246 insertions(+), 155 deletions(-) rename Runner.php => Executor.php (66%) diff --git a/Dockerfile b/Dockerfile index 8e083b5..b2dca1a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM alpine:edge +FROM alpine:3.12 RUN adduser -u 9000 -D app @@ -20,15 +20,9 @@ RUN apk add --no-cache \ php7-tokenizer \ php7-xml \ php7-xmlwriter \ - php7-zlib && \ - EXPECTED_SIGNATURE=$(php -r "echo file_get_contents('https://composer.github.io/installer.sig');") && \ - php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \ - ACTUAL_SIGNATURE=$(php -r "echo hash_file('SHA384', 'composer-setup.php');") && \ - [ "$EXPECTED_SIGNATURE" = "$ACTUAL_SIGNATURE" ] || (echo "Invalid Composer installer signature"; exit 1) && \ - php composer-setup.php --quiet && \ - mv composer.phar /usr/local/bin/composer && \ - rm -r composer-setup.php ~/.composer + php7-zlib +COPY --from=composer /usr/bin/composer /usr/local/bin/composer COPY composer.json composer.lock ./ RUN apk add --no-cache git && \ diff --git a/Runner.php b/Executor.php similarity index 66% rename from Runner.php rename to Executor.php index ca03146..0788ea8 100644 --- a/Runner.php +++ b/Executor.php @@ -1,12 +1,13 @@ config['include_paths'])) { + if (isset($this->config['include_paths'])) { $this->queueWithIncludePaths(); } else { $this->queuePaths($dir, $prefix, $this->config['exclude_paths']); @@ -32,7 +33,8 @@ public function queueDirectory($dir, $prefix = '') $this->server->process_work(false); } - public function queueWithIncludePaths() { + public function queueWithIncludePaths() + { foreach ($this->config['include_paths'] as $f) { if ($f !== '.' and $f !== '..') { if (is_dir($f)) { @@ -44,7 +46,8 @@ public function queueWithIncludePaths() { } } - public function queuePaths($dir, $prefix = '', $exclusions = []) { + public function queuePaths($dir, $prefix = '', $exclusions = []) + { $dir = rtrim($dir, '\\/'); foreach (scandir($dir) as $f) { @@ -62,7 +65,8 @@ public function queuePaths($dir, $prefix = '', $exclusions = []) { } } - public function filterByExtension($f, $prefix = '') { + public function filterByExtension($f, $prefix = '') + { foreach ($this->fileExtensions() as $file_extension) { if (S::create($f)->endsWith($file_extension)) { $prefix = ltrim($prefix, "\\/"); @@ -71,7 +75,8 @@ public function filterByExtension($f, $prefix = '') { } } - private function fileExtensions() { + private function fileExtensions() + { $extensions = $this->config['config']['file_extensions']; if (empty($extensions)) { @@ -85,55 +90,44 @@ public function run($files) { try { $resultFile = tempnam(sys_get_temp_dir(), 'phpcodesniffer'); + $config_args = array( '-s', '-p' ); - $extra_config_options = array('--report-json='.$resultFile); + if (isset($this->config['config']['ignore_warnings']) && $this->config['config']['ignore_warnings']) { + $config_args[] = '-n'; + } + + Timing::startTiming(); + + $runner = new Runner(); + $runner->config = new Config($config_args); if (isset($this->config['config']['standard'])) { - $extra_config_options[] = '--standard=' . $this->config['config']['standard']; + $runner->config->standards = explode(',', $this->config['config']['standard']); } else { - $extra_config_options[] = '--standard=PSR1,PSR2'; - } - - if (isset($this->config['config']['ignore_warnings']) && $this->config['config']['ignore_warnings']) { - $extra_config_options[] = '-n'; + $runner->config->standards = array('PSR1', 'PSR2'); } if (isset($this->config['config']['encoding'])) { - $extra_config_options[] = '--encoding=' . $this->config['config']['encoding']; - } - - foreach ($files as $file) { - $extra_config_options[] = $file; + $runner->config->encoding = $this->config['config']['encoding']; } - // prevent any stdout leakage - ob_start(); - - // setup the code sniffer - $runner = new \PHP_CodeSniffer\Runner(); - $runner->config = new Config($extra_config_options); + $runner->config->reports = array( 'json' => null ); + $runner->config->reportFile = $resultFile; $runner->init(); - // setup the code sniffer $runner->reporter = new Reporter($runner->config); - // start the code sniffing - Timing::startTiming(); - $runner->checkRequirements(); - - $todo = new FileList($runner->config, $runner->ruleset); - foreach ($todo as $path => $file) { - if ($file->ignored === false) { - $runner->processFile($file); - } + foreach ($files as $file_path) { + $file = new DummyFile(file_get_contents($file_path), $runner->ruleset, $runner->config); + $file->path = $file_path; + + $runner->processFile($file); } - $runner->reporter->printReports(); + ob_start(); - // clean up the output buffers (might be more that one) - while (ob_get_level()) { - ob_end_clean(); - } + $runner->reporter->printReports(); + $report = ob_get_clean(); return $resultFile; } catch (\Throwable $e) { diff --git a/composer.json b/composer.json index b4fb5ab..1e96a9b 100644 --- a/composer.json +++ b/composer.json @@ -16,16 +16,15 @@ } }, "require": { - "squizlabs/php_codesniffer": "^3.5", + "squizlabs/php_codesniffer": "^3.5.6", "barracudanetworks/forkdaemon-php": "^1.0", "danielstjules/stringy": "^2.3", "drupal/coder": "^8.3", - "escapestudios/symfony2-coding-standard": "^3.9", + "escapestudios/symfony2-coding-standard": "^3.10", "wp-coding-standards/wpcs": "^2.1", "yiisoft/yii2-coding-standards": "^2.0", "magento/marketplace-eqp": "^4.0", - "magento/magento-coding-standard": "^4.0" - "magento/marketplace-eqp": "^1.0", + "magento/magento-coding-standard": "^4.0", "pheromone/phpcs-security-audit": "^1.0" } } diff --git a/composer.lock b/composer.lock index 467001a..6ac9fde 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "cf98f1088cec2e6cdc42bc5230551404", + "content-hash": "f93564adbeaee167745698d64f8db8af", "packages": [ { "name": "barracudanetworks/forkdaemon-php", @@ -100,31 +100,33 @@ }, { "name": "drupal/coder", - "version": "8.3.6", + "version": "8.3.10", "source": { "type": "git", "url": "https://git.drupalcode.org/project/coder.git", - "reference": "4337ddf58d28dbdee4e1367bf71ee13393ab9820" + "reference": "e1d71c6bb75b94f9ed00dceb2f4f6cb7e044723d" }, "require": { "ext-mbstring": "*", - "php": ">=5.5.9", - "squizlabs/php_codesniffer": "^3.4.1", + "php": ">=7.0.8", + "sirbrillig/phpcs-variable-analysis": "^2.8", + "squizlabs/php_codesniffer": "^3.5.6", "symfony/yaml": ">=2.0.5" }, "require-dev": { - "phpunit/phpunit": ">=3.7 <6" + "phpstan/phpstan": "^0.12.31", + "phpunit/phpunit": "^6.0 || ^7.0" }, "type": "phpcodesniffer-standard", "autoload": { - "psr-0": { + "psr-4": { "Drupal\\": "coder_sniffer/Drupal/", "DrupalPractice\\": "coder_sniffer/DrupalPractice/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "GPL-2.0+" + "GPL-2.0-or-later" ], "description": "Coder is a library to review Drupal code.", "homepage": "https://www.drupal.org/project/coder", @@ -133,20 +135,20 @@ "phpcs", "standards" ], - "time": "2019-08-09T09:27:26+00:00" + "time": "2020-09-03T19:59:53+00:00" }, { "name": "escapestudios/symfony2-coding-standard", - "version": "3.9.2", + "version": "3.11.0", "source": { "type": "git", "url": "https://github.com/djoos/Symfony-coding-standard.git", - "reference": "369b5f2579be6aed478ca3a4248619eab6e54e41" + "reference": "78e3b0b6832c88cf7c0240b4abcd61430030d8c3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/djoos/Symfony-coding-standard/zipball/369b5f2579be6aed478ca3a4248619eab6e54e41", - "reference": "369b5f2579be6aed478ca3a4248619eab6e54e41", + "url": "https://api.github.com/repos/djoos/Symfony-coding-standard/zipball/78e3b0b6832c88cf7c0240b4abcd61430030d8c3", + "reference": "78e3b0b6832c88cf7c0240b4abcd61430030d8c3", "shasum": "" }, "require": { @@ -156,7 +158,7 @@ "squizlabs/php_codesniffer": "<3 || >=4" }, "require-dev": { - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" + "phpunit/phpunit": "^5.0 || ^6.0 || ^7.0" }, "type": "phpcodesniffer-standard", "extra": { @@ -186,45 +188,15 @@ "phpcs", "symfony" ], - "time": "2019-09-25T08:43:58+00:00" - }, - { - "name": "magento/magento-coding-standard", - "version": "4", - "source": { - "type": "git", - "url": "https://github.com/magento/magento-coding-standard.git", - "reference": "d24e0230a532e19941ed264f57db38fad5b1008a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/magento/magento-coding-standard/zipball/d24e0230a532e19941ed264f57db38fad5b1008a", - "reference": "d24e0230a532e19941ed264f57db38fad5b1008a", - "shasum": "" - }, - "require": { - "php": ">=5.6.0", - "squizlabs/php_codesniffer": "^3.4" - }, - "require-dev": { - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" - }, - "type": "phpcodesniffer-standard", - "notification-url": "https://packagist.org/downloads/", - "license": [ - "OSL-3.0", - "AFL-3.0" - ], - "description": "A set of Magento specific PHP CodeSniffer rules.", - "time": "2019-08-06T15:58:37+00:00" + "time": "2020-01-22T10:27:47+00:00" }, { "name": "magento/marketplace-eqp", - "version": "4.0.0", + "version": "1.0.5", "source": { "type": "git", "url": "https://github.com/magento/marketplace-eqp.git", - "reference": "4.0.0" + "reference": "1.0.5" }, "type": "library", "license": [ @@ -233,49 +205,65 @@ "description": "A set of PHP_CodeSniffer rules and sniffs." }, { - "name": "pheromone/phpcs-security-audit", - "version": "1.0.3", + "name": "sirbrillig/phpcs-variable-analysis", + "version": "v2.8.3", "source": { "type": "git", - "url": "https://github.com/FloeDesignTechnologies/phpcs-security-audit.git", - "reference": "7586825d6b12c9d305561de28d612c4831792e9b" + "url": "https://github.com/sirbrillig/phpcs-variable-analysis.git", + "reference": "00b4fa3130faa26762c929989e3d958086c627f1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FloeDesignTechnologies/phpcs-security-audit/zipball/7586825d6b12c9d305561de28d612c4831792e9b", - "reference": "7586825d6b12c9d305561de28d612c4831792e9b", + "url": "https://api.github.com/repos/sirbrillig/phpcs-variable-analysis/zipball/00b4fa3130faa26762c929989e3d958086c627f1", + "reference": "00b4fa3130faa26762c929989e3d958086c627f1", "shasum": "" }, "require": { - "php": ">=5.4", - "squizlabs/php_codesniffer": "~1.5.1 || >=2.3.3 <3.0" + "php": ">=5.4.0", + "squizlabs/php_codesniffer": "^3.1" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.4.4 || ^0.5 || ^0.6", + "limedeck/phpunit-detailed-printer": "^3.1 || ^4.0 || ^5.0", + "phpstan/phpstan": "^0.11.8", + "phpunit/phpunit": "^5.0 || ^6.5 || ^7.0 || ^8.0", + "sirbrillig/phpcs-import-detection": "^1.1" + }, + "type": "phpcodesniffer-standard", + "autoload": { + "psr-4": { + "VariableAnalysis\\": "VariableAnalysis/" + } }, - "type": "library", "notification-url": "https://packagist.org/downloads/", "license": [ - "GPL-3.0-or-later" + "BSD-2-Clause" ], "authors": [ { - "name": "Jonathan Marcil", - "homepage": "https://twitter.com/jonathanmarcil" + "name": "Sam Graham", + "email": "php-codesniffer-variableanalysis@illusori.co.uk" + }, + { + "name": "Payton Swick", + "email": "payton@foolord.com" } ], - "description": "phpcs-security-audit is a set of PHP_CodeSniffer rules that finds vulnerabilities and weaknesses related to security in PHP code", - "time": "2018-02-20T04:45:18+00:00" + "description": "A PHPCS sniff to detect problems with variables.", + "time": "2020-07-11T23:32:06+00:00" }, { "name": "squizlabs/php_codesniffer", - "version": "3.5.2", + "version": "3.5.6", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "65b12cdeaaa6cd276d4c3033a95b9b88b12701e7" + "reference": "e97627871a7eab2f70e59166072a6b767d5834e0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/65b12cdeaaa6cd276d4c3033a95b9b88b12701e7", - "reference": "65b12cdeaaa6cd276d4c3033a95b9b88b12701e7", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/e97627871a7eab2f70e59166072a6b767d5834e0", + "reference": "e97627871a7eab2f70e59166072a6b767d5834e0", "shasum": "" }, "require": { @@ -313,20 +301,84 @@ "phpcs", "standards" ], - "time": "2019-10-28T04:36:32+00:00" + "time": "2020-08-10T04:50:15+00:00" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v2.2.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "5fa56b4074d1ae755beb55617ddafe6f5d78f665" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/5fa56b4074d1ae755beb55617ddafe6f5d78f665", + "reference": "5fa56b4074d1ae755beb55617ddafe6f5d78f665", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-09-07T11:33:47+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.12.0", + "version": "v1.18.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "550ebaac289296ce228a706d0867afc34687e3f4" + "reference": "1c302646f6efc070cd46856e600e5e0684d6b454" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/550ebaac289296ce228a706d0867afc34687e3f4", - "reference": "550ebaac289296ce228a706d0867afc34687e3f4", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/1c302646f6efc070cd46856e600e5e0684d6b454", + "reference": "1c302646f6efc070cd46856e600e5e0684d6b454", "shasum": "" }, "require": { @@ -338,7 +390,11 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.12-dev" + "dev-master": "1.18-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { @@ -371,20 +427,34 @@ "polyfill", "portable" ], - "time": "2019-08-06T08:03:45+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-07-14T12:35:20+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.12.0", + "version": "v1.18.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "b42a2f66e8f1b15ccf25652c3424265923eb4f17" + "reference": "a6977d63bf9a0ad4c65cd352709e230876f9904a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/b42a2f66e8f1b15ccf25652c3424265923eb4f17", - "reference": "b42a2f66e8f1b15ccf25652c3424265923eb4f17", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/a6977d63bf9a0ad4c65cd352709e230876f9904a", + "reference": "a6977d63bf9a0ad4c65cd352709e230876f9904a", "shasum": "" }, "require": { @@ -396,7 +466,11 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.12-dev" + "dev-master": "1.18-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { @@ -430,39 +504,57 @@ "portable", "shim" ], - "time": "2019-08-06T08:03:45+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-07-14T12:35:20+00:00" }, { "name": "symfony/yaml", - "version": "v4.3.5", + "version": "v5.1.6", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "41e16350a2a1c7383c4735aa2f9fce74cf3d1178" + "reference": "e147a68cb66a8b510f4b7481fe4da5b2ab65ec6a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/41e16350a2a1c7383c4735aa2f9fce74cf3d1178", - "reference": "41e16350a2a1c7383c4735aa2f9fce74cf3d1178", + "url": "https://api.github.com/repos/symfony/yaml/zipball/e147a68cb66a8b510f4b7481fe4da5b2ab65ec6a", + "reference": "e147a68cb66a8b510f4b7481fe4da5b2ab65ec6a", "shasum": "" }, "require": { - "php": "^7.1.3", + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1", "symfony/polyfill-ctype": "~1.8" }, "conflict": { - "symfony/console": "<3.4" + "symfony/console": "<4.4" }, "require-dev": { - "symfony/console": "~3.4|~4.0" + "symfony/console": "^4.4|^5.0" }, "suggest": { "symfony/console": "For validating YAML files using the lint command" }, + "bin": [ + "Resources/bin/yaml-lint" + ], "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "5.1-dev" } }, "autoload": { @@ -489,33 +581,45 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2019-09-11T15:41:19+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-09-27T03:44:28+00:00" }, { "name": "wp-coding-standards/wpcs", - "version": "2.1.1", + "version": "1.2.1", "source": { "type": "git", "url": "https://github.com/WordPress/WordPress-Coding-Standards.git", - "reference": "bd9c33152115e6741e3510ff7189605b35167908" + "reference": "f328bcafd97377e8e5e5d7b244d5ddbf301a3a5c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/bd9c33152115e6741e3510ff7189605b35167908", - "reference": "bd9c33152115e6741e3510ff7189605b35167908", + "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/f328bcafd97377e8e5e5d7b244d5ddbf301a3a5c", + "reference": "f328bcafd97377e8e5e5d7b244d5ddbf301a3a5c", "shasum": "" }, "require": { - "php": ">=5.4", - "squizlabs/php_codesniffer": "^3.3.1" + "php": ">=5.3", + "squizlabs/php_codesniffer": "^2.9.0 || ^3.0.2" }, "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.5.0", - "phpcompatibility/php-compatibility": "^9.0", - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" + "phpcompatibility/php-compatibility": "^9.0" }, "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.5.0 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically." + "dealerdirect/phpcodesniffer-composer-installer": "^0.4.3 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically." }, "type": "phpcodesniffer-standard", "notification-url": "https://packagist.org/downloads/", @@ -534,7 +638,7 @@ "standards", "wordpress" ], - "time": "2019-05-21T02:50:00+00:00" + "time": "2018-12-18T09:43:51+00:00" }, { "name": "yiisoft/yii2-coding-standards", diff --git a/engine.php b/engine.php index de1d250..2e935f4 100644 --- a/engine.php +++ b/engine.php @@ -2,7 +2,7 @@ // Hooking into PHP_CodeSniffer's autoloader require_once __DIR__.'/vendor/squizlabs/php_codesniffer/autoload.php'; -require_once "Runner.php"; +require_once "Executor.php"; require_once "Sniffs.php"; use Sniffs\Sniffs; @@ -20,7 +20,7 @@ $server->max_children_set(3); $server->max_work_per_child_set(50); $server->store_result_set(true); -$runner = new Runner($config, $server); +$runner = new Executor($config, $server); $server->register_child_run(array($runner, "run")); $runner->queueDirectory("/code"); From dbc67f553837510e8a6c65e9b4fb91d091ddd6bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Federico=20Moy=C3=A1?= Date: Wed, 30 Sep 2020 08:34:00 -0300 Subject: [PATCH 2/2] Update circleci --- .circleci/config.yml | 15 +++++++++++++++ circle.yml | 35 ----------------------------------- 2 files changed, 15 insertions(+), 35 deletions(-) create mode 100644 .circleci/config.yml delete mode 100644 circle.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..3468317 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,15 @@ +version: 2.1 + +jobs: + build: + machine: + docker_layer_caching: true + working_directory: ~/codeclimate/codeclimate-phpcodesniffer + steps: + - checkout + - run: + name: Build + command: make image +notify: + webhooks: + - url: https://cc-slack-proxy.herokuapp.com/circle diff --git a/circle.yml b/circle.yml deleted file mode 100644 index cdde542..0000000 --- a/circle.yml +++ /dev/null @@ -1,35 +0,0 @@ -machine: - services: - - docker - -dependencies: - override: - - > - docker run - --env CIRCLE_BRANCH - --env CIRCLE_PROJECT_REPONAME - --env CIRCLE_TOKEN - --env GCR_JSON_KEY - --volume /var/run/docker.sock:/var/run/docker.sock - codeclimate/patrick pull || true - - make image - -test: - override: - - echo "true" - -deployment: - registry: - branch: master - commands: - - > - docker run - --env CIRCLE_BUILD_NUM - --env CIRCLE_PROJECT_REPONAME - --env GCR_JSON_KEY - --volume /var/run/docker.sock:/var/run/docker.sock - codeclimate/patrick push gcr - -notify: - webhooks: - - url: https://cc-slack-proxy.herokuapp.com/circle