Small enhancements for IO file sys operations#67
Merged
Conversation
…ster file system services - Introduced `DirectoryExtensions` with methods for ensuring directory existence. - Added `IOServiceCollectionExtensions` to enable dependency injection for file system abstractions.
…on logic - Introduced comprehensive tests for `EnsureDirectoryExists` and `EnsureDirectoryForFileNameExists`. - Covered edge cases for null, empty, and whitespace paths.
… null-forgiving operator usage in `ToDictionary` method
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces small enhancements for IO file system operations by adding utility extension methods and dependency injection support.
- Added
DirectoryExtensionswith methods to ensure directories exist before operations - Added
IOServiceCollectionExtensionsfor registering file system abstractions in DI containers - Fixed nullable reference warnings in
EnumerableStringExtensionswith null-forgiving operators
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| source/Core/CreativeCoders.Core/IO/DirectoryExtensions.cs | New extension methods EnsureDirectoryExists and EnsureDirectoryForFileNameExists for safely creating directories |
| source/Core/CreativeCoders.Core/IO/IOServiceCollectionExtensions.cs | New DI registration method AddFileSystem to register IFileSystem and IFileSystemEx as singletons |
| tests/CreativeCoders.Core.UnitTests/IO/DirectoryExtensionsTests.cs | Comprehensive unit tests for the new directory extension methods covering valid paths, null/empty inputs, and edge cases |
| source/Core/CreativeCoders.Core/Text/EnumerableStringExtensions.cs | Added null-forgiving operators and SuppressMessage attribute to resolve nullable reference warnings in ToDictionary method |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.