Skip to content

Small enhancements for IO file sys operations#67

Merged
darthsharp merged 3 commits into
mainfrom
feature/smallfilesysenhancements
Dec 26, 2025
Merged

Small enhancements for IO file sys operations#67
darthsharp merged 3 commits into
mainfrom
feature/smallfilesysenhancements

Conversation

@darthsharp

Copy link
Copy Markdown
Contributor

No description provided.

…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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces small enhancements for IO file system operations by adding utility extension methods and dependency injection support.

  • Added DirectoryExtensions with methods to ensure directories exist before operations
  • Added IOServiceCollectionExtensions for registering file system abstractions in DI containers
  • Fixed nullable reference warnings in EnumerableStringExtensions with 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.

Comment thread source/Core/CreativeCoders.Core/IO/IOServiceCollectionExtensions.cs
@darthsharp darthsharp merged commit ea4a6ce into main Dec 26, 2025
12 checks passed
@darthsharp darthsharp deleted the feature/smallfilesysenhancements branch December 26, 2025 13:49
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.

2 participants