Skip to content

Automatically delete orphaned baseline files#53

Merged
JanTvrdik merged 1 commit into
masterfrom
auto-delete-orphaned-baselines
Dec 8, 2025
Merged

Automatically delete orphaned baseline files#53
JanTvrdik merged 1 commit into
masterfrom
auto-delete-orphaned-baselines

Conversation

@JanTvrdik
Copy link
Copy Markdown
Member

Summary

  • The split-phpstan-baseline command now automatically deletes baseline files that no longer have corresponding errors
  • This eliminates the need for the manual find baselines/ -type f -not -name _loader.neon -delete step
  • The deletion is extension-aware: only files with the same extension as the loader are deleted

Test plan

  • Added testOrphanedFilesAreDeleted - verifies baseline files for removed identifiers are deleted
  • Added testLoaderFileIsNotDeleted - verifies the loader file is never deleted
  • Added testOnlyFilesWithMatchingExtensionAreDeleted - verifies only matching extensions are deleted
  • All existing tests pass
  • PHPStan analysis passes
  • Coding standards pass

@JanTvrdik JanTvrdik requested a review from janedbal December 8, 2025 10:37
@JanTvrdik JanTvrdik force-pushed the auto-delete-orphaned-baselines branch from 3deba8d to 35e4be5 Compare December 8, 2025 10:40
Comment thread tests/SplitterTest.php Outdated
The split-phpstan-baseline command now automatically deletes baseline files
that no longer have corresponding errors in the generated baseline. This
eliminates the need for the manual `find baselines/ -type f -not -name
_loader.neon -delete` step before running the splitter.

The deletion is extension-aware: only files with the same extension as the
loader file are considered for deletion (e.g., .neon files when using a
.neon loader).
@JanTvrdik JanTvrdik force-pushed the auto-delete-orphaned-baselines branch from 35e4be5 to 547d79f Compare December 8, 2025 10:44
@JanTvrdik JanTvrdik merged commit b997803 into master Dec 8, 2025
15 checks passed
@JanTvrdik JanTvrdik deleted the auto-delete-orphaned-baselines branch December 8, 2025 10:45
@staabm
Copy link
Copy Markdown
Contributor

staabm commented Dec 8, 2025

awesome, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants