Skip to content

Commit

Permalink
Avoid changing baseline only due to newline removal
Browse files Browse the repository at this point in the history
  • Loading branch information
VasekPurchart committed Apr 25, 2022
1 parent a7bb725 commit c539f1f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Command/AnalyseCommand.php
Expand Up @@ -303,7 +303,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int

$currentBaselineContents = is_file($generateBaselineFile) ? FileReader::read($generateBaselineFile) : '';

if ($baselineContents !== $currentBaselineContents) {
if (
$baselineContents !== $currentBaselineContents
&& $baselineContents . "\n" !== $currentBaselineContents // baseline used to have 2 newlines at the end of file
) {
try {
FileWriter::write($generateBaselineFile, $baselineContents);
} catch (CouldNotWriteFileException $e) {
Expand Down

0 comments on commit c539f1f

Please sign in to comment.