@@ -47,9 +47,9 @@ |
||
| 47 | 47 | { |
| 48 | 48 | parent::configure(); |
| 49 | 49 | $this->setName('hook:' . $this->hookName) |
| 50 | - ->setAliases([$this->hookName]) |
|
| 51 | - ->setDescription('Run git ' . $this->hookName . ' hook') |
|
| 52 | - ->setHelp('This command executes the ' . $this->hookName . ' hook'); |
|
| 50 | + ->setAliases([$this->hookName]) |
|
| 51 | + ->setDescription('Run git ' . $this->hookName . ' hook') |
|
| 52 | + ->setHelp('This command executes the ' . $this->hookName . ' hook'); |
|
| 53 | 53 | |
| 54 | 54 | $this->addOption( |
| 55 | 55 | 'bootstrap', |
@@ -109,10 +109,10 @@ |
||
| 109 | 109 | $options = substr($command, $endExec); |
| 110 | 110 | |
| 111 | 111 | $command = trim($executable) |
| 112 | - . $this->createInteractiveOptions($options) |
|
| 113 | - . $this->createTTYOptions($options) |
|
| 114 | - . $this->createEnvOptions($options, $hook) |
|
| 115 | - . ' ' . trim($options); |
|
| 112 | + . $this->createInteractiveOptions($options) |
|
| 113 | + . $this->createTTYOptions($options) |
|
| 114 | + . $this->createEnvOptions($options, $hook) |
|
| 115 | + . ' ' . trim($options); |
|
| 116 | 116 | } |
| 117 | 117 | return $command; |
| 118 | 118 | } |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | parent::__construct(); |
| 32 | 32 | |
| 33 | 33 | $this->hint = 'A commit message subject should always complete the following sentence.' . PHP_EOL . |
| 34 | - 'This commit will [YOUR COMMIT MESSAGE].'; |
|
| 34 | + 'This commit will [YOUR COMMIT MESSAGE].'; |
|
| 35 | 35 | |
| 36 | 36 | $this->setSubjectBlacklist( |
| 37 | 37 | [ |
@@ -122,9 +122,9 @@ discard block |
||
| 122 | 122 | protected function errorDetails(string $file): string |
| 123 | 123 | { |
| 124 | 124 | return ' <comment>(' |
| 125 | - . $this->fileMatches[$file] . ' match' |
|
| 126 | - . ($this->fileMatches[$file] > 1 ? 'es' : '') |
|
| 127 | - . ')</comment>'; |
|
| 125 | + . $this->fileMatches[$file] . ' match' |
|
| 126 | + . ($this->fileMatches[$file] > 1 ? 'es' : '') |
|
| 127 | + . ')</comment>'; |
|
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | /** |
@@ -136,10 +136,10 @@ discard block |
||
| 136 | 136 | protected function errorMessage(int $filesFailed): string |
| 137 | 137 | { |
| 138 | 138 | return 'Regex \'' . $this->regexName . '\' failed: ' |
| 139 | - . 'found ' . $this->totalMatches . ' match' |
|
| 140 | - . ($this->totalMatches > 1 ? 'es' : '') |
|
| 141 | - . ' in ' . $filesFailed . ' file' |
|
| 142 | - . ($filesFailed > 1 ? 's' : '' ); |
|
| 139 | + . 'found ' . $this->totalMatches . ' match' |
|
| 140 | + . ($this->totalMatches > 1 ? 'es' : '') |
|
| 141 | + . ' in ' . $filesFailed . ' file' |
|
| 142 | + . ($filesFailed > 1 ? 's' : '' ); |
|
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | /** |
@@ -78,8 +78,8 @@ discard block |
||
| 78 | 78 | |
| 79 | 79 | // every action has to get executed |
| 80 | 80 | $actionConfigFail->expects($this->atLeastOnce()) |
| 81 | - ->method('getAction') |
|
| 82 | - ->willReturn(CH_PATH_FILES . '/bin/failure'); |
|
| 81 | + ->method('getAction') |
|
| 82 | + ->willReturn(CH_PATH_FILES . '/bin/failure'); |
|
| 83 | 83 | |
| 84 | 84 | // so even if the first actions fails this action has to get executed |
| 85 | 85 | $actionConfigSuccess->expects($this->atLeastOnce()) |
@@ -88,8 +88,8 @@ discard block |
||
| 88 | 88 | |
| 89 | 89 | $hookConfig->method('isEnabled')->willReturn(true); |
| 90 | 90 | $hookConfig->expects($this->once()) |
| 91 | - ->method('getActions') |
|
| 92 | - ->willReturn([$actionConfigFail, $actionConfigSuccess]); |
|
| 91 | + ->method('getActions') |
|
| 92 | + ->willReturn([$actionConfigFail, $actionConfigSuccess]); |
|
| 93 | 93 | |
| 94 | 94 | $config->expects($this->once())->method('getHookConfigToExecute')->willReturn($hookConfig); |
| 95 | 95 | $config->method('isHookEnabled')->willReturn(true); |
@@ -125,8 +125,8 @@ discard block |
||
| 125 | 125 | |
| 126 | 126 | $hookConfig->method('isEnabled')->willReturn(true); |
| 127 | 127 | $hookConfig->expects($this->once()) |
| 128 | - ->method('getActions') |
|
| 129 | - ->willReturn([$actionConfigFail, $actionConfigSuccess]); |
|
| 128 | + ->method('getActions') |
|
| 129 | + ->willReturn([$actionConfigFail, $actionConfigSuccess]); |
|
| 130 | 130 | |
| 131 | 131 | $config->expects($this->once())->method('getHookConfigToExecute')->willReturn($hookConfig); |
| 132 | 132 | $config->expects($this->atLeastOnce())->method('isHookEnabled')->willReturn(true); |
@@ -45,13 +45,13 @@ |
||
| 45 | 45 | $io = $this->createIOMock(); |
| 46 | 46 | $io->method('getArgument')->willReturn('hook:pre-push'); |
| 47 | 47 | $io->expects($this->atLeastOnce()) |
| 48 | - ->method('getStandardInput') |
|
| 49 | - ->willReturn( |
|
| 50 | - [ |
|
| 51 | - 'refs/heads/main 9dfa0fa6221d75f48b2dfac359127324bedf8409' . |
|
| 52 | - ' refs/heads/main 8309f6e16097754469c485e604900c573bf2c5d8' |
|
| 53 | - ] |
|
| 54 | - ); |
|
| 48 | + ->method('getStandardInput') |
|
| 49 | + ->willReturn( |
|
| 50 | + [ |
|
| 51 | + 'refs/heads/main 9dfa0fa6221d75f48b2dfac359127324bedf8409' . |
|
| 52 | + ' refs/heads/main 8309f6e16097754469c485e604900c573bf2c5d8' |
|
| 53 | + ] |
|
| 54 | + ); |
|
| 55 | 55 | $operator = $this->createGitDiffOperator(['fiz.php', 'foo.txt']); |
| 56 | 56 | $repository = $this->createRepositoryMock(''); |
| 57 | 57 | $repository->expects($this->once())->method('getDiffOperator')->willReturn($operator); |
@@ -81,7 +81,7 @@ |
||
| 81 | 81 | '<fg=red>Warning: Hook script is out of date</>', |
| 82 | 82 | 'The git hook script needs to be updated.', |
| 83 | 83 | 'Required version is <info>' . CH::MIN_REQ_INSTALLER . '</info>' |
| 84 | - . ' found <fg=red>' . $installerVersion . '</>.', |
|
| 84 | + . ' found <fg=red>' . $installerVersion . '</>.', |
|
| 85 | 85 | 'Please re-install your hook by running:', |
| 86 | 86 | ' <comment>captainhook install ' . $this->hook . '</comment>', |
| 87 | 87 | '', |
@@ -37,32 +37,32 @@ |
||
| 37 | 37 | { |
| 38 | 38 | parent::configure(); |
| 39 | 39 | $this->setName('uninstall') |
| 40 | - ->setDescription('Remove all git hooks from your .git/hooks directory') |
|
| 41 | - ->setHelp('Remove all git hooks from your .git/hooks directory') |
|
| 42 | - ->addArgument( |
|
| 43 | - 'hook', |
|
| 44 | - InputArgument::OPTIONAL, |
|
| 45 | - 'Remove only this one hook. By default all hooks get uninstalled' |
|
| 46 | - ) |
|
| 47 | - ->addOption( |
|
| 48 | - 'force', |
|
| 49 | - 'f', |
|
| 50 | - InputOption::VALUE_NONE, |
|
| 51 | - 'Force install without confirmation' |
|
| 52 | - ) |
|
| 53 | - ->addOption( |
|
| 54 | - 'only-disabled', |
|
| 55 | - null, |
|
| 56 | - InputOption::VALUE_NONE, |
|
| 57 | - 'Limit the hooks you want to remove to those that are not enabled in your conf. ' . |
|
| 58 | - 'By default all hooks get uninstalled' |
|
| 59 | - ) |
|
| 60 | - ->addOption( |
|
| 61 | - 'move-existing-to', |
|
| 62 | - null, |
|
| 63 | - InputOption::VALUE_OPTIONAL, |
|
| 64 | - 'Move existing hooks to this directory' |
|
| 65 | - ); |
|
| 40 | + ->setDescription('Remove all git hooks from your .git/hooks directory') |
|
| 41 | + ->setHelp('Remove all git hooks from your .git/hooks directory') |
|
| 42 | + ->addArgument( |
|
| 43 | + 'hook', |
|
| 44 | + InputArgument::OPTIONAL, |
|
| 45 | + 'Remove only this one hook. By default all hooks get uninstalled' |
|
| 46 | + ) |
|
| 47 | + ->addOption( |
|
| 48 | + 'force', |
|
| 49 | + 'f', |
|
| 50 | + InputOption::VALUE_NONE, |
|
| 51 | + 'Force install without confirmation' |
|
| 52 | + ) |
|
| 53 | + ->addOption( |
|
| 54 | + 'only-disabled', |
|
| 55 | + null, |
|
| 56 | + InputOption::VALUE_NONE, |
|
| 57 | + 'Limit the hooks you want to remove to those that are not enabled in your conf. ' . |
|
| 58 | + 'By default all hooks get uninstalled' |
|
| 59 | + ) |
|
| 60 | + ->addOption( |
|
| 61 | + 'move-existing-to', |
|
| 62 | + null, |
|
| 63 | + InputOption::VALUE_OPTIONAL, |
|
| 64 | + 'Move existing hooks to this directory' |
|
| 65 | + ); |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | /** |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | public function testStdInValue(): void |
| 29 | 29 | { |
| 30 | 30 | $expected = 'refs/heads/main 9dfa0fa6221d75f48b2dfac359127324bedf8409' |
| 31 | - . ' refs/heads/main 8309f6e16097754469c485e604900c573bf2c5d8'; |
|
| 31 | + . ' refs/heads/main 8309f6e16097754469c485e604900c573bf2c5d8'; |
|
| 32 | 32 | |
| 33 | 33 | $io = $this->createIOMock(); |
| 34 | 34 | $repo = $this->createRepositoryMock(); |