-
Notifications
You must be signed in to change notification settings - Fork 102
Reworked FileSystemProvider #557
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Qodana for JVM395 new problems were found
@@ Code coverage @@
+ 68% total lines covered
8868 lines analyzed, 6043 lines covered
# Calculated according to the filters of your coverage tool ☁️ View the detailed Qodana report Contact Qodana teamContact us at [email protected]
|
@@ -44,8 +44,18 @@ public object FileSystemProvider { | |||
* @return The resolved path object. | |||
* @throws IllegalArgumentException if [path] is an absolute path. | |||
*/ | |||
@Deprecated("Use joinPath instead", ReplaceWith("joinPath(base, path)")) | |||
public fun fromRelativeString(base: Path, path: String): Path |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I took a quick look at its usage and don't see it anywhere (IJ, JVM), but maybe missed something. Why don't we just replace it right away?
@@ -134,8 +144,19 @@ public object FileSystemProvider { | |||
* @throws IllegalArgumentException if the path doesn't exist or isn't a regular file. | |||
* @throws IOException if an I/O error occurs during reading. | |||
*/ | |||
@Deprecated("Use readBytes instead", ReplaceWith("readBytes(path)")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same for this one. Here only the name has changed.
rag/rag-base/src/commonMain/kotlin/ai/koog/rag/base/files/FileSystemProvider.kt
Show resolved
Hide resolved
rag/rag-base/src/jvmMain/kotlin/ai/koog/rag/base/files/JVMFileSystemProvider.kt
Outdated
Show resolved
Hide resolved
rag/rag-base/src/jvmMain/kotlin/ai/koog/rag/base/files/JVMFileSystemProvider.kt
Outdated
Show resolved
Hide resolved
rag/rag-base/src/jvmMain/kotlin/ai/koog/rag/base/files/JVMFileSystemProvider.kt
Outdated
Show resolved
Hide resolved
rag/rag-base/src/jvmMain/kotlin/ai/koog/rag/base/files/JVMFileSystemProvider.kt
Outdated
Show resolved
Hide resolved
rag/rag-base/src/jvmMain/kotlin/ai/koog/rag/base/files/JVMFileSystemProvider.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@skarpovdev please let me know if you have more comments about the current state. If no, I'll remove deprecated methods
rag/rag-base/src/jvmMain/kotlin/ai/koog/rag/base/files/JVMFileSystemProvider.kt
Outdated
Show resolved
Hide resolved
rag/rag-base/src/jvmMain/kotlin/ai/koog/rag/base/files/JVMFileSystemProvider.kt
Outdated
Show resolved
Hide resolved
rag/rag-base/src/jvmMain/kotlin/ai/koog/rag/base/files/JVMFileSystemProvider.kt
Outdated
Show resolved
Hide resolved
rag/rag-base/src/jvmMain/kotlin/ai/koog/rag/base/files/JVMFileSystemProvider.kt
Outdated
Show resolved
Hide resolved
rag/rag-base/src/jvmMain/kotlin/ai/koog/rag/base/files/JVMFileSystemProvider.kt
Outdated
Show resolved
Hide resolved
* @see [FileSystemProvider.ReadWrite.create] | ||
*/ | ||
public suspend fun <Path> FileSystemProvider.ReadWrite<Path>.createFile(path: Path) { | ||
create(path, FileMetadata.FileType.File) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT: createFile()
and createDirectory()
can still throw IOException
if the path already exists (originates from the 2-arg create
). Might be worth adding that to their KDocs for clarity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not put any details in this file intentionally and put see-references instead so there is no need to copy everything, let's see how it goes
@sproshev No more comments from me at this point, thanks for the quick fixes! |
and fixed typo in mockFileSystemProvicer
e51fc82
to
c27e41c
Compare
Type of the change
Checklist for all pull requests
develop
as the base branchAdditional steps for pull requests adding a new feature