Skip to content

Conversation

@AdrianEpi
Copy link
Owner

Description

New File Manager module

Changes

  • New module that allows the user to create, delete, move, and read files easier

This pull request includes several changes across multiple files, primarily focusing on adding a new FileManager class, updating the ErrorHandler class, and adding tests for the FileManager class.

New functionality:

  • modules/files/file_manager.py: Introduced a new FileManager class with static methods for file operations such as checking existence, creating, deleting, moving, copying, reading, and adding lines to files.

Updates to existing functionality:

  • modules/errors/error_handler.py: Modified the log_error method in the ErrorHandler class to accept None as a valid type for the error_message parameter and added a check to ensure the error_message is not empty before logging.

Testing improvements:

  • tests/test_file_manager.py: Added a new test file for the FileManager class, covering various file operations to ensure they work as expected.
  • tests/test_date.py: Updated the description to specify that the tests are for modules/datetime/date.py.
  • tests/tmp/sample.txt: Added a placeholder file to ensure the test directory structure remains intact.

@AdrianEpi AdrianEpi added the enhancement New feature or request label Mar 29, 2025
@AdrianEpi AdrianEpi requested a review from Copilot March 29, 2025 09:20
@AdrianEpi AdrianEpi self-assigned this Mar 29, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request introduces a new FileManager module to simplify file operations, updates error logging to support nullable error messages, and enhances test coverage for these features.

  • Added a new FileManager class with methods to check existence, create, delete, move, copy, and read files, as well as to append lines.
  • Updated the ErrorHandler class to accept None for error messages and improved error logging.
  • Added multiple tests in test_file_manager.py and updated test_date.py for clarity and structural integrity.

Reviewed Changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated no comments.

File Description
tests/test_file_manager.py Added tests for file operations and temporary file validation.
tests/test_date.py Updated metadata comments for clarity.
modules/files/file_manager.py Introduced file operations functionality with static methods.
modules/errors/error_handler.py Modified log_error to accept None for error_message.
Files not reviewed (1)
  • tests/tmp/sample.txt: Language not supported

@AdrianEpi AdrianEpi linked an issue Mar 29, 2025 that may be closed by this pull request
@AdrianEpi AdrianEpi merged commit cb20095 into master Mar 29, 2025
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create a File Manager Module

2 participants