Skip to content
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

Support join and sort kwargs to both readdir and readpath #152

Merged
merged 2 commits into from
Nov 18, 2021

Conversation

rofinn
Copy link
Owner

@rofinn rofinn commented Nov 18, 2021

Closes #110

julia> using FilePathsBase

julia> readdir(cwd())
12-element Vector{String}:
 ".DS_Store"
 ".git"
 ".github"
 ".gitignore"
 "LICENSE.md"
 "Manifest.toml"
 "Project.toml"
 "README.md"
 "docs"
 "foo.txt"
 "src"
 "test"

julia> readdir(cwd(); join=true)
12-element Vector{String}:
 "/Users/rory/repos/FilePathsBase.jl/.DS_Store"
 "/Users/rory/repos/FilePathsBase.jl/.git"
 "/Users/rory/repos/FilePathsBase.jl/.github"
 "/Users/rory/repos/FilePathsBase.jl/.gitignore"
 "/Users/rory/repos/FilePathsBase.jl/LICENSE.md"
 "/Users/rory/repos/FilePathsBase.jl/Manifest.toml"
 "/Users/rory/repos/FilePathsBase.jl/Project.toml"
 "/Users/rory/repos/FilePathsBase.jl/README.md"
 "/Users/rory/repos/FilePathsBase.jl/docs"
 "/Users/rory/repos/FilePathsBase.jl/foo.txt"
 "/Users/rory/repos/FilePathsBase.jl/src"
 "/Users/rory/repos/FilePathsBase.jl/test"

julia> readpath(cwd())
12-element Vector{PosixPath}:
 p"/Users/rory/repos/FilePathsBase.jl/.DS_Store"
 p"/Users/rory/repos/FilePathsBase.jl/.git"
 p"/Users/rory/repos/FilePathsBase.jl/.github"
 p"/Users/rory/repos/FilePathsBase.jl/.gitignore"
 p"/Users/rory/repos/FilePathsBase.jl/LICENSE.md"
 p"/Users/rory/repos/FilePathsBase.jl/Manifest.toml"
 p"/Users/rory/repos/FilePathsBase.jl/Project.toml"
 p"/Users/rory/repos/FilePathsBase.jl/README.md"
 p"/Users/rory/repos/FilePathsBase.jl/docs"
 p"/Users/rory/repos/FilePathsBase.jl/foo.txt"
 p"/Users/rory/repos/FilePathsBase.jl/src"
 p"/Users/rory/repos/FilePathsBase.jl/test"

julia> readpath(cwd(); join=false)
12-element Vector{PosixPath}:
 p".DS_Store"
 p".git"
 p".github"
 p".gitignore"
 p"LICENSE.md"
 p"Manifest.toml"
 p"Project.toml"
 p"README.md"
 p"docs"
 p"foo.txt"
 p"src"
 p"test"

The defaults maintain the current no-kwarg behaviour and type stability. We may unify readpath and readdir in the future now that readdir can do what we wanted readpath for. However, that would be a breaking release.

@codecov
Copy link

codecov bot commented Nov 18, 2021

Codecov Report

Merging #152 (0639b4b) into master (6f003d8) will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #152      +/-   ##
==========================================
+ Coverage   91.88%   91.91%   +0.02%     
==========================================
  Files          12       12              
  Lines        1208     1212       +4     
==========================================
+ Hits         1110     1114       +4     
  Misses         98       98              
Impacted Files Coverage Δ
src/path.jl 87.90% <100.00%> (+0.16%) ⬆️
src/system.jl 92.46% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6f003d8...0639b4b. Read the comment docs.

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.

Add join and sort keywords to readdir/readpath
1 participant