@@ -47,6 +47,7 @@ public function __construct(readonly string $directoryToAnalyse)
4747 ['id ' => 'cli-phar ' , 'summary ' => 'Distribute CLI/TUI binaries via PHAR. ' , 'status ' => ViolationStatus::Irrelevant],
4848 ['id ' => 'composer-scripts ' , 'summary ' => 'Utilise Composer scripts. ' , 'status ' => ViolationStatus::False],
4949 ['id ' => 'eol-php ' , 'summary ' => 'Use a supported PHP version. ' , 'status ' => ViolationStatus::False],
50+ ['id ' => 'peck ' , 'summary ' => 'Utilise Peck for detecting spelling mistakes. ' , 'status ' => ViolationStatus::False],
5051 ];
5152
5253 $ this ->stepIds = Arr::pluck ($ this ->steps , 'id ' );
@@ -123,6 +124,9 @@ public function analyse(array $stepsToOmit): int
123124 case 'vcs ' :
124125 $ this ->alternateStepStatus ('vcs ' , $ this ->checkVcsExistence (), $ stepsToOmit );
125126 break ;
127+ case 'peck ' :
128+ $ this ->alternateStepStatus ('peck ' , $ this ->checkPeckExistence (), $ stepsToOmit );
129+ break ;
126130 case 'cli-binary ' :
127131 $ this ->alternateStepStatus ('cli-binary ' , $ this ->checkCliBinaryDirectoryExistence (), $ stepsToOmit );
128132 break ;
@@ -326,6 +330,19 @@ private function checkVcsExistence(): ViolationStatus
326330 return ViolationStatus::False;
327331 }
328332
333+ private function checkPeckExistence (): ViolationStatus
334+ {
335+ $ finder = new Finder ;
336+ $ finder ->ignoreDotFiles (false );
337+ $ finder ->ignoreVCS (false );
338+
339+ if ($ finder ->depth (0 )->path ('vendor/bin ' )->in ($ this ->directoryToAnalyse )->contains ('peck ' )) {
340+ return ViolationStatus::True;
341+ }
342+
343+ return ViolationStatus::False;
344+ }
345+
329346 public function getDirectoryToAnalyse (): string
330347 {
331348 return $ this ->directoryToAnalyse ;
0 commit comments