Skip to content

Commit 6f3e1b3

Browse files
committed
pint
1 parent 10b7cbf commit 6f3e1b3

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

src/Console/Commands/Hooks/PintPreCommitHook.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ public function handle(ChangedFiles $files, Closure $next)
2828
return $next($files);
2929
}
3030

31-
if (!$this->isPintInstalled()) {
31+
if (! $this->isPintInstalled()) {
3232
$this->newLine(2);
3333
$this->output->writeln(
34-
sprintf("<bg=red;fg=white> ERROR </> %s",
34+
sprintf('<bg=red;fg=white> ERROR </> %s',
3535
'Pint is not installed. Please run <info>composer require laravel/pint --dev</info> to install it.')
3636
);
3737
$this->newLine();
@@ -40,18 +40,18 @@ public function handle(ChangedFiles $files, Closure $next)
4040

4141
$errorFiles = [];
4242
foreach ($stagedFilePaths as $stagedFilePath) {
43-
$isPintProperlyFormatted = $this->runCommands('./vendor/bin/pint --test --config ./pint.json ' . $stagedFilePath,
43+
$isPintProperlyFormatted = $this->runCommands('./vendor/bin/pint --test --config ./pint.json '.$stagedFilePath,
4444
[
4545
'cwd' => base_path(),
4646
])->isSuccessful();
4747

48-
if (!$isPintProperlyFormatted) {
48+
if (! $isPintProperlyFormatted) {
4949
if (empty($errorFiles)) {
5050
$this->newLine();
5151
}
5252

5353
$this->output->writeln(
54-
sprintf("<fg=red> Pint Failed:</> %s", "$stagedFilePath")
54+
sprintf('<fg=red> Pint Failed:</> %s', "$stagedFilePath")
5555
);
5656
$errorFiles[] = $stagedFilePath;
5757
}
@@ -63,16 +63,16 @@ public function handle(ChangedFiles $files, Closure $next)
6363

6464
$this->newLine();
6565
$this->output->writeln(
66-
sprintf("<bg=red;fg=white> COMMIT FAILED </> %s",
66+
sprintf('<bg=red;fg=white> COMMIT FAILED </> %s',
6767
'Your commit contains files that should pass Pint but do not. Please fix the Pint errors in the files above and try again.')
6868
);
6969

70-
if ($this->confirm("Would you like to attempt to correct files automagically?", false)) {
70+
if ($this->confirm('Would you like to attempt to correct files automagically?', false)) {
7171
$errorFilesString = implode(' ', $errorFiles);
7272
$this->runCommands(
7373
[
74-
'./vendor/bin/pint --config ./pint.json ' . $errorFilesString,
75-
'git add ' . $errorFilesString,
74+
'./vendor/bin/pint --config ./pint.json '.$errorFilesString,
75+
'git add '.$errorFilesString,
7676
],
7777
['cwd' => base_path()]
7878
);

src/Traits/ConsoleHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ trait ConsoleHelper
3333
*
3434
* @return void
3535
*/
36-
public function __construct($argInput = "")
36+
public function __construct($argInput = '')
3737
{
3838
$this->input = new StringInput($argInput);
3939
$this->consoleOutput = new ConsoleOutput();

src/Traits/GitHelper.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ public function updateCommitMessageContentInFile(string $path, string $message):
6363

6464
/**
6565
* @read https://stackoverflow.com/questions/30733415/how-to-determine-if-git-merge-is-in-process#answer-30781568
66+
*
6667
* @return bool
6768
*/
6869
public function isMergeInProgress()

src/Traits/WithPipeline.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ protected function finishHookConsoleTask(): Closure
9898
public function getHookTaskTitle(Hook $hook): string
9999
{
100100
$hookName = $hook->getName() ?? class_basename($hook);
101+
101102
return sprintf(' <bg=blue;fg=white> HOOK </> %s', $hookName);
102103
}
103104
}

0 commit comments

Comments
 (0)