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

Use .jlt instead of .jl for template files #481

Merged
merged 2 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@

"""
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 @@
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 @@
# 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")

Check warning on line 114 in src/plugins/documenter.jl

View check run for this annotation

Codecov / codecov/patch

src/plugins/documenter.jl#L114

Added line #L114 was not covered by tests
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
Loading