From 1bda20ca90a61b1a502d21779fcc3b84908b35e9 Mon Sep 17 00:00:00 2001 From: Julien Date: Tue, 27 Oct 2020 10:38:34 +0100 Subject: [PATCH 1/4] fix(composer): fix composer version on travis --- .travis.yml | 2 ++ README.md | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b09dd55..bce2800 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,8 @@ language: php php: - '7.2' +before_script: + - composer self-update --rollback script: - composer install - vendor/bin/phpunit \ No newline at end of file diff --git a/README.md b/README.md index 2b16b0c..a30e080 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # CODE QUALITY PLUGIN -[![Build Status](https://travis-ci.com/thewalkingcoder/code-quality-plugin.svg?branch=master)](https://travis-ci.com/thewalkingcoder/code-quality-plugin) +[![Build Status](https://travis-ci.com/thewalkingcoder/code-quality-plugin.svg?branch=1.x)](https://travis-ci.com/thewalkingcoder/code-quality-plugin) Plugin composer permettant la mise en place d'outils pour une analyse qualité et respect des standards sur un projet symfony. From 83ed5eb007659d31038aba3582b41ebed3631208 Mon Sep 17 00:00:00 2001 From: Julien Date: Tue, 27 Oct 2020 10:53:26 +0100 Subject: [PATCH 2/4] doc(README): update informations with composer version --- README.md | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/README.md b/README.md index a30e080..30bed57 100644 --- a/README.md +++ b/README.md @@ -8,20 +8,12 @@ Plugin composer permettant la mise en place d'outils pour une analyse qualité - git >=2.17 - symfony (website-skeleton) >=4.4 ou symfony >=4.4 (skeleton) avec le pack symfony/test-pack -- composer 2.x +- composer 1.x # Installation ``` -composer require twc/code-quality-plugin --dev - -``` - -If you use composer v1.x try - -``` - composer require twc/code-quality-plugin:^1.0 --dev ``` From 724744efdf4c14e289c2d3d80f187e66df0f7eff Mon Sep 17 00:00:00 2001 From: Julien Date: Thu, 29 Oct 2020 14:30:22 +0100 Subject: [PATCH 3/4] fix(interface): prepare migration to composer v2 --- src/CodeQualityPlugin.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/CodeQualityPlugin.php b/src/CodeQualityPlugin.php index 1ef5404..681bbb7 100644 --- a/src/CodeQualityPlugin.php +++ b/src/CodeQualityPlugin.php @@ -56,4 +56,14 @@ public function postInstall() $this->io->write($process->getOutput()); $this->io->write('twc/code-quality-plugin: ...installation terminée'); } + + public function deactivate(Composer $composer, IOInterface $io) + { + // TODO: Implement deactivate() method. + } + + public function uninstall(Composer $composer, IOInterface $io) + { + // TODO: Implement uninstall() method. + } } From ba185018977a81d7434d6983d3640ef496d64ea6 Mon Sep 17 00:00:00 2001 From: thewalkingcoder Date: Tue, 2 Feb 2021 19:54:51 +0100 Subject: [PATCH 4/4] fix(command): keep compatibility with console 4.4 and 5.2 --- src/Command/AllInstall.php | 2 ++ src/Command/CommitForce.php | 1 + src/Command/HooksInstall.php | 4 +++- src/Command/MakefileInstall.php | 6 ++++-- src/Command/QualityInstall.php | 3 ++- 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/Command/AllInstall.php b/src/Command/AllInstall.php index 37836de..1c74f83 100644 --- a/src/Command/AllInstall.php +++ b/src/Command/AllInstall.php @@ -38,6 +38,8 @@ protected function execute(InputInterface $input, OutputInterface $output) $process->run(); $this->clearModels(); + + return 0; } private function clearModels() diff --git a/src/Command/CommitForce.php b/src/Command/CommitForce.php index f26decf..96d1d09 100644 --- a/src/Command/CommitForce.php +++ b/src/Command/CommitForce.php @@ -37,6 +37,7 @@ protected function execute(InputInterface $input, OutputInterface $output) $this->restore(['pre-commit.tempo', 'commit-msg.tempo']); $output->write($process->getOutput()); + return 0; } private function getHooksDir() diff --git a/src/Command/HooksInstall.php b/src/Command/HooksInstall.php index ada1dc3..9659790 100644 --- a/src/Command/HooksInstall.php +++ b/src/Command/HooksInstall.php @@ -47,7 +47,7 @@ protected function execute(InputInterface $input, OutputInterface $output) } $this->output->writeln('[skip] Git n\'est pas initialisé sur votre projet'); - return false; + return 0; } $hooks = $this->getHooks(); @@ -55,6 +55,8 @@ protected function execute(InputInterface $input, OutputInterface $output) foreach ($hooks as $hook) { $this->copy($hook); } + + return 0; } private function getHooks() diff --git a/src/Command/MakefileInstall.php b/src/Command/MakefileInstall.php index cb4765e..3a6841c 100644 --- a/src/Command/MakefileInstall.php +++ b/src/Command/MakefileInstall.php @@ -44,7 +44,7 @@ protected function execute(InputInterface $input, OutputInterface $output) $fileSystem->copy(__DIR__ . '/../../make/Makefile', $this->makefile); $output->writeln('twc/code-quality-plugin: Create Makefile'); - return false; + return 0; } $content = file_get_contents($this->makefile); @@ -53,10 +53,12 @@ protected function execute(InputInterface $input, OutputInterface $output) if (in_array($model, $lines)) { $output->writeln('twc/code-quality-plugin: [skip] Makefile is up to date'); - return false; + return 0; } file_put_contents($this->makefile, "\n\n$model", FILE_APPEND); $output->writeln('twc/code-quality-plugin: Makefile updated'); + + return 0; } } diff --git a/src/Command/QualityInstall.php b/src/Command/QualityInstall.php index 14acb47..d062329 100644 --- a/src/Command/QualityInstall.php +++ b/src/Command/QualityInstall.php @@ -50,11 +50,12 @@ protected function execute(InputInterface $input, OutputInterface $output) if (\is_dir($this->dirQuality) && ($mode !== 'force')) { $output->writeln($message); - return false; + return 0; } $composerSystem->copy(__DIR__ . '/../../quality', $this->dirQuality); $fileSystem->chmod($this->dirQuality . '/commit-rules.sh', 0777); $output->writeln('twc/code-quality-plugin: Dossier de configuration créé'); + return 0; } }