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

Do not truncate ".jl" from generated package directory #421

Merged
merged 7 commits into from
Aug 29, 2023
Merged

Do not truncate ".jl" from generated package directory #421

merged 7 commits into from
Aug 29, 2023

Conversation

hannahilea
Copy link
Contributor

Fixes #353.

Probably non-breaking, as I don't see it explicitly documented anywhere that a ".jl" suffix would be removed when generating a package.

Updated approach respects user input: Template("MyPkg.jl") will create directory "MyPkg.jl", while Template("MyPkg") will generate directory "MyPkg". Contents of these two packages will be otherwise identical.

@codecov
Copy link

codecov bot commented Aug 28, 2023

Codecov Report

Merging #421 (5666744) into master (fd9aedf) will decrease coverage by 21.73%.
The diff coverage is 88.88%.

@@             Coverage Diff             @@
##           master     #421       +/-   ##
===========================================
- Coverage   93.58%   71.86%   -21.73%     
===========================================
  Files          23       23               
  Lines         686      686               
===========================================
- Hits          642      493      -149     
- Misses         44      193      +149     
Files Changed Coverage Δ
src/plugins/codeowners.jl 0.00% <0.00%> (-87.50%) ⬇️
src/plugins/project_file.jl 82.35% <ø> (-11.77%) ⬇️
src/template.jl 84.49% <ø> (-13.20%) ⬇️
src/plugin.jl 98.46% <100.00%> (+0.07%) ⬆️
src/plugins/documenter.jl 70.27% <100.00%> (-17.57%) ⬇️
src/plugins/git.jl 88.70% <100.00%> (-4.84%) ⬇️
src/plugins/src_dir.jl 100.00% <100.00%> (ø)

... and 11 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Collaborator

@nickrobinson251 nickrobinson251 left a comment

Choose a reason for hiding this comment

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

thanks!

src/plugin.jl Outdated Show resolved Hide resolved
"""
function pkg_name_from_pkg_dir(pkg_dir::AbstractString)
pkg = basename(pkg_dir)
return endswith(pkg, ".jl") ? pkg[1:end-3] : pkg
Copy link
Collaborator

Choose a reason for hiding this comment

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

we could use chopsuffix (but idk what Julia version that was introduced in, so maybe we can't)

Suggested change
return endswith(pkg, ".jl") ? pkg[1:end-3] : pkg
return chopsuffix(pkg, ".jl")

Copy link
Contributor Author

Choose a reason for hiding this comment

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

TIL! Looks like it shows up in 1.8...

@nickrobinson251 nickrobinson251 merged commit 2c1b526 into JuliaCI:master Aug 29, 2023
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.

Hope Name generated dir MyPkg.jl rather than MyPkg
2 participants