Skip to content

Commit

Permalink
Use .jlt instead of .jl for template files (#481)
Browse files Browse the repository at this point in the history
* Use .jlt instead of .jl for template files

This patch changes the file extension of Julia template files from .jl
to .jlt. The motivation for this is tooling that assume these are
(valid) julia source files based on the .jl extension.

* Set version to 0.7.52.
  • Loading branch information
fredrikekre authored Sep 10, 2024
1 parent a007c9e commit 6cb59aa
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "PkgTemplates"
uuid = "14b8a8f1-9102-5b29-a752-f990bacb7fe1"
authors = ["Chris de Graaf", "Invenia Technical Computing Corporation"]
version = "0.7.51"
version = "0.7.52"

[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Expand Down
4 changes: 2 additions & 2 deletions docs/src/developer.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ To understand how they're implemented, let's look at simplified versions of two

```julia
@plugin struct Documenter <: Plugin
make_jl::String = default_file("docs", "make.jl")
make_jl::String = default_file("docs", "make.jlt")
index_md::String = default_file("docs", "src", "index.md")
end

Expand Down Expand Up @@ -306,7 +306,7 @@ The plugin implements its own `hook`, but uses `invoke` to avoid duplicating the

```julia
@plugin struct Tests <: FilePlugin
file::String = default_file("runtests.jl")
file::String = default_file("runtests.jlt")
end

source(p::Tests) = p.file
Expand Down
6 changes: 3 additions & 3 deletions src/plugins/documenter.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ end

"""
Documenter{T}(;
make_jl="$(contractuser(default_file("docs", "make.jl")))",
make_jl="$(contractuser(default_file("docs", "make.jlt")))",
index_md="$(contractuser(default_file("docs", "src", "index.md")))",
assets=String[],
logo=Logo(),
Expand Down Expand Up @@ -89,7 +89,7 @@ function Documenter{T}(;
logo::Logo=Logo(),
makedocs_kwargs::Dict{Symbol}=Dict{Symbol, Any}(),
canonical_url::Union{Function, Nothing}=make_canonical(T),
make_jl::AbstractString=default_file("docs", "make.jl"),
make_jl::AbstractString=default_file("docs", "make.jlt"),
index_md::AbstractString=default_file("docs", "src", "index.md"),
devbranch::Union{AbstractString, Nothing}=nothing,
edit_link::Union{AbstractString, Symbol, Nothing}=:devbranch,
Expand All @@ -111,7 +111,7 @@ Documenter(; kwargs...) = Documenter{NoDeploy}(; kwargs...)
# We have to define these manually because we didn't use @plugin.
defaultkw(::Type{<:Documenter}, ::Val{:assets}) = String[]
defaultkw(::Type{<:Documenter}, ::Val{:logo}) = Logo()
defaultkw(::Type{<:Documenter}, ::Val{:make_jl}) = default_file("docs", "make.jl")
defaultkw(::Type{<:Documenter}, ::Val{:make_jl}) = default_file("docs", "make.jlt")
defaultkw(::Type{<:Documenter}, ::Val{:index_md}) = default_file("docs", "src", "index.md")
defaultkw(::Type{<:Documenter}, ::Val{:devbranch}) = nothing
defaultkw(::Type{<:Documenter}, ::Val{:edit_link}) = :devbranch
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/pkgbenchmark.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
PkgBenchmark(; file="$(contractuser(default_file("benchmark", "benchmarks.jl")))")
PkgBenchmark(; file="$(contractuser(default_file("benchmark", "benchmarks.jlt")))")
Sets up a [PkgBenchmark.jl](https://github.com/JuliaCI/PkgBenchmark.jl) benchmark suite.
Expand All @@ -13,7 +13,7 @@ In this environment, you should at the very least:
- `file::AbstractString`: Template file for `benchmarks.jl`.
"""
@plugin struct PkgBenchmark <: FilePlugin
file::String = default_file("benchmark", "benchmarks.jl")
file::String = default_file("benchmark", "benchmarks.jlt")
end

source(p::PkgBenchmark) = p.file
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/src_dir.jl
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
"""
SrcDir(; file="$(contractuser(default_file("src", "module.jl")))")
SrcDir(; file="$(contractuser(default_file("src", "module.jlt")))")
Creates a module entrypoint.
## Keyword Arguments
- `file::AbstractString`: Template file for `src/<module>.jl`.
"""
@plugin mutable struct SrcDir <: FilePlugin
file::String = default_file("src", "module.jl")
file::String = default_file("src", "module.jlt")
destination::String = ""
end

Expand Down
4 changes: 2 additions & 2 deletions src/plugins/tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const JET_DEP = PackageSpec(; name="JET", uuid=JET_UUID)

"""
Tests(;
file="$(contractuser(default_file("test", "runtests.jl")))",
file="$(contractuser(default_file("test", "runtests.jlt")))",
project=false,
aqua=false,
aqua_kwargs=NamedTuple(),
Expand All @@ -32,7 +32,7 @@ Sets up testing for packages.
in Julia 1.2 and later.
"""
@plugin struct Tests <: FilePlugin
file::String = default_file("test", "runtests.jl")
file::String = default_file("test", "runtests.jlt")
project::Bool = false
aqua::Bool = false
aqua_kwargs::NamedTuple = NamedTuple()
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions test/show.jl
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ end
badge_order: DataType[Documenter{GitHubActions}, Documenter{GitLabCI}, Documenter{TravisCI}, GitHubActions, GitLabCI, TravisCI, AppVeyor, DroneCI, CirrusCI, Codecov, Coveralls, BlueStyleBadge, ColPracBadge, PkgEvalBadge]
badge_off: DataType[]
SrcDir:
file: "$(joinpath(TEMPLATES_DIR, "src", "module.jl"))"
file: "$(joinpath(TEMPLATES_DIR, "src", "module.jlt"))"
TagBot:
file: "$(joinpath(TEMPLATES_DIR, "github", "workflows", "TagBot.yml"))"
destination: "TagBot.yml"
Expand All @@ -88,7 +88,7 @@ end
dispatch: nothing
dispatch_delay: nothing
Tests:
file: "$(joinpath(TEMPLATES_DIR, "test", "runtests.jl"))"
file: "$(joinpath(TEMPLATES_DIR, "test", "runtests.jlt"))"
project: false
aqua: false
aqua_kwargs: NamedTuple()
Expand Down

2 comments on commit 6cb59aa

@fredrikekre
Copy link
Member Author

Choose a reason for hiding this comment

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

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Registration pull request created: JuliaRegistries/General/114943

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.7.52 -m "<description of version>" 6cb59aab9ec9d92ab51c5276ad42b47e4becb78d
git push origin v0.7.52

Please sign in to comment.