Repository: JuliaCI/PkgTemplates.jl Branch: master Commit: aaf2a16fc74b Files: 182 Total size: 405.7 KB Directory structure: gitextract_vcepmtte/ ├── .gitattributes ├── .github/ │ ├── dependabot.yml │ └── workflows/ │ ├── CI.yml │ ├── JuliaNightly.yml │ └── TagBot.yml ├── .gitignore ├── LICENSE ├── Project.toml ├── README.md ├── docs/ │ ├── Project.toml │ ├── make.jl │ └── src/ │ ├── developer.md │ ├── index.md │ ├── migrating.md │ └── user.md ├── src/ │ ├── PkgTemplates.jl │ ├── deprecated.jl │ ├── interactive.jl │ ├── plugin.jl │ ├── plugins/ │ │ ├── badges.jl │ │ ├── ci.jl │ │ ├── citation.jl │ │ ├── codeowners.jl │ │ ├── compat_helper.jl │ │ ├── coverage.jl │ │ ├── dependabot.jl │ │ ├── develop.jl │ │ ├── documenter.jl │ │ ├── formatter.jl │ │ ├── git.jl │ │ ├── license.jl │ │ ├── pkgbenchmark.jl │ │ ├── project_file.jl │ │ ├── readme.jl │ │ ├── register.jl │ │ ├── src_dir.jl │ │ ├── tagbot.jl │ │ └── tests.jl │ ├── show.jl │ └── template.jl ├── templates/ │ ├── .JuliaFormatter.toml │ ├── CITATION.bib │ ├── README.md │ ├── appveyor.yml │ ├── benchmark/ │ │ └── benchmarks.jlt │ ├── cirrus.yml │ ├── docs/ │ │ ├── make.jlt │ │ └── src/ │ │ └── index.md │ ├── drone.star │ ├── github/ │ │ ├── dependabot.yml │ │ └── workflows/ │ │ ├── CI.yml │ │ ├── CompatHelper.yml │ │ ├── Register.yml │ │ └── TagBot.yml │ ├── gitlab-ci.yml │ ├── licenses/ │ │ ├── AGPL-3.0-or-later │ │ ├── Apache-2.0 │ │ ├── BSD-2-Clause │ │ ├── BSD-3-Clause │ │ ├── EUPL-1.2 │ │ ├── GPL-2.0-or-later │ │ ├── GPL-3.0-or-later │ │ ├── ISC │ │ ├── LGPL-2.1-or-later │ │ ├── LGPL-3.0-or-later │ │ ├── MIT │ │ └── MPL-2.0 │ ├── src/ │ │ └── module.jlt │ ├── test/ │ │ └── runtests.jlt │ └── travis.yml └── test/ ├── fixtures/ │ ├── AllPlugins/ │ │ ├── .JuliaFormatter.toml │ │ ├── .appveyor.yml │ │ ├── .cirrus.yml │ │ ├── .drone.star │ │ ├── .github/ │ │ │ ├── dependabot.yml │ │ │ └── workflows/ │ │ │ ├── CI.yml │ │ │ ├── CompatHelper.yml │ │ │ ├── Register.yml │ │ │ └── TagBot.yml │ │ ├── .gitignore │ │ ├── .gitlab-ci.yml │ │ ├── .travis.yml │ │ ├── CITATION.bib │ │ ├── CODEOWNERS │ │ ├── LICENSE │ │ ├── Manifest.toml │ │ ├── Project.toml │ │ ├── README.md │ │ ├── benchmark/ │ │ │ └── benchmarks.jl │ │ ├── docs/ │ │ │ ├── Manifest.toml │ │ │ ├── Project.toml │ │ │ ├── make.jl │ │ │ └── src/ │ │ │ └── index.md │ │ ├── src/ │ │ │ └── AllPlugins.jl │ │ └── test/ │ │ └── runtests.jl │ ├── Basic/ │ │ ├── .github/ │ │ │ ├── dependabot.yml │ │ │ └── workflows/ │ │ │ ├── CI.yml │ │ │ └── TagBot.yml │ │ ├── .gitignore │ │ ├── LICENSE │ │ ├── Manifest.toml │ │ ├── Project.toml │ │ ├── README.md │ │ ├── src/ │ │ │ └── Basic.jl │ │ └── test/ │ │ └── runtests.jl │ ├── DocumenterGitHubActions/ │ │ ├── .github/ │ │ │ ├── dependabot.yml │ │ │ └── workflows/ │ │ │ ├── CI.yml │ │ │ └── TagBot.yml │ │ ├── .gitignore │ │ ├── LICENSE │ │ ├── Project.toml │ │ ├── README.md │ │ ├── docs/ │ │ │ ├── Manifest.toml │ │ │ ├── Project.toml │ │ │ ├── make.jl │ │ │ └── src/ │ │ │ └── index.md │ │ ├── src/ │ │ │ └── DocumenterGitHubActions.jl │ │ └── test/ │ │ └── runtests.jl │ ├── DocumenterGitLabCI/ │ │ ├── .github/ │ │ │ ├── dependabot.yml │ │ │ └── workflows/ │ │ │ ├── CI.yml │ │ │ └── TagBot.yml │ │ ├── .gitignore │ │ ├── .gitlab-ci.yml │ │ ├── LICENSE │ │ ├── Project.toml │ │ ├── README.md │ │ ├── docs/ │ │ │ ├── Manifest.toml │ │ │ ├── Project.toml │ │ │ ├── make.jl │ │ │ └── src/ │ │ │ └── index.md │ │ ├── src/ │ │ │ └── DocumenterGitLabCI.jl │ │ └── test/ │ │ └── runtests.jl │ ├── DocumenterTravis/ │ │ ├── .github/ │ │ │ ├── dependabot.yml │ │ │ └── workflows/ │ │ │ ├── CI.yml │ │ │ └── TagBot.yml │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── Project.toml │ │ ├── README.md │ │ ├── docs/ │ │ │ ├── Manifest.toml │ │ │ ├── Project.toml │ │ │ ├── make.jl │ │ │ └── src/ │ │ │ └── index.md │ │ ├── src/ │ │ │ └── DocumenterTravis.jl │ │ └── test/ │ │ └── runtests.jl │ ├── WackyOptions/ │ │ ├── .JuliaFormatter.toml │ │ ├── .appveyor.yml │ │ ├── .cirrus.yml │ │ ├── .codecov.yml │ │ ├── .coveralls.yml │ │ ├── .drone.star │ │ ├── .github/ │ │ │ ├── dependabot.yml │ │ │ └── workflows/ │ │ │ ├── CI.yml │ │ │ ├── CompatHelper.yml │ │ │ ├── Register.yml │ │ │ └── TagBot.yml │ │ ├── .gitignore │ │ ├── .gitlab-ci.yml │ │ ├── .travis.yml │ │ ├── CITATION.bib │ │ ├── CODEOWNERS │ │ ├── LICENSE │ │ ├── Manifest.toml │ │ ├── Project.toml │ │ ├── README.md │ │ ├── docs/ │ │ │ ├── Manifest.toml │ │ │ ├── Project.toml │ │ │ ├── make.jl │ │ │ └── src/ │ │ │ ├── assets/ │ │ │ │ └── static.txt │ │ │ └── index.md │ │ ├── src/ │ │ │ └── WackyOptions.jl │ │ └── test/ │ │ ├── Project.toml │ │ └── runtests.jl │ └── static.txt ├── git.jl ├── interactive.jl ├── plugin.jl ├── reference.jl ├── runtests.jl ├── show.jl └── template.jl ================================================ FILE CONTENTS ================================================ ================================================ FILE: .gitattributes ================================================ * eol=lf *.png -text ================================================ FILE: .github/dependabot.yml ================================================ # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates version: 2 updates: - package-ecosystem: "github-actions" directory: "/" schedule: interval: "weekly" # To group all GitHub Actions updates into a single PR, uncomment the following: # groups: # github-actions: # patterns: # - "*" - package-ecosystem: "julia" directories: - "/" - "/docs" - "/test" schedule: interval: "weekly" # To group all Julia dependency updates into a single PR, uncomment the following: # groups: # julia-dependencies: # patterns: # - "*" ================================================ FILE: .github/workflows/CI.yml ================================================ name: CI # Run on master, tags, or any pull request on: schedule: - cron: '0 2 * * *' # Daily at 2 AM UTC (8 PM CST) push: branches: [master] tags: ["*"] pull_request: concurrency: # Skip intermediate builds: always. # Cancel intermediate builds: only if it is a pull request build. group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} jobs: test: name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: version: - "1.0" # LTS - "1.7" # interactive tests require <= 1.8 - "1" # Latest Release os: - ubuntu-latest - macOS-latest - windows-latest arch: - x64 - x86 exclude: # Test 32-bit only on Linux - os: macOS-latest arch: x86 - os: windows-latest arch: x86 include: # Add specific version used to run the reference tests. # Must be kept in sync with version check in `test/runtests.jl`, # and with the branch protection rules on the repository which # require this specific job to pass on all PRs # (see Settings > Branches > Branch protection rules). - os: ubuntu-latest version: 1.10.6 arch: x64 steps: - uses: actions/checkout@v6 - uses: julia-actions/setup-julia@v2 with: version: ${{ matrix.version }} arch: ${{ matrix.arch }} - uses: actions/cache@v5 env: cache-name: cache-artifacts with: path: ~/.julia/artifacts key: ${{ runner.os }}-${{ matrix.arch }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} restore-keys: | ${{ runner.os }}-${{ matrix.arch }}-test-${{ env.cache-name }}- ${{ runner.os }}-${{ matrix.arch }}-test- ${{ runner.os }}-${{ matrix.arch }}- ${{ runner.os }}- - uses: julia-actions/julia-buildpkg@latest - run: | git config --global user.name Tester git config --global user.email te@st.er - uses: julia-actions/julia-runtest@latest - uses: julia-actions/julia-processcoverage@v1 - uses: codecov/codecov-action@v5 with: files: lcov.info token: ${{ secrets.CODECOV_TOKEN }} fail_ci_if_error: false docs: name: Documentation runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - uses: julia-actions/setup-julia@v2 with: version: '1' - run: | git config --global user.name name git config --global user.email email git config --global github.user username - run: | julia --project=docs -e ' using Pkg Pkg.develop(PackageSpec(path=pwd())) Pkg.instantiate()' - run: | julia --project=docs -e ' using Documenter: doctest using PkgTemplates doctest(PkgTemplates)' - run: julia --project=docs docs/make.jl env: JULIA_PKG_SERVER: "" GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} ================================================ FILE: .github/workflows/JuliaNightly.yml ================================================ name: JuliaNightly # Nightly Scheduled Julia Nightly Run on: schedule: - cron: '0 2 * * *' # Daily at 2 AM UTC (8 PM CST) jobs: test: name: Julia Nightly - Ubuntu - x64 runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - uses: julia-actions/setup-julia@v2 with: version: nightly arch: x64 - uses: actions/cache@v5 env: cache-name: julia-nightly-cache-artifacts with: path: ~/.julia/artifacts key: ${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} restore-keys: | ${{ env.cache-name }}- - uses: julia-actions/julia-buildpkg@latest - run: | git config --global user.name Tester git config --global user.email te@st.er - uses: julia-actions/julia-runtest@latest - uses: julia-actions/julia-processcoverage@v1 - uses: codecov/codecov-action@v5 with: files: lcov.info ================================================ FILE: .github/workflows/TagBot.yml ================================================ name: TagBot on: issue_comment: types: - created workflow_dispatch: jobs: TagBot: if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot' runs-on: ubuntu-latest steps: - uses: JuliaRegistries/TagBot@v1 with: token: ${{ secrets.GITHUB_TOKEN }} ssh: ${{ secrets.DOCUMENTER_KEY }} ================================================ FILE: .gitignore ================================================ /docs/build/ *.jl.*.cov *.jl.cov *.jl.mem /Manifest*.toml /test/fixtures/*/test/Manifest*.toml /docs/Manifest*.toml ================================================ FILE: LICENSE ================================================ MIT License Copyright (c) 2017-2020 Chris de Graaf, Invenia Technical Computing Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: Project.toml ================================================ name = "PkgTemplates" uuid = "14b8a8f1-9102-5b29-a752-f990bacb7fe1" authors = ["Chris de Graaf", "Invenia Technical Computing Corporation"] version = "0.7.61" [deps] Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240" LibGit2 = "76f85450-5226-5b5a-8eaa-529ad045b433" Mocking = "78c3b35d-d492-501b-9361-3d52fe80e533" Mustache = "ffc61752-8dc7-55ee-8c37-f3e9cdd09e70" Parameters = "d96e819e-fc66-5662-9728-84c9c7592b0a" Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" REPL = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" [compat] Dates = "<0.0.1, 1" InteractiveUtils = "<0.0.1, 1" LibGit2 = "<0.0.1, 1" Mocking = "0.7, 0.8" Mustache = "1" Parameters = "0.12" Pkg = "<0.0.1, 1" REPL = "<0.0.1, 1" UUIDs = "<0.0.1, 1" julia = "1" [extras] DeepDiffs = "ab62b9b5-e342-54a8-a765-a90f495de1a6" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" Suppressor = "fd094767-a336-5f1f-9728-57cf17d0bbfb" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [targets] test = ["DeepDiffs", "Random", "Suppressor", "Test"] ================================================ FILE: README.md ================================================ # PkgTemplates [![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://juliaci.github.io/PkgTemplates.jl/stable) [![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://juliaci.github.io/PkgTemplates.jl/dev) [![CI](https://github.com/JuliaCI/PkgTemplates.jl/actions/workflows/CI.yml/badge.svg?branch=master)](https://github.com/JuliaCI/PkgTemplates.jl/actions/workflows/CI.yml?query=branch%3Amaster) [![Codecov](https://codecov.io/gh/JuliaCI/PkgTemplates.jl/branch/master/graph/badge.svg?token=WsGRSymBmZ)](https://codecov.io/gh/JuliaCI/PkgTemplates.jl) [![Code Style: Blue](https://img.shields.io/badge/code%20style-blue-4495d1.svg)](https://github.com/invenia/BlueStyle) [![ColPrac: Contributor Guide on Collaborative Practices for Community Packages](https://img.shields.io/badge/ColPrac-Contributor%20Guide-blueviolet)](https://github.com/SciML/ColPrac) **PkgTemplates creates new Julia packages in an easy, repeatable, and customizable way.** ## Installation Install with the Julia package manager [Pkg](https://pkgdocs.julialang.org/), just like any other registered Julia package: ```julia pkg> add PkgTemplates # Press ']' to enter the Pkg REPL mode. ``` or ```julia julia> using Pkg; Pkg.add("PkgTemplates") ``` ## Usage ### Interactive Generation You can fully customize your package interactively with: ```julia using PkgTemplates Template(interactive=true)("MyPkg") ``` This will prompt you to select options, displaying the default settings in parentheses. ### Manual creation Creating a `Template` is as simple as: ```julia using PkgTemplates tpl = Template() ``` The no-keywords constructor assumes the existence of some preexisting Git configuration (show configuration using `git config --list` and set with `git config --global`): - `user.name`: Your real name, e.g. John Smith. - `user.email`: Your email address, eg. john.smith@acme.corp. - `github.user`: Your GitHub username: e.g. john-smith. Once you have a `Template`, use it to generate a package: ```julia tpl("MyPkg") ``` However, it's probably desirable to customize the template to your liking with various options and plugins: ```julia using PkgTemplates tpl = Template(; dir="~/code", plugins=[ Git(; manifest=true, ssh=true), GitHubActions(; x86=true), Codecov(), Documenter{GitHubActions}(), ], ) ``` --- For a much more detailed overview, please see [the User Guide documentation](https://juliaci.github.io/PkgTemplates.jl/stable/user/). ## Contributing Issues and pull requests are welcome! New contributors should make sure to read the [ColPrac Contributor Guide](https://github.com/SciML/ColPrac). For some more PkgTemplates-specific tips, see the [Developer Guide documentation](https://juliaci.github.io/PkgTemplates.jl/stable/developer/). ================================================ FILE: docs/Project.toml ================================================ [deps] Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" PkgTemplates = "14b8a8f1-9102-5b29-a752-f990bacb7fe1" [compat] Documenter = "1" ================================================ FILE: docs/make.jl ================================================ using Documenter: Documenter, makedocs, deploydocs using PkgTemplates: PkgTemplates makedocs(; modules=[PkgTemplates], authors="Chris de Graaf, Invenia Technical Computing Corporation", sitename="PkgTemplates.jl", format=Documenter.HTML(; repolink="https://github.com/JuliaCI/PkgTemplates.jl", canonical="https://juliaci.github.io/PkgTemplates.jl", assets=String[], ), pages=[ "Home" => "index.md", "User Guide" => "user.md", "Developer Guide" => "developer.md", "Migrating To PkgTemplates 0.7+" => "migrating.md", ], ) deploydocs(; repo="github.com/JuliaCI/PkgTemplates.jl", ) ================================================ FILE: docs/src/developer.md ================================================ ```@meta CurrentModule = PkgTemplates ``` # PkgTemplates Developer Guide ```@contents Pages = ["developer.md"] ``` Issues and pull requests are welcome! New contributors should make sure to read the [ColPrac Contributor Guide](https://github.com/SciML/ColPrac). [PkgTemplates](https://github.com/JuliaCI/PkgTemplates.jl/) can be easily extended by adding new [`Plugin`](@ref)s. There are three types of plugins: [`Plugin`](@ref), [`FilePlugin`](@ref), and [`BadgePlugin`](@ref). ```@docs Plugin FilePlugin BadgePlugin ``` ## Template + Package Creation Pipeline The [`Template`](@ref) constructor basically does this: ``` - extract values from keyword arguments - create a Template from the values - for each plugin: - validate plugin against the template ``` The plugin validation step uses the [`validate`](@ref) function. It lets us catch mistakes before we try to generate packages. ```@docs validate ``` The package generation process looks like this: ``` - create empty directory for the package - for each plugin, ordered by priority: - run plugin prehook - for each plugin, ordered by priority: - run plugin hook - for each plugin, ordered by priority: - run plugin posthook ``` As you can tell, plugins play a central role in setting up a package. The three main entrypoints for plugins to do work are the [`prehook`](@ref), the [`hook`](@ref), and the [`posthook`](@ref). As the names might imply, they basically mean "before the main stage", "the main stage", and "after the main stage", respectively. Each stage is basically identical, since the functions take the exact same arguments. However, the multiple stages allow us to depend on artifacts of the previous stages. For example, the [`Git`](@ref) plugin uses [`posthook`](@ref) to commit all generated files, but it wouldn't make sense to do that before the files are generated. But what about dependencies within the same stage? In this case, we have [`priority`](@ref) to define which plugins go when. The [`Git`](@ref) plugin also uses this function to lower its posthook's priority, so that even if other plugins generate files in their posthooks, they still get committed (provided that those plugins didn't set an even lower priority). ```@docs prehook hook posthook priority ``` ## `Plugin` Walkthrough Concrete types that subtype [`Plugin`](@ref) directly are free to do almost anything. To understand how they're implemented, let's look at simplified versions of two plugins: [`Documenter`](@ref) to explore templating, and [`Git`](@ref) to further clarify the multi-stage pipeline. ### Example: `Documenter` ```julia @plugin struct Documenter <: Plugin make_jl::String = default_file("docs", "make.jlt") index_md::String = default_file("docs", "src", "index.md") end gitignore(::Documenter) = ["/docs/build/"] badges(::Documenter) = [ Badge( "Stable", "https://img.shields.io/badge/docs-stable-blue.svg", "https://{{{USER}}}.github.io/{{{PKG}}}.jl/stable", ), Badge( "Dev", "https://img.shields.io/badge/docs-dev-blue.svg", "https://{{{USER}}}.github.io/{{{PKG}}}.jl/dev", ), ] view(p::Documenter, t::Template, pkg::AbstractString) = Dict( "AUTHORS" => join(t.authors, ", "), "PKG" => pkg, "REPO" => "$(t.host)/$(t.user)/$pkg.jl", "USER" => t.user, ) function hook(p::Documenter, t::Template, pkg_dir::AbstractString) pkg = pkg_name(pkg_dir) docs_dir = joinpath(pkg_dir, "docs") make = render_file(p.make_jl, combined_view(p, t, pkg), tags(p)) gen_file(joinpath(docs_dir, "make.jl"), make) index = render_file(p.index_md, combined_view(p, t, pkg), tags(p)) gen_file(joinpath(docs_dir, "src", "index.md"), index) # What this function does is not relevant here. create_documentation_project() end ``` The `@plugin` macro defines some helpful methods for us. Inside of our struct definition, we're using [`default_file`](@ref) to refer to files in this repository. ```@docs @plugin default_file ``` The first method we implement for `Documenter` is [`gitignore`](@ref), so that packages created with this plugin ignore documentation build artifacts. ```@docs gitignore ``` Second, we implement [`badges`](@ref) to add a couple of badges to new packages' README files. ```@docs badges Badge ``` These two functions, [`gitignore`](@ref) and [`badges`](@ref), are currently the only "special" functions for cross-plugin interactions. In other cases, you can still access the [`Template`](@ref)'s plugins to depend on the presence/properties of other plugins via [`getplugin`](@ref), although that's less powerful. ```@docs getplugin ``` Third, we implement [`view`](@ref), which is used to fill placeholders in badges and rendered files. ```@docs view ``` Finally, we implement [`hook`](@ref), which is the real workhorse for the plugin. Inside of this function, we generate a couple of files with the help of a few more text templating functions. ```@docs render_file render_text gen_file combined_view tags pkg_name ``` For more information on text templating, see the [`FilePlugin` Walkthrough](@ref) and the section on [Custom Template Files](@ref). ### Example: `Git` ```julia struct Git <: Plugin end priority(::Git, ::typeof(posthook)) = 5 function validate(::Git, ::Template) foreach(("user.name", "user.email")) do k if isempty(LibGit2.getconfig(k, "")) throw(ArgumentError("Git: Global Git config is missing required value '$k'")) end end end function prehook(::Git, t::Template, pkg_dir::AbstractString) LibGit2.with(LibGit2.init(pkg_dir)) do repo LibGit2.commit(repo, "Initial commit") pkg = pkg_name(pkg_dir) url = "https://$(t.host)/$(t.user)/$pkg.jl" close(GitRemote(repo, "origin", url)) end end function hook(::Git, t::Template, pkg_dir::AbstractString) ignore = mapreduce(gitignore, append!, t.plugins) unique!(sort!(ignore)) gen_file(joinpath(pkg_dir, ".gitignore"), join(ignore, "\n")) end function posthook(::Git, ::Template, pkg_dir::AbstractString) LibGit2.with(GitRepo(pkg_dir)) do repo LibGit2.add!(repo, ".") LibGit2.commit(repo, "Files generated by PkgTemplates") end end ``` We didn't use `@plugin` for this one, because there are no fields. Validation and all three hooks are implemented: - [`validate`](@ref) makes sure that all required Git configuration is present. - [`prehook`](@ref) creates the Git repository for the package. - [`hook`](@ref) generates the `.gitignore` file, using the special [`gitignore`](@ref) function. - [`posthook`](@ref) adds and commits all the generated files. As previously mentioned, we use [`priority`](@ref) to make sure that we wait until all other plugins are finished their work before committing files. Hopefully, this demonstrates the level of control you have over the package generation process when developing plugins, and when it makes sense to exercise that power! ## `FilePlugin` Walkthrough Most of the time, you don't really need all of the control that we showed off above. Plugins that subtype [`FilePlugin`](@ref) perform a much more limited task. In general, they just generate one templated file. To illustrate, let's look at the [`Citation`](@ref) plugin, which creates a `CITATION.bib` file. ```julia @plugin struct Citation <: FilePlugin file::String = default_file("CITATION.bib") end source(p::Citation) = p.file destination(::Citation) = "CITATION.bib" tags(::Citation) = "<<", ">>" view(::Citation, t::Template, pkg::AbstractString) = Dict( "AUTHORS" => join(t.authors, ", "), "MONTH" => month(today()), "PKG" => pkg, "URL" => "https://$(t.host)/$(t.user)/$pkg.jl", "YEAR" => year(today()), ) ``` Similar to the `Documenter` example above, we're defining a keyword constructor, and assigning a default template file from this repository. This plugin adds nothing to `.gitignore`, and it doesn't add any badges, so implementations for [`gitignore`](@ref) and [`badges`](@ref) are omitted. First, we implement [`source`](@ref) and [`destination`](@ref) to define where the template file comes from, and where it goes. These functions are specific to [`FilePlugin`](@ref)s, and have no effect on regular [`Plugin`](@ref)s by default. ```@docs source destination ``` Next, we implement [`tags`](@ref). We briefly saw this function earlier, but in this case it's necessary to change its behaviour from the default. To see why, it might help to see the template file in its entirety: ``` @misc{<<&PKG>>.jl, author = {<<&AUTHORS>>}, title = {<<&PKG>>.jl}, url = {<<&URL>>}, version = {v0.1.0}, year = {<<&YEAR>>}, month = {<<&MONTH>>} } ``` Because the file contains its own `{}` delimiters, we need to use different ones for templating to work properly. Finally, we implement [`view`](@ref) to fill in the placeholders that we saw in the template file. ## Doing Extra Work With `FilePlugin`s Notice that we didn't have to implement [`hook`](@ref) for our plugin. It's implemented for all [`FilePlugin`](@ref)s, like so: ```julia function render_plugin(p::FilePlugin, t::Template, pkg::AbstractString) return render_file(source(p), combined_view(p, t, pkg), tags(p)) end function hook(p::FilePlugin, t::Template, pkg_dir::AbstractString) source(p) === nothing && return pkg = pkg_name(pkg_dir) path = joinpath(pkg_dir, destination(p)) text = render_plugin(p, t, pkg) gen_file(path, text) end ``` But what if we want to do a little more than just generate one file? A good example of this is the [`Tests`](@ref) plugin. It creates `runtests.jl`, but it also modifies the `Project.toml` to include the `Test` dependency. Of course, we could use a normal [`Plugin`](@ref), but it turns out there's a way to avoid that while still getting the extra capbilities that we want. The plugin implements its own `hook`, but uses `invoke` to avoid duplicating the file creation code: ```julia @plugin struct Tests <: FilePlugin file::String = default_file("runtests.jlt") end source(p::Tests) = p.file destination(::Tests) = joinpath("test", "runtests.jl") view(::Tests, ::Template, pkg::AbstractString) = Dict("PKG" => pkg) function hook(p::Tests, t::Template, pkg_dir::AbstractString) # Do the normal FilePlugin behaviour to create the test script. invoke(hook, Tuple{FilePlugin, Template, AbstractString}, p, t, pkg_dir) # Do some other work. add_test_dependency() end ``` There is also a default [`validate`](@ref) implementation for [`FilePlugin`](@ref)s, which checks that the plugin's [`source`](@ref) file exists, and throws an `ArgumentError` otherwise. If you want to extend the validation but keep the file existence check, use the `invoke` method as described above. For more examples, see the plugins in the [Continuous Integration (CI)](@ref) and [Code Coverage](@ref) sections. ## Supporting Interactive Mode When it comes to supporting interactive mode for your custom plugins, you have two options: write your own [`interactive`](@ref) method, or use the default one. If you choose the first option, then you are free to implement the method however you want. If you want to use the default implementation, then there are a few functions that you should be aware of, although in many cases you will not need to add any new methods. ```@docs interactive prompt customizable input_tips convert_input ``` ## Miscellaneous Tips ### Writing Template Files For an overview of writing template files for Mustache.jl, see [Custom Template Files](@ref) in the user guide. ### Predicates There are a few predicate functions for plugins that are occasionally used to answer questions like "does this `Template` have any code coverage plugins?". If you're implementing a plugin that fits into one of the following categories, it would be wise to implement the corresponding predicate function to return `true` for instances of your type. ```@docs needs_username is_ci is_coverage ``` ### Formatting Version Numbers When writing configuration files for CI services, working with version numbers is often needed. There are a few convenience functions that can be used to make this a little bit easier. ```@docs compat_version format_version collect_versions ``` ## Testing If you write a cool new plugin that could be useful to other people, or find and fix a bug, you're encouraged to open a pull request with your changes. Here are some testing tips to ensure that your PR goes through as smoothly as possible. ### Updating Reference Tests & Fixtures If you've added or modified plugins, you should update the reference tests and the associated test fixtures. In `test/reference.jl`, you'll find a "Reference tests" test set that basically generates a bunch of packages, and then checks each file against a reference file, which is stored somewhere in `test/fixtures`. Note the reference tests only run on one specific version of Julia; check `test/runtests.jl` to see the current version used. For new plugins, you should add an instance of your plugin to the "All plugins" and "Wacky options" test sets, then run the tests with `Pkg.test`. They should pass, and there will be new files in `test/fixtures`. Check them to make sure that they contain exactly what you would expect! For changes to existing plugins, update the plugin options appropriately in the "Wacky options" test set. Failing tests will give you the option to review and accept changes to the fixtures, updating the files automatically for you. ### Running reference tests locally In the file `test/runtests.jl`, there is a variable called `REFERENCE_JULIA_VERSION`, currently set to `v"1.7.2"`. If you use any other Julia version (even the latest stable one) to launch the test suite, the reference tests mentioned above will not run, and you will miss a crucial correctness check for your code. Therefore, we strongly suggest you test PkgTemplates locally against Julia 1.7.2. This version can be easily installed and started with [juliaup](https://github.com/JuliaLang/juliaup): ```bash juliaup add 1.7.2 julia +1.7.2 ``` ### Updating "Show" Tests Depending on what you've changed, the tests in `test/show.jl` might fail. To fix those, you'll need to update the `expected` value to match what is actually displayed in a Julia REPL (assuming that the new value is correct). ================================================ FILE: docs/src/index.md ================================================ ```@meta CurrentModule = PkgTemplates ``` # PkgTemplates **[PkgTemplates](https://github.com/JuliaCI/PkgTemplates.jl/) creates new Julia packages in an easy, repeatable, and customizable way.** ## Documentation If you're looking to **create new packages**, see the [User Guide](user.md). If you want to **create new plugins**, see the [Developer Guide](developer.md). if you're trying to **migrate from an older version of PkgTemplates**, see [Migrating To PkgTemplates 0.7+](migrating.md). ```@docs PkgTemplates ``` ## Index ```@index ``` ================================================ FILE: docs/src/migrating.md ================================================ ```@meta CurrentModule = PkgTemplates ``` # Migrating To PkgTemplates 0.7+ PkgTemplates 0.7 is a ground-up rewrite of the package with similar functionality but with updated APIs and internals. Here is a summary of things that existed in older versions but have been moved elsewhere or removed. However, it might be easier to just read the [User Guide](user.md). ## Template keywords The recurring theme is "everything is a plugin now". | Old | New | | :------------------: | :-------------------------------: | | `license="ISC"` | `plugins=[License(; name="ISC")]` | | `develop=true` * | `plugins=[Develop()]` | | `git=false` | `plugins=[!Git]` | | `julia_version=v"1"` | `julia=v"1"` | | `ssh=true` | `plugins=[Git(; ssh=true)]` | | `manifest=true` | `plugins=[Git(; manifest=true)]` | \* `develop=true` was the default setting, but it is no longer the default in PkgTemplates 0.7+. ## Plugins Aside from renamings, basically every plugin has had their constructors reworked. So if you are using anything non-default, you should consult the new docstring. | Old | New | | :-----------: | :--------------------: | | `GitHubPages` | `Documenter{TravisCI}` | | `GitLabPages` | `Documenter{GitLabCI}` | ## Package Generation One less name to remember! | Old | New | | :-----------------------------------------: | :---------------------------------: | | `generate(::Template, pkg::AbstractString)` | `(::Template)(pkg::AbstractString)` | ## Interactive Mode | Old | New | | :-----------------------------------------: | :---------------------------------: | | `interactive_template()` | `Template(; interactive=true)` | | `generate_interactive(pkg::AbstractString)` | `Template(; interactive=true)(pkg)` | ## Other Functions Two less names to remember! Although it's unlikely that anyone used these. | Old | New | | :------------------: | :--------------------------------------------------------------------------------------------------: | | `available_licenses` | [View licenses on GitHub](https://github.com/JuliaCI/PkgTemplates.jl/tree/master/templates/licenses) | | `show_license` | [View licenses on GitHub](https://github.com/JuliaCI/PkgTemplates.jl/tree/master/templates/licenses) | ## Custom Plugins In addition to the changes in usage, custom plugins from older versions of PkgTemplates will not work in 0.7+. See the [Developer Guide](developer.md) for more information on the new extension API. ================================================ FILE: docs/src/user.md ================================================ ```@meta CurrentModule = PkgTemplates ``` # PkgTemplates User Guide ```@contents Pages = ["user.md"] ``` Using [PkgTemplates](https://github.com/JuliaCI/PkgTemplates.jl/) is straightforward. Just create a [`Template`](@ref), and call it on a package name to generate that package: ```julia using PkgTemplates t = Template() t("MyPkg") ``` ## Template ```@docs Template generate ``` ## Plugins Plugins add functionality to `Template`s. There are a number of plugins available to automate common boilerplate tasks. ### Default Plugins These plugins are included by default. They can be overridden by supplying another value, or disabled by negating the type (`!Type`), both as elements of the `plugins` keyword. ```@docs ProjectFile SrcDir Tests Readme License Git GitHubActions Dependabot TagBot Secret ``` ### Continuous Integration (CI) These plugins will create the configuration files of common CI services for you. ```@docs AppVeyor CirrusCI DroneCI GitLabCI TravisCI ``` ### Code Coverage These plugins will enable code coverage reporting from CI. ```@docs Codecov Coveralls ``` ### Documentation These plugins will help you build a documentation website. ```@docs Documenter Logo ``` ### Badges These plugins will add badges to the README. ```@docs BlueStyleBadge ColPracBadge PkgEvalBadge ``` ### Miscellaneous ```@docs Develop Citation RegisterAction Formatter CodeOwners PkgBenchmark CompatHelper ``` ## A More Complicated Example Here are a few example templates that use the options and plugins explained above. This one includes plugins suitable for a project hosted on GitHub, and some other customizations: ```julia Template(; user="my-username", dir="~/code", authors="Acme Corp", julia=v"1.1", plugins=[ License(; name="MPL-2.0"), Git(; manifest=true, ssh=true), GitHubActions(; x86=true), Codecov(), Documenter{GitHubActions}(), Develop(), ], ) ``` Here's one that works well for projects hosted on GitLab: ```julia Template(; user="my-username", host="gitlab.com", plugins=[ GitLabCI(), Documenter{GitLabCI}(), ], ) ``` ## Custom Template Files !!! note "Templates vs Templating" This documentation refers plenty to [`Template`](@ref)s, the package's main type, but it also refers to "template files" and "text templating", which are plaintext files with placeholders to be filled with data, and the technique of filling those placeholders with data, respectively. These concepts should be familiar if you've used [Jinja](https://palletsprojects.com/p/jinja) or [Mustache](https://mustache.github.io) (Mustache is the particular flavour used by PkgTemplates, via [Mustache.jl](https://github.com/jverzani/Mustache.jl)). Please keep the difference between these two things in mind! Many plugins support a `file` argument or similar, which sets the path to the template file to be used for generating files. Each plugin has a sensible default that should make sense for most people, but you might have a specialized workflow that requires a totally different template file. If that's the case, a basic understanding of [Mustache](https://mustache.github.io)'s syntax is required. Here's an example template file: ``` Hello, {{{name}}}. {{#weather}} It's {{{weather}}} outside. {{/weather}} {{^weather}} I don't know what the weather outside is. {{/weather}} {{#has_things}} I have the following things: {{/has_things}} {{#things}} - Here's a thing: {{{.}}} {{/things}} {{#people}} - {{{name}}} is {{{mood}}} {{/people}} ``` In the first section, `name` is a key, and its value replaces `{{{name}}}`. In the second section, `weather`'s value may or may not exist. If it does exist, then "It's \$weather outside" is printed. Otherwise, "I don't know what the weather outside is" is printed. Mustache uses a notion of "truthiness" similar to Python or JavaScript, where values of `nothing`, `false`, or empty collections are all considered to not exist. In the third section, `has_things`' value is printed if it's truthy. Then, if the `things` list is truthy (i.e. not empty), its values are each printed on their own line. The reason that we have two separate keys is that `{{#things}}` iterates over the whole `things` list, even when there are no `{{{.}}}` placeholders, which would duplicate "I have the following things:" `n` times. The fourth section iterates over the `people` list, but instead of using the `{{{.}}}` placeholder, we have `name` and `mood`, which are keys or fields of the list elements. Most types are supported here, including `Dict`s and structs. `NamedTuple`s require you to use `{{{:name}}}` instead of the normal `{{{name}}}`, though. You might notice that some curlies are in groups of two (`{{key}}`), and some are in groups of three (`{{{key}}}`). Whenever we want to subtitute in a value, using the triple curlies disables HTML escaping, which we rarely want for the types of files we're creating. If you do want escaping, just use the double curlies. And if you're using different delimiters, for example `<>`, use `<<&foo>>` to disable escaping. Assuming the following view: ```julia struct Person; name::String; mood::String; end things = ["a", "b", "c"] view = Dict( "name" => "Chris", "weather" => "sunny", "has_things" => !isempty(things), "things" => things, "people" => [Person("John", "happy"), Person("Jane", "sad")], ) ``` Our example template would produce this: ``` Hello, Chris. It's sunny outside. I have the following things: - Here's a thing: a - Here's a thing: b - Here's a thing: c - John is happy - Jane is sad ``` ## Extending Existing Plugins Most of the existing plugins generate a file from a template file. If you want to use custom template files, you may run into situations where the data passed into the templating engine is not sufficient. In this case, you can look into implementing [`user_view`](@ref) to supply whatever data is necessary for your use case. ```@docs user_view ``` For example, suppose you were using the [`Readme`](@ref) plugin with a custom template file that looked like this: ```md # {{PKG}} Created on *{{TODAY}}*. ``` The [`view`](@ref) function supplies a value for `PKG`, but it does not supply a value for `TODAY`. Rather than override [`view`](@ref), we can implement this function to get both the default values and whatever else we need to add. ```julia user_view(::Readme, ::Template, ::AbstractString) = Dict("TODAY" => today()) ``` ## Saving Templates One of the main reasons for PkgTemplates' existence is for new packages to be consistent. This means using the same template more than once, so we want a way to save a template to be used later. Here's my recommendation for loading a template whenever it's needed: ```julia function template() @eval begin using PkgTemplates Template(; #= ... =#) end end ``` Add this to your `startup.jl`, and you can create your template from anywhere, without incurring any startup cost. Another strategy is to write the string representation of the template to a Julia file: ```julia const t = Template(; #= ... =#) open("template.jl", "w") do io println(io, "using PkgTemplates") print(io, t) end ``` Then the template is just an `include` away: ```julia const t = include("template.jl") ``` The only disadvantage to this approach is that the saved template is much less human-readable than code you wrote yourself. One more method of saving templates is to simply use the Serialization package in the standard library: ```julia const t = Template(; #= ... =#) using Serialization open(io -> serialize(io, t), "template.bin", "w") ``` Then simply `deserialize` to load: ```julia using Serialization const t = open(deserialize, "template.bin") ``` This approach has the same disadvantage as the previous one, and the serialization format is not guaranteed to be stable across Julia versions. ================================================ FILE: src/PkgTemplates.jl ================================================ @doc read(joinpath(dirname(@__DIR__), "README.md"), String) module PkgTemplates using Base: active_project, contractuser using Dates: month, today, year using InteractiveUtils: subtypes using LibGit2: LibGit2, GitConfig, GitReference, GitRemote, GitRepo, delete_branch using Pkg: Pkg, TOML, PackageSpec using REPL.TerminalMenus: MultiSelectMenu, RadioMenu, request using UUIDs: uuid4 using Mustache: render using Parameters: @with_kw_noshow using Mocking export Template, AppVeyor, BlueStyleBadge, CirrusCI, Citation, Codecov, CodeOwners, ColPracBadge, CompatHelper, Coveralls, Dependabot, Develop, Documenter, DroneCI, Formatter, Git, GitHubActions, GitLabCI, License, Logo, NoDeploy, PkgBenchmark, PkgEvalBadge, ProjectFile, Readme, RegisterAction, Runic, Secret, SrcDir, TagBot, Tests, TravisCI """ Plugins are PkgTemplates' source of customization and extensibility. Add plugins to your [`Template`](@ref)s to enable extra pieces of repository setup. When implementing a new plugin, subtype this type to have full control over its behaviour. """ abstract type Plugin end include("template.jl") include("plugin.jl") include("show.jl") include("interactive.jl") include("deprecated.jl") # Run some function with a project activated at the given path. function with_project(f::Function, path::AbstractString) proj = active_project() try Pkg.activate(path) f() finally proj === nothing ? Pkg.activate() : Pkg.activate(proj) end end end ================================================ FILE: src/deprecated.jl ================================================ @deprecate generate(t::Template, pkg::AbstractString) t(pkg) @deprecate generate(pkg::AbstractString, t::Template) t(pkg) @deprecate interactive_template() Template(; interactive=true) @deprecate generate_interactive(pkg::AbstractString) Template(; interactive=true)(pkg) @deprecate GitHubPages(; kwargs...) Documenter{TravisCI}(; kwargs...) @deprecate GitLabPages(; kwargs...) Documenter{GitLabCI}(; kwargs...) ================================================ FILE: src/interactive.jl ================================================ """ generate([pkg::AbstractString]) -> Template Shortcut for `Template(; interactive=true)(pkg)`. If no package name is supplied, you will be prompted for one. """ function generate(pkg::AbstractString=prompt(Template, String, :pkg)) t = Template(; interactive=true) t(pkg) return t end """ interactive(T::Type{<:Plugin}) -> T Interactively create a plugin of type `T`. Implement this method and ignore other related functions only if you want completely custom behaviour. """ function interactive(T::Type) pairs = Vector{Pair{Symbol, Type}}(interactive_pairs(T)) # There must be at least 2 MultiSelectMenu options. # If there are none, return immediately. # If there's just one, add a "dummy" option. isempty(pairs) && return T() just_one = length(pairs) == 1 just_one && push!(pairs, :None => Nothing) println("$(nameof(T)) keywords to customize:") opts = map(first.(pairs)) do k if k != :None "$k ($(repr(defaultkw(T, k))))" else "$k" end end menu = MultiSelectMenu(opts; pagesize=length(pairs)) customize = sort!(collect(request(menu))) # If the "None" option was selected, don't customize anything. just_one && lastindex(pairs) in customize && return T() kwargs = Dict{Symbol, Any}() foreach(pairs[customize]) do (name, F) kwargs[name] = prompt(T, F, name) end return T(; kwargs...) end struct NotCustomizable end """ customizable(::Type{<:Plugin}) -> Vector{Pair{Symbol, DataType}} Return a list of keyword arguments that the given plugin type accepts, which are not fields of the type, and should be customizable in interactive mode. For example, for a constructor `Foo(; x::Bool)`, provide `[x => Bool]`. If `T` has fields which should not be customizable, use `NotCustomizable` as the type. """ customizable(::Type) = () function pretty_message(s::AbstractString) replacements = [ r"Array{(.*?),1}" => s"Vector{\1}", r"Union{Nothing, (.*?)}" => s"Union{\1, Nothing}", ] return reduce((s, p) -> replace(s, p), replacements; init=s) end """ input_tips(::Type{T}) -> Vector{String} Provide some extra tips to users on how to structure their input for the type `T`, for example if multiple delimited values are expected. """ input_tips(::Type{Vector{T}}) where T = [input_tips(T)..., "comma-delimited"] input_tips(::Type{Union{T, Nothing}}) where T = [input_tips(T)..., input_tips(Nothing)...] input_tips(::Type{Nothing}) = ["'nothing' for nothing"] input_tips(::Type{Secret}) = ["name only"] # Show expected input type as a tip if it's anything other than `String` input_tips(::Type{T}) where T = String[string(T)] input_tips(::Type{String}) = String[] input_tips(::Type{<:Signed}) = ["Int"] # Specific Int type likely not important """ convert_input(::Type{P}, ::Type{T}, s::AbstractString) -> T Convert the user input `s` into an instance of `T` for plugin of type `P`. A default implementation of `T(s)` exists. """ convert_input(::Type, T::Type{<:Real}, s::AbstractString) = parse(T, s) convert_input(::Type, T::Type, s::AbstractString) = T(s) function convert_input(P::Type, ::Type{Union{T, Nothing}}, s::AbstractString) where T # This is kind of sketchy because technically, there might be some other input # whose value we want to instantiate with the string "nothing", # but I think that would be a pretty rare occurrence. # If that really happens, they can just override this method. return s == "nothing" ? nothing : convert_input(P, T, s) end function convert_input(P::Type, ::Type{Union{T, Symbol, Nothing}}, s::AbstractString) where T # Assume inputs starting with ':' char are intended as Symbols, if a plugin accept symbols. # i.e. assume the set of valid Symbols the plugin expects can be spelt starting with ':'. return if startswith(s, ":") Symbol(chop(s, head=1, tail=0)) # remove ':' else convert_input(P, Union{T,Nothing}, s) end end function convert_input(::Type, ::Type{Bool}, s::AbstractString) s = lowercase(s) return if startswith(s, 't') || startswith(s, 'y') true elseif startswith(s, 'f') || startswith(s, 'n') false else throw(ArgumentError("Unrecognized boolean response")) end end function convert_input(P::Type, T::Type{<:Vector}, s::AbstractString) startswith(s, '[') && endswith(s, ']') && (s = s[2:end-1]) xs = map(x -> strip(x, [' ', '\t', '"']), split(s, ",")) return map(x -> convert_input(P, eltype(T), x), xs) end # how would the user type `x` in interactive mode? input_string(x) = string(x) input_string(x::AbstractString) = isempty(x) ? repr(x) : String(x) input_string(x::Symbol) = repr(x) """ prompt(::Type{P}, ::Type{T}, ::Val{name::Symbol}) -> Any Prompts for an input of type `T` for field `name` of plugin type `P`. Implement this method to customize particular fields of particular types. """ prompt(P::Type, T::Type, name::Symbol) = prompt(P, T, Val(name)) # The trailing `nothing` is a hack for `fallback_prompt` to use, ignore it. function prompt(P::Type, ::Type{T}, ::Val{name}, ::Nothing=nothing) where {T, name} default = defaultkw(P, name) tips = join([input_tips(T); "default: $(input_string(default))"], ", ") input = Base.prompt(pretty_message("Enter value for '$name' ($tips)")) input === nothing && throw(InterruptException()) input = strip(input, '"') return if isempty(input) default else try # Working around what appears to be a bug in Julia 1.0: # #145#issuecomment-623049535 if VERSION < v"1.1" && T isa Union && Nothing <: T if input == "nothing" nothing else convert_input(P, T.a === Nothing ? T.b : T.a, input) end else convert_input(P, T, input) end catch ex ex isa InterruptException && rethrow() @warn "Invalid input" ex prompt(P, T, name) end end end # Compute all the concrete subtypes of T. concretes_rec(T::Type) = isabstracttype(T) ? vcat(map(concretes_rec, subtypes(T))...) : Any[T] concretes(T::Type) = sort!(concretes_rec(T); by=nameof) # Compute name => type pairs for T's interactive options. function interactive_pairs(T::Type) pairs = collect(map(name -> name => fieldtype(T, name), fieldnames(T))) # Use prepend! here so that users can override field types if they wish. prepend!(pairs, reverse(customizable(T))) uniqueby!(first, pairs) filter!(p -> last(p) !== NotCustomizable, pairs) sort!(pairs; by=first) return pairs end # unique!(f, xs) added here: https://github.com/JuliaLang/julia/pull/30141 if VERSION >= v"1.1" const uniqueby! = unique! else function uniqueby!(f, xs) seen = Set() todelete = Int[] foreach(enumerate(map(f, xs))) do (i, out) out in seen && push!(todelete, i) push!(seen, out) end return deleteat!(xs, todelete) end end ================================================ FILE: src/plugin.jl ================================================ const DEFAULT_PRIORITY = 1000 const DEFAULT_TEMPLATE_DIR = Ref{String}(joinpath(dirname(dirname(pathof(PkgTemplates))), "templates")) """ @plugin struct ... end Define a plugin subtype with keyword constructors and default values. For details on the general syntax, see [Parameters.jl](https://mauro3.github.io/Parameters.jl/stable/manual/#Types-with-default-values-and-keyword-constructors-1). There are a few extra restrictions: - Before using this macro, you must have imported `@with_kw_noshow` and `PkgTemplates` must be in scope: `using PkgTemplates: PkgTemplates, @with_kw_noshow, @plugin`. - The type must be a subtype of [`Plugin`](@ref) (or one of its abstract subtypes) - The type cannot be parametric - All fields must have default values ## Example ```julia using PkgTemplates: PkgTemplates, @plugin, @with_kw_noshow, Plugin @plugin struct MyPlugin <: Plugin x::String = "hello!" y::Union{Int, Nothing} = nothing end ``` ## Implementing `@plugin` Manually If for whatever reason, you are unable to meet the criteria outlined above, you can manually implement the methods that `@plugin` would have created for you. This is only mandatory if you want to use your plugin in interactive mode. ### Keyword Constructors If possible, use `@with_kw_noshow` to create a keyword constructor for your type. Your type must be capable of being instantiated with no arguments. ### Default Values If your type's fields have sensible default values, implement `defaultkw` like so: ```julia using PkgTemplates: PkgTemplates, Plugin struct MyPlugin <: Plugin x::String end PkgTemplates.defaultkw(::Type{MyPlugin}, ::Val{:x}) = "my default" ``` Remember to add a method to the function belonging to PkgTemplates, rather than creating your own function that PkgTemplates won't see. If your plugin's fields have no sane defaults, then you'll need to implement [`prompt`](@ref) appropriately instead. """ macro plugin(ex::Expr) @assert ex.head === :struct "Expression must be a struct definition" @assert ex.args[2] isa Expr && ex.args[2].head === :<: "Type must have a supertype" T = ex.args[2].args[1] @assert T isa Symbol "@plugin does not work for parametric types" msg = "Run `using PkgTemplates: @with_kw_noshow` before using this macro" @assert isdefined(__module__, Symbol("@with_kw_noshow")) msg block = :(begin @with_kw_noshow $ex end) foreach(filter(arg -> arg isa Expr, ex.args[3].args)) do field @assert field.head === :(=) "Field must have a default value" name = QuoteNode(field.args[1].args[1]) default = field.args[2] def = :(PkgTemplates.defaultkw(::Type{$T}, ::Val{$name}) = $default) push!(block.args, def) end return esc(block) end function Base.:(==)(a::T, b::T) where T <: Plugin return all(n -> getfield(a, n) == getfield(b, n), fieldnames(T)) end struct Disabled{P<:Plugin} end Base.:(!)(P::Type{<:Plugin}) = Disabled{P}() """ Secret(name::AbstractString) Represents a GitHub repository secret. When converted to a string, yields `\${{ secrets. }}`. """ struct Secret name::String end Base.print(io::IO, s::Secret) = print(io, "\${{ secrets.$(s.name) }}") """ A simple plugin that, in general, creates a single file. """ abstract type FilePlugin <: Plugin end """ default_file(paths::AbstractString...) -> String Return a path relative to the default template file directory (`PkgTemplates/templates`). """ default_file(paths::AbstractString...) = joinpath(DEFAULT_TEMPLATE_DIR[], paths...) """ view(::Plugin, ::Template, pkg::AbstractString) -> Dict{String, Any} Return the view to be passed to the text templating engine for this plugin. `pkg` is the name of the package being generated. For [`FilePlugin`](@ref)s, this is used for both the plugin badges (see [`badges`](@ref)) and the template file (see [`source`](@ref)). For other [`Plugin`](@ref)s, it is used only for badges, but you can always call it yourself as part of your [`hook`](@ref) implementation. By default, an empty `Dict` is returned. """ view(::Plugin, ::Template, ::AbstractString) = Dict{String, Any}() """ user_view(::Plugin, ::Template, pkg::AbstractString) -> Dict{String, Any} The same as [`view`](@ref), but for use by package *users* for extension. Values returned by this function will override those from [`view`](@ref) when the keys are the same. """ user_view(::Plugin, ::Template, ::AbstractString) = Dict{String, Any}() """ combined_view(::Plugin, ::Template, pkg::AbstractString) -> Dict{String, Any} This function combines [`view`](@ref) and [`user_view`](@ref) for use in text templating. If you're doing manual file creation or text templating (i.e. writing [`Plugin`](@ref)s that are not [`FilePlugin`](@ref)s), then you should use this function rather than either of the former two. !!! note Do not implement this function yourself! If you're implementing a plugin, you should implement [`view`](@ref). If you're customizing a plugin as a user, you should implement [`user_view`](@ref). """ function combined_view(p::Plugin, t::Template, pkg::AbstractString) return merge(view(p, t, pkg), user_view(p, t, pkg)) end """ tags(::Plugin) -> Tuple{String, String} Return the delimiters used for text templating. See the [`Citation`](@ref) plugin for a rare case where changing the tags is necessary. By default, the tags are `"{{"` and `"}}"`. """ tags(::Plugin) = "{{", "}}" """ priority(::Plugin, ::Union{typeof(prehook), typeof(hook), typeof(posthook)}) -> Int Determines the order in which plugins are processed (higher goes first). The default priority (`DEFAULT_PRIORITY`), is `$DEFAULT_PRIORITY`. You can implement this function per-stage (by using `::typeof(hook)`, for example), or for all stages by simply using `::Function`. """ priority(::Plugin, ::Function) = DEFAULT_PRIORITY """ gitignore(::Plugin) -> Vector{String} Return patterns that should be added to `.gitignore`. These are used by the [`Git`](@ref) plugin. By default, an empty list is returned. """ gitignore(::Plugin) = String[] """ badges(::Plugin) -> Union{Badge, Vector{Badge}} Return a list of [`Badge`](@ref)s, or just one, to be added to `README.md`. These are used by the [`Readme`](@ref) plugin to add badges to the README. By default, an empty list is returned. """ badges(::Plugin) = Badge[] """ source(::FilePlugin) -> Union{String, Nothing} Return the path to a plugin's template file, or `nothing` to indicate no file. By default, `nothing` is returned. """ source(::FilePlugin) = nothing """ destination(::FilePlugin) -> String Return the destination, relative to the package root, of a plugin's configuration file. This function **must** be implemented. """ function destination end """ Badge(hover::AbstractString, image::AbstractString, link::AbstractString) Container for Markdown badge data. Each argument can contain placeholders, which will be filled in with values from [`combined_view`](@ref). ## Arguments - `hover::AbstractString`: Text to appear when the mouse is hovered over the badge. - `image::AbstractString`: URL to the image to display. - `link::AbstractString`: URL to go to upon clicking the badge. """ struct Badge hover::String image::String link::String end Base.string(b::Badge) = "[![$(b.hover)]($(b.image))]($(b.link))" # Format a plugin's badges as a list of strings, with all substitutions applied. function badges(p::Plugin, t::Template, pkg::AbstractString) bs = badges(p) bs isa Vector || (bs = [bs]) return map(b -> render_text(string(b), combined_view(p, t, pkg)), bs) end """ validate(::Plugin, ::Template) Perform any required validation for a [`Plugin`](@ref). It is preferred to do validation here instead of in [`prehook`](@ref), because this function is called at [`Template`](@ref) construction time, whereas the prehook is only run at package generation time. """ validate(::Plugin, ::Template) = nothing """ prehook(::Plugin, ::Template, pkg_dir::AbstractString) Stage 1 of the package generation process (the "before" stage, in general). At this point, `pkg_dir` is an empty directory that will eventually contain the package, and neither the [`hook`](@ref)s nor the [`posthook`](@ref)s have run. !!! note `pkg_dir` only stays empty until the first plugin chooses to create a file. See also: [`priority`](@ref). """ prehook(::Plugin, ::Template, ::AbstractString) = nothing """ hook(::Plugin, ::Template, pkg_dir::AbstractString) Stage 2 of the package generation pipeline (the "main" stage, in general). At this point, the [`prehook`](@ref)s have run, but not the [`posthook`](@ref)s. `pkg_dir` is the directory in which the package is being generated; [`pkg_name`](@ref)` will return the package name. !!! note You usually shouldn't implement this function for [`FilePlugin`](@ref)s. If you do, it should probably `invoke` the generic method (otherwise, there's not much reason to subtype `FilePlugin`). """ hook(::Plugin, ::Template, ::AbstractString) = nothing """ posthook(::Plugin, ::Template, pkg_dir::AbstractString) Stage 3 of the package generation pipeline (the "after" stage, in general). At this point, both the [`prehook`](@ref)s and [`hook`](@ref)s have run. """ posthook(::Plugin, ::Template, ::AbstractString) = nothing function validate(p::T, ::Template) where T <: FilePlugin src = source(p) src === nothing && return isfile(src) || throw(ArgumentError("$(nameof(T)): The file $src does not exist")) end function hook(p::FilePlugin, t::Template, pkg_dir::AbstractString) source(p) === nothing && return pkg = pkg_name(pkg_dir) path = joinpath(pkg_dir, destination(p)) text = render_plugin(p, t, pkg) gen_file(path, text) end function render_plugin(p::FilePlugin, t::Template, pkg::AbstractString) return render_file(source(p), combined_view(p, t, pkg), tags(p)) end """ gen_file(file::AbstractString, text::AbstractString) Create a new file containing some given text. Trailing whitespace is removed, and the file will end with a newline. """ function gen_file(file::AbstractString, text::AbstractString) mkpath(dirname(file)) text = strip(join(map(rstrip, split(text, "\n")), "\n")) * "\n" write(file, text) end """ render_file(file::AbstractString, view::Dict{<:AbstractString}, tags=nothing) -> String Render a template file with the data in `view`. `tags` should be a tuple of two strings, which are the opening and closing delimiters, or `nothing` to use the default delimiters. """ function render_file(file::AbstractString, view::Dict{<:AbstractString}, tags=nothing) return render_text(read(file, String), view, tags) end """ render_text(text::AbstractString, view::Dict{<:AbstractString}, tags=nothing) -> String Render some text with the data in `view`. `tags` should be a tuple of two strings, which are the opening and closing delimiters, or `nothing` to use the default delimiters. """ function render_text(text::AbstractString, view::Dict{<:AbstractString}, tags=nothing) return tags === nothing ? render(text, view) : render(text, view; tags=tags) end """ needs_username(::Plugin) -> Bool Determine whether or not a plugin needs a Git hosting service username to function correctly. If you are implementing a plugin that uses the `user` field of a [`Template`](@ref), you should implement this function and return `true`. """ needs_username(::Plugin) = false """ pkg_name(pkg_dir::AbstractString) Return package name of package at `pkg_dir`, i.e., `basename(pkg_dir)` excluding any `.jl` suffix, if present. For example, `foo/bar/Whee.jl` and `foo/bar/Whee` both return `Whee`. """ function pkg_name(pkg_dir::AbstractString) pkg = basename(pkg_dir) return endswith(pkg, ".jl") ? pkg[1:end-3] : pkg end include(joinpath("plugins", "project_file.jl")) include(joinpath("plugins", "src_dir.jl")) include(joinpath("plugins", "tests.jl")) include(joinpath("plugins", "readme.jl")) include(joinpath("plugins", "license.jl")) include(joinpath("plugins", "git.jl")) include(joinpath("plugins", "tagbot.jl")) include(joinpath("plugins", "develop.jl")) include(joinpath("plugins", "coverage.jl")) include(joinpath("plugins", "codeowners.jl")) include(joinpath("plugins", "ci.jl")) include(joinpath("plugins", "compat_helper.jl")) include(joinpath("plugins", "citation.jl")) include(joinpath("plugins", "documenter.jl")) include(joinpath("plugins", "badges.jl")) include(joinpath("plugins", "register.jl")) include(joinpath("plugins", "dependabot.jl")) include(joinpath("plugins", "formatter.jl")) include(joinpath("plugins", "pkgbenchmark.jl")) ================================================ FILE: src/plugins/badges.jl ================================================ """ A [`Plugin`](@ref) that only adds a [`Badge`](@ref) to the [`Readme`](@ref) file. Concrete subtypes only need to implement a [`badges`](@ref) method. """ abstract type BadgePlugin <: Plugin end """ BlueStyleBadge() Adds a [`BlueStyle`](https://github.com/invenia/BlueStyle) badge to the [`Readme`](@ref) file. """ struct BlueStyleBadge <: BadgePlugin end function badges(::BlueStyleBadge) return Badge( "Code Style: Blue", "https://img.shields.io/badge/code%20style-blue-4495d1.svg", "https://github.com/invenia/BlueStyle", ) end """ ColPracBadge() Adds a [`ColPrac`](https://github.com/SciML/ColPrac) badge to the [`Readme`](@ref) file. """ struct ColPracBadge <: BadgePlugin end function badges(::ColPracBadge) return Badge( "ColPrac: Contributor's Guide on Collaborative Practices for Community Packages", "https://img.shields.io/badge/ColPrac-Contributor's%20Guide-blueviolet", "https://github.com/SciML/ColPrac", ) end """ PkgEvalBadge() Adds a [`PkgEval` badge](https://github.com/JuliaCI/NanosoldierReports#pkgeval-reports) to the [`Readme`](@ref) file. """ struct PkgEvalBadge <: BadgePlugin end function badges(::PkgEvalBadge) return Badge( "PkgEval", "https://JuliaCI.github.io/NanosoldierReports/pkgeval_badges/{{{PKG1}}}/{{{PKG}}}.svg", "https://JuliaCI.github.io/NanosoldierReports/pkgeval_badges/{{{PKG1}}}/{{{PKG}}}.html" ) end function view(::PkgEvalBadge, t::Template, pkg::AbstractString) return Dict("PKG1" => first(pkg), "PKG" => pkg) end ================================================ FILE: src/plugins/ci.jl ================================================ """ format_version(v::Union{VersionNumber, AbstractString}) -> String Strip everything but the major and minor release from a `VersionNumber`. Strings are left in their original form. """ format_version(v::VersionNumber) = "$(v.major).$(v.minor)" format_version(v::AbstractString) = string(v) const ALLOWED_FAILURES = ["nightly"] # TODO: Update this list with new RCs. const DEFAULT_CI_VERSIONS = map(format_version, [default_version(), VERSION, "nightly"]) const DEFAULT_CI_VERSIONS_GITHUB = map(format_version, [default_version(), VERSION, "pre"]) const DEFAULT_CI_VERSIONS_NO_PRERELEASE = map(format_version, [default_version(), VERSION]) const EXTRA_VERSIONS_DOC = "- `extra_versions::Vector`: Extra Julia versions to test, as strings or `VersionNumber`s." """ GitHubActions(; file="$(contractuser(default_file("github", "workflows", "CI.yml")))", destination="CI.yml", linux=true, osx=false, windows=false, x64=true, x86=false, coverage=true, extra_versions=$DEFAULT_CI_VERSIONS_GITHUB, ) Integrates your packages with [GitHub Actions](https://github.com/features/actions). ## Keyword Arguments - `file::AbstractString`: Template file for the workflow file. - `destination::AbstractString`: Destination of the workflow file, relative to `.github/workflows`. - `linux::Bool`: Whether or not to run builds on Linux. - `osx::Bool`: Whether or not to run builds on OSX (MacOS). - `windows::Bool`: Whether or not to run builds on Windows. - `x64::Bool`: Whether or not to run builds on 64-bit architecture. - `x86::Bool`: Whether or not to run builds on 32-bit architecture. - `coverage::Bool`: Whether or not to publish code coverage. Another code coverage plugin such as [`Codecov`](@ref) must also be included. $EXTRA_VERSIONS_DOC !!! note If using coverage plugins, don't forget to manually add your API tokens as secrets, as described [here](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets#creating-encrypted-secrets). """ @plugin struct GitHubActions <: FilePlugin file::String = default_file("github", "workflows", "CI.yml") destination::String = "CI.yml" linux::Bool = true osx::Bool = false windows::Bool = false x64::Bool = true x86::Bool = false coverage::Bool = true extra_versions::Vector = DEFAULT_CI_VERSIONS_GITHUB end source(p::GitHubActions) = p.file destination(p::GitHubActions) = joinpath(".github", "workflows", p.destination) tags(::GitHubActions) = "<<", ">>" badges(p::GitHubActions) = Badge( "Build Status", "https://github.com/{{{USER}}}/{{{PKG}}}.jl/actions/workflows/$(p.destination)/badge.svg?branch={{{BRANCH}}}", "https://github.com/{{{USER}}}/{{{PKG}}}.jl/actions/workflows/$(p.destination)?query=branch%3A{{{BRANCH}}}", ) function view(p::GitHubActions, t::Template, pkg::AbstractString) os = String[] p.linux && push!(os, "ubuntu-latest") p.osx && push!(os, "macOS-latest") p.windows && push!(os, "windows-latest") arch = filter(a -> getfield(p, Symbol(a)), ["x64", "x86"]) excludes = Dict{String, String}[] p.osx && p.x86 && push!(excludes, Dict("E_OS" => "macOS-latest", "E_ARCH" => "x86")) v = Dict( "ARCH" => arch, "EXCLUDES" => excludes, "HAS_CODECOV" => p.coverage && hasplugin(t, Codecov), "HAS_COVERALLS" => p.coverage && hasplugin(t, Coveralls), "HAS_DOCUMENTER" => hasplugin(t, Documenter{GitHubActions}), "HAS_EXCLUDES" => !isempty(excludes), "HAS_RUNIC" => hasplugin(t, Runic{GitHubActions}), "OS" => os, "PKG" => pkg, "USER" => t.user, "VERSIONS" => collect_versions(t, p.extra_versions), ) p = getplugin(t, Git) if p !== nothing v["BRANCH"] = p.branch end return v end """ TravisCI(; file="$(contractuser(default_file("travis.yml")))", linux=true, osx=false, windows=false, x64=true, x86=false, arm64=false, coverage=true, extra_versions=$DEFAULT_CI_VERSIONS, ) Integrates your packages with [Travis CI](https://travis-ci.com). ## Keyword Arguments - `file::AbstractString`: Template file for `.travis.yml`. - `linux::Bool`: Whether or not to run builds on Linux. - `osx::Bool`: Whether or not to run builds on OSX (MacOS). - `windows::Bool`: Whether or not to run builds on Windows. - `x64::Bool`: Whether or not to run builds on 64-bit architecture. - `x86::Bool`: Whether or not to run builds on 32-bit architecture. - `arm64::Bool`: Whether or not to run builds on the ARM64 architecture. - `coverage::Bool`: Whether or not to publish code coverage. Another code coverage plugin such as [`Codecov`](@ref) must also be included. $EXTRA_VERSIONS_DOC """ @plugin struct TravisCI <: FilePlugin file::String = default_file("travis.yml") linux::Bool = true osx::Bool = false windows::Bool = false x64::Bool = true x86::Bool = false arm64::Bool = false coverage::Bool = true extra_versions::Vector = DEFAULT_CI_VERSIONS end source(p::TravisCI) = p.file destination(::TravisCI) = ".travis.yml" badges(::TravisCI) = Badge( "Build Status", "https://app.travis-ci.com/{{{USER}}}/{{{PKG}}}.jl.svg?branch={{{BRANCH}}}", "https://app.travis-ci.com/{{{USER}}}/{{{PKG}}}.jl", ) function view(p::TravisCI, t::Template, pkg::AbstractString) os = filter(o -> getfield(p, Symbol(o)), ["linux", "osx", "windows"]) arch = filter(a -> getfield(p, Symbol(a)), ["x64", "x86", "arm64"]) versions = collect_versions(t, p.extra_versions) allow_failures = filter(in(versions), ALLOWED_FAILURES) excludes = Dict{String, String}[] p.x86 && p.osx && push!(excludes, Dict("E_OS" => "osx", "E_ARCH" => "x86")) if p.arm64 p.osx && push!(excludes, Dict("E_OS" => "osx", "E_ARCH" => "arm64")) p.windows && push!(excludes, Dict("E_OS" => "windows", "E_ARCH" => "arm64")) "pre" in versions && push!(excludes, Dict("E_JULIA" => "pre", "E_ARCH" => "arm64")) end return Dict( "ALLOW_FAILURES" => allow_failures, "ARCH" => arch, "BRANCH" => something(default_branch(t), DEFAULT_DEFAULT_BRANCH), "EXCLUDES" => excludes, "HAS_ALLOW_FAILURES" => !isempty(allow_failures), "HAS_CODECOV" => hasplugin(t, Codecov), "HAS_COVERAGE" => p.coverage && hasplugin(t, is_coverage), "HAS_COVERALLS" => hasplugin(t, Coveralls), "HAS_DOCUMENTER" => hasplugin(t, Documenter{TravisCI}), "HAS_EXCLUDES" => !isempty(excludes), "OS" => os, "PKG" => pkg, "USER" => t.user, "VERSION" => format_version(t.julia), "VERSIONS" => versions, ) end """ AppVeyor(; file="$(contractuser(default_file("appveyor.yml")))", x86=false, coverage=true, extra_versions=$DEFAULT_CI_VERSIONS, ) Integrates your packages with [AppVeyor](https://appveyor.com) via [AppVeyor.jl](https://github.com/JuliaCI/Appveyor.jl). ## Keyword Arguments - `file::AbstractString`: Template file for `.appveyor.yml`. - `x86::Bool`: Whether or not to run builds on 32-bit systems, in addition to the default 64-bit builds. - `coverage::Bool`: Whether or not to publish code coverage. [`Codecov`](@ref) must also be included. $EXTRA_VERSIONS_DOC """ @plugin struct AppVeyor <: FilePlugin file::String = default_file("appveyor.yml") x86::Bool = false coverage::Bool = true extra_versions::Vector = DEFAULT_CI_VERSIONS end source(p::AppVeyor) = p.file destination(::AppVeyor) = ".appveyor.yml" badges(::AppVeyor) = Badge( "Build Status", "https://ci.appveyor.com/api/projects/status/github/{{{USER}}}/{{{PKG}}}.jl?svg=true", "https://ci.appveyor.com/project/{{{USER}}}/{{{PKG}}}-jl", ) function view(p::AppVeyor, t::Template, pkg::AbstractString) platforms = ["x64"] p.x86 && push!(platforms, "x86") versions = collect_versions(t, p.extra_versions) allow_failures = filter(in(versions), ALLOWED_FAILURES) return Dict( "ALLOW_FAILURES" => allow_failures, "BRANCH" => something(default_branch(t), DEFAULT_DEFAULT_BRANCH), "HAS_ALLOW_FAILURES" => !isempty(allow_failures), "HAS_CODECOV" => p.coverage && hasplugin(t, Codecov), "PKG" => pkg, "PLATFORMS" => platforms, "USER" => t.user, "VERSIONS" => versions, ) end """ CirrusCI(; file="$(contractuser(default_file("cirrus.yml")))", image="freebsd-12-0-release-amd64", coverage=true, extra_versions=$DEFAULT_CI_VERSIONS, ) Integrates your packages with [Cirrus CI](https://cirrus-ci.org) via [CirrusCI.jl](https://github.com/ararslan/CirrusCI.jl). ## Keyword Arguments - `file::AbstractString`: Template file for `.cirrus.yml`. - `image::AbstractString`: The FreeBSD image to be used. - `coverage::Bool`: Whether or not to publish code coverage. [`Codecov`](@ref) must also be included. $EXTRA_VERSIONS_DOC !!! note Code coverage submission from Cirrus CI is not yet supported by [Coverage.jl](https://github.com/JuliaCI/Coverage.jl). """ @plugin struct CirrusCI <: FilePlugin file::String = default_file("cirrus.yml") image::String = "freebsd-12-0-release-amd64" coverage::Bool = true extra_versions::Vector = DEFAULT_CI_VERSIONS end source(p::CirrusCI) = p.file destination(::CirrusCI) = ".cirrus.yml" badges(::CirrusCI) = Badge( "Build Status", "https://api.cirrus-ci.com/github/{{{USER}}}/{{{PKG}}}.jl.svg", "https://cirrus-ci.com/github/{{{USER}}}/{{{PKG}}}.jl", ) function view(p::CirrusCI, t::Template, pkg::AbstractString) return Dict( "HAS_CODECOV" => hasplugin(t, Codecov), "HAS_COVERALLS" => hasplugin(t, Coveralls), "HAS_COVERAGE" => p.coverage && hasplugin(t, is_coverage), "IMAGE" => p.image, "PKG" => pkg, "USER" => t.user, "VERSIONS" => collect_versions(t, p.extra_versions), ) end """ GitLabCI(; file="$(contractuser(default_file("gitlab-ci.yml")))", coverage=true, extra_versions=$DEFAULT_CI_VERSIONS_NO_PRERELEASE, ) Integrates your packages with [GitLab CI](https://docs.gitlab.com/ce/ci). ## Keyword Arguments - `file::AbstractString`: Template file for `.gitlab-ci.yml`. - `coverage::Bool`: Whether or not to compute code coverage. $EXTRA_VERSIONS_DOC ## GitLab Pages Documentation can be generated by including a `Documenter{GitLabCI}` plugin. See [`Documenter`](@ref) for more information. !!! note Nightly Julia is not supported. """ @plugin struct GitLabCI <: FilePlugin file::String = default_file("gitlab-ci.yml") coverage::Bool = true # Nightly has no Docker image. extra_versions::Vector = DEFAULT_CI_VERSIONS_NO_PRERELEASE end gitignore(p::GitLabCI) = p.coverage ? COVERAGE_GITIGNORE : String[] source(p::GitLabCI) = p.file destination(::GitLabCI) = ".gitlab-ci.yml" function badges(p::GitLabCI) ci = Badge( "Build Status", "https://{{{HOST}}}/{{{USER}}}/{{{PKG}}}.jl/badges/{{{BRANCH}}}/pipeline.svg", "https://{{{HOST}}}/{{{USER}}}/{{{PKG}}}.jl/pipelines", ) cov = Badge( "Coverage", "https://{{{HOST}}}/{{{USER}}}/{{{PKG}}}.jl/badges/{{{BRANCH}}}/coverage.svg", "https://{{{HOST}}}/{{{USER}}}/{{{PKG}}}.jl/commits/{{{BRANCH}}}", ) return p.coverage ? [ci, cov] : [ci] end function view(p::GitLabCI, t::Template, pkg::AbstractString) return Dict( "BRANCH" => something(default_branch(t), DEFAULT_DEFAULT_BRANCH), "HAS_COVERAGE" => p.coverage, "HAS_DOCUMENTER" => hasplugin(t, Documenter{GitLabCI}), "HOST" => t.host, "PKG" => pkg, "USER" => t.user, "VERSION" => format_version(t.julia), "VERSIONS" => collect_versions(t, p.extra_versions), ) end """ DroneCI(; file="$(contractuser(default_file("drone.star")))", amd64=true, arm=false, arm64=false, extra_versions=$DEFAULT_CI_VERSIONS_NO_PRERELEASE, ) Integrates your packages with [Drone CI](https://drone.io). ## Keyword Arguments - `file::AbstractString`: Template file for `.drone.star`. - `destination::AbstractString`: File destination, relative to the repository root. For example, you might want to generate a `.drone.yml` instead of the default Starlark file. - `amd64::Bool`: Whether or not to run builds on AMD64. - `arm::Bool`: Whether or not to run builds on ARM (32-bit). - `arm64::Bool`: Whether or not to run builds on ARM64. $EXTRA_VERSIONS_DOC !!! note Nightly Julia is not supported. """ @plugin struct DroneCI <: FilePlugin file::String = default_file("drone.star") destination::String = ".drone.star" amd64::Bool = true arm::Bool = false arm64::Bool = false extra_versions::Vector = DEFAULT_CI_VERSIONS_NO_PRERELEASE end source(p::DroneCI) = p.file destination(p::DroneCI) = p.destination badges(::DroneCI) = Badge( "Build Status", "https://cloud.drone.io/api/badges/{{{USER}}}/{{{PKG}}}.jl/status.svg", "https://cloud.drone.io/{{{USER}}}/{{{PKG}}}.jl", ) function view(p::DroneCI, t::Template, pkg::AbstractString) arches = String[] p.amd64 && push!(arches, "amd64") p.arm && push!(arches, "arm") p.arm64 && push!(arches, "arm64") return Dict( "ARCHES" => join(map(repr, arches), ", "), "PKG" => pkg, "USER" => t.user, "VERSIONS" => join(map(repr, collect_versions(t, p.extra_versions)), ", "), ) end """ collect_versions(t::Template, versions::Vector) -> Vector{String} Combine `t`'s Julia version with `versions`, and format them as `major.minor`. This is useful for creating lists of versions to be included in CI configurations. """ function collect_versions(t::Template, versions::Vector) custom = map(v -> v isa VersionNumber ? format_version(v) : string(v), versions) vs = map(v -> lstrip(v, 'v'), [format_version(t.julia); custom]) filter!(vs) do v # Throw away any versions lower than the template's minimum. # but v1.6 should be accepted as a CI number even when t.julia = v1.6.7 try Base.thisminor(VersionNumber(v)) >= Base.thisminor(t.julia) catch e e isa ArgumentError || rethrow() true end end return sort(unique(vs)) end const AllCI = Union{AppVeyor, GitHubActions, TravisCI, CirrusCI, GitLabCI, DroneCI} """ is_ci(::Plugin) -> Bool Determine whether or not a plugin is a CI plugin. If you are adding a CI plugin, you should implement this function and return `true`. """ is_ci(::Plugin) = false is_ci(::AllCI) = true needs_username(::AllCI) = true customizable(::Type{<:AllCI}) = (:extra_versions => Vector{String},) ================================================ FILE: src/plugins/citation.jl ================================================ """ Citation(; file="$(contractuser(default_file("CITATION.bib")))", readme=false) Creates a `CITATION.bib` file for citing package repositories. ## Keyword Arguments - `file::AbstractString`: Template file for `CITATION.bib`. - `readme::Bool`: Whether or not to include a section about citing in the README. """ @plugin struct Citation <: FilePlugin file::String = default_file("CITATION.bib") readme::Bool = false end tags(::Citation) = "<<", ">>" source(p::Citation) = p.file destination(::Citation) = "CITATION.bib" view(::Citation, t::Template, pkg::AbstractString) = Dict( "AUTHORS" => join(t.authors, ", "), "MONTH" => month(today()), "PKG" => pkg, "URL" => "https://$(t.host)/$(t.user)/$pkg.jl", "VERSION" => "v$(first([p for p in t.plugins if p isa ProjectFile]).version)", "YEAR" => year(today()), ) needs_username(::Citation) = true ================================================ FILE: src/plugins/codeowners.jl ================================================ """ CodeOwners <: Plugin CodeOwners(; owners) A plugin which created GitLab/GitHub compatible CODEOWNERS files. owners should be a vector of patterns mapped to a vector of owner names. For example: `owners=["*"=>["@invenia"], "README.md"=>["@documentation","@oxinabox]]` assigns general ownership over all files to the invenia group, but assigns ownership of the readme to the documentation group and to the user oxinabox. By default, it creates an empty CODEOWNERS file. """ @plugin struct CodeOwners <: Plugin owners::Vector{Pair{String,Vector{String}}} = Vector{Pair{String,Vector{String}}}() end PkgTemplates.destination(::CodeOwners) = "CODEOWNERS" function render_plugin(p::CodeOwners) join((pattern * " " * join(subowners, " ") for (pattern, subowners) in p.owners), "\n") end function PkgTemplates.hook(p::CodeOwners, ::Template, pkg_dir::AbstractString) path = joinpath(pkg_dir, destination(p)) text = render_plugin(p) PkgTemplates.gen_file(path, text) end function PkgTemplates.validate(p::CodeOwners, ::Template) for (pattern, subowners) in p.owners contains(pattern, r"\s") && throw(ArgumentError(("Pattern ($pattern) must not contain whitespace"))) for subowner in subowners contains(subowner, r"\s") && throw(ArgumentError("Owner name ($subowner) must not contain whitespace")) '@' ∈ subowner || throw(ArgumentError("Owner name ($subowner) must be `@user` or `email@domain.com`")) end end end ================================================ FILE: src/plugins/compat_helper.jl ================================================ """ CompatHelper(; file="$(contractuser(default_file("github", "workflows", "CompatHelper.yml")))", destination="CompatHelper.yml", cron="0 0 * * *", ) Integrates your packages with [CompatHelper](https://github.com/bcbi/CompatHelper.jl) via GitHub Actions. !!! note "Deprecated in favor of Dependabot" As of December 2025, [Dependabot supports Julia](https://github.blog/changelog/2025-12-16-dependabot-version-updates-now-support-julia/) and is now the recommended approach for keeping package dependencies up to date. The [`Dependabot`](@ref) plugin is included in the default template plugins. `CompatHelper` remains available for users who prefer it. ## Keyword Arguments - `file::AbstractString`: Template file for the workflow file. - `destination::AbstractString`: Destination of the workflow file, relative to `.github/workflows`. - `cron::AbstractString`: Cron expression for the schedule interval. """ @plugin struct CompatHelper <: FilePlugin file::String = default_file("github", "workflows", "CompatHelper.yml") destination::String = "CompatHelper.yml" cron::String = "0 0 * * *" end source(p::CompatHelper) = p.file destination(p::CompatHelper) = joinpath(".github", "workflows", p.destination) tags(::CompatHelper) = "<<", ">>" view(p::CompatHelper, ::Template, ::AbstractString) = Dict("CRON" => p.cron) ================================================ FILE: src/plugins/coverage.jl ================================================ const COVERAGE_GITIGNORE = ["*.jl.cov", "*.jl.*.cov", "*.jl.mem"] """ Codecov(; file=nothing) Sets up code coverage submission from CI to [Codecov](https://codecov.io). ## Keyword Arguments - `file::Union{AbstractString, Nothing}`: Template file for `.codecov.yml`, or `nothing` to create no file. """ @plugin struct Codecov <: FilePlugin file::Union{String, Nothing} = nothing end source(p::Codecov) = p.file destination(::Codecov) = ".codecov.yml" badges(::Codecov) = Badge( "Coverage", "https://codecov.io/gh/{{{USER}}}/{{{PKG}}}.jl/branch/{{{BRANCH}}}/graph/badge.svg", "https://codecov.io/gh/{{{USER}}}/{{{PKG}}}.jl", ) """ Coveralls(; file=nothing) Sets up code coverage submission from CI to [Coveralls](https://coveralls.io). ## Keyword Arguments - `file::Union{AbstractString, Nothing}`: Template file for `.coveralls.yml`, or `nothing` to create no file. """ @plugin struct Coveralls <: FilePlugin file::Union{String, Nothing} = nothing end source(p::Coveralls) = p.file destination(::Coveralls) = ".coveralls.yml" badges(::Coveralls) = Badge( "Coverage", "https://coveralls.io/repos/github/{{{USER}}}/{{{PKG}}}.jl/badge.svg?branch={{{BRANCH}}}", "https://coveralls.io/github/{{{USER}}}/{{{PKG}}}.jl?branch={{{BRANCH}}}", ) gitignore(::Union{Codecov, Coveralls}) = COVERAGE_GITIGNORE view(::Union{Codecov, Coveralls}, t::Template, pkg::AbstractString) = Dict( "BRANCH" => something(default_branch(t), DEFAULT_DEFAULT_BRANCH), "PKG" => pkg, "USER" => t.user, ) """ is_coverage(::Plugin) -> Bool Determine whether or not a plugin is a coverage plugin. If you are adding a coverage plugin, you should implement this function and return `true`. """ is_coverage(::Plugin) = false is_coverage(::Union{Codecov, Coveralls}) = true needs_username(::Union{Codecov, Coveralls}) = true ================================================ FILE: src/plugins/dependabot.jl ================================================ """ Dependabot(; file="$(contractuser(default_file("github", "dependabot.yml")))") Sets up Dependabot to create PRs whenever GitHub Actions or Julia package dependencies can be updated. Monitors the root `/`, `/docs`, and `/test` directories for Julia dependencies. As of December 2025, [Dependabot supports Julia](https://github.blog/changelog/2025-12-16-dependabot-version-updates-now-support-julia/) and is the recommended approach for keeping package dependencies up to date. This replaces the functionality previously provided by [`CompatHelper`](@ref). !!! note "Only for GitHub actions" Currently, this plugin is configured to setup Dependabot only for the GitHub actions package ecosystem. For example, it will create PRs whenever GitHub actions such as `uses: actions/checkout@v5` can be updated to `uses: actions/checkout@v6`. If you want to configure Dependabot to update other package ecosystems, please modify the resulting file yourself. ## Keyword Arguments - `file::AbstractString`: Template file for `dependabot.yml`. """ @plugin struct Dependabot <: FilePlugin file::String = default_file("github", "dependabot.yml") end source(p::Dependabot) = p.file destination(::Dependabot) = joinpath(".github", "dependabot.yml") ================================================ FILE: src/plugins/develop.jl ================================================ """ Develop() Adds generated packages to the current environment by `dev`ing them. See the Pkg documentation [here](https://julialang.github.io/Pkg.jl/v1/managing-packages/#Developing-packages-1) for more details. """ struct Develop <: Plugin end function posthook(::Develop, ::Template, pkg_dir::AbstractString) Pkg.develop(PackageSpec(; path=pkg_dir)) end ================================================ FILE: src/plugins/documenter.jl ================================================ const DOCUMENTER_DEP = PackageSpec(; name="Documenter", uuid="e30172f5-a6a5-5a46-863b-614d45cd2de4", ) struct NoDeploy end const YesDeploy = Union{TravisCI, GitHubActions, GitLabCI} const GitHubPagesStyle = Union{TravisCI, GitHubActions} """ Logo(; light=nothing, dark=nothing) Logo information for documentation. ## Keyword Arguments - `light::AbstractString`: Path to a logo file for the light (default) theme. - `dark::AbstractString`: Path to a logo file for the dark theme. """ @with_kw_noshow struct Logo light::Union{String, Nothing} = nothing dark::Union{String, Nothing} = nothing end """ Documenter{T}(; make_jl="$(contractuser(default_file("docs", "make.jlt")))", index_md="$(contractuser(default_file("docs", "src", "index.md")))", assets=String[], logo=Logo(), canonical_url=make_canonical(T), devbranch=nothing, edit_link=:devbranch, makedocs_kwargs=Dict{Symbol,Any}(), ) Sets up documentation generation via [Documenter.jl](https://github.com/JuliaDocs/Documenter.jl). Documentation deployment depends on `T`, where `T` is some supported CI plugin, or `Nothing` to only support local documentation builds. !!! note If you are deploying documentation with GitHub Actions or Travis CI, don't forget to complete [the required configuration](https://documenter.juliadocs.org/stable/man/hosting/#Hosting-Documentation). In particular, you may need to run ```julia using DocumenterTools; DocumenterTools.genkeys(user="MyUser", repo="MyPackage.jl") ``` and follow the instructions there. ## Supported Type Parameters - `GitHubActions`: Deploys documentation to [GitHub Pages](https://pages.github.com) with the help of [`GitHubActions`](@ref). - `TravisCI`: Deploys documentation to [GitHub Pages](https://pages.github.com) with the help of [`TravisCI`](@ref). - `GitLabCI`: Deploys documentation to [GitLab Pages](https://pages.gitlab.com) with the help of [`GitLabCI`](@ref). - `NoDeploy` (default): Does not set up documentation deployment. ## Keyword Arguments - `make_jl::AbstractString`: Template file for `make.jl`. - `index_md::AbstractString`: Template file for `index.md`. - `assets::Vector{<:AbstractString}`: Extra assets for the generated site. - `logo::Logo`: A [`Logo`](@ref) containing documentation logo information. - `canonical_url::Union{Function, Nothing}`: A function to generate the site's canonical URL. The default value will compute GitHub Pages and GitLab Pages URLs for [`TravisCI`](@ref) and [`GitLabCI`](@ref), respectively. If set to `nothing`, no canonical URL is set. - `edit_link::Union{AbstractString, Symbol, Nothing}`: Branch, tag or commit that the "Edit on…" link will point to. Defaults to the branch identified by `devbranch`. If `edit_link=:commit`, then the link will point to the latest commit when docs are built. If `edit_link=nothing`, then the "Edit on…" link will be hidden altogether. - `devbranch::Union{AbstractString, Nothing}`: Branch that will trigger docs deployment. If `nothing`, then the default branch according to the `Template` will be used. - `makedocs_kwargs::Dict{Symbol,Any}`: Extra keyword arguments to be inserted into `makedocs`. """ struct Documenter{T} <: Plugin assets::Vector{String} logo::Logo makedocs_kwargs::Dict{Symbol} canonical_url::Union{Function, Nothing} make_jl::String index_md::String devbranch::Union{String, Nothing} edit_link::Union{String, Symbol, Nothing} end # Can't use @plugin because we're implementing our own no-arguments constructor. function Documenter{T}(; assets::Vector{<:AbstractString}=String[], 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.jlt"), index_md::AbstractString=default_file("docs", "src", "index.md"), devbranch::Union{AbstractString, Nothing}=nothing, edit_link::Union{AbstractString, Symbol, Nothing}=:devbranch, ) where {T} return Documenter{T}( assets, logo, makedocs_kwargs, canonical_url, make_jl, index_md, devbranch, edit_link, ) end 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.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 gitignore(::Documenter) = ["/docs/build/", "/docs/Manifest*.toml"] priority(::Documenter, ::Function) = DEFAULT_PRIORITY - 1 # We need SrcDir to go first. badges(::Documenter) = Badge[] badges(::Documenter{<:GitHubPagesStyle}) = [ Badge( "Stable", "https://img.shields.io/badge/docs-stable-blue.svg", "https://{{{USER}}}.github.io/{{{PKG}}}.jl/stable/", ), Badge( "Dev", "https://img.shields.io/badge/docs-dev-blue.svg", "https://{{{USER}}}.github.io/{{{PKG}}}.jl/dev/", ), ] badges(::Documenter{GitLabCI}) = Badge( "Dev", "https://img.shields.io/badge/docs-dev-blue.svg", # TODO: Support custom domain here. "https://{{{USER}}}.gitlab.io/{{{PKG}}}.jl/dev", ) function view(p::Documenter, t::Template, pkg::AbstractString) devbranch = p.devbranch === nothing ? default_branch(t) : p.devbranch return Dict( "ASSETS" => map(basename, p.assets), "AUTHORS" => join(t.authors, ", "), "CANONICAL" => p.canonical_url === nothing ? nothing : p.canonical_url(t, pkg), "HAS_ASSETS" => !isempty(p.assets), "MAKEDOCS_KWARGS" => map(((k, v),) -> k => repr(v), sort(collect(p.makedocs_kwargs), by=first)), "PKG" => pkg, "REPO" => "$(t.host)/$(t.user)/$pkg.jl", "USER" => t.user, "BRANCH" => devbranch, "EDIT_LINK" => p.edit_link == :devbranch ? _quoted(devbranch) : _quoted(p.edit_link), ) end # So both Symbol and Strings get interpolated correctly into `{{{s}}}`. _quoted(s::AbstractString) = string('"', s, '"') _quoted(s::Symbol) = repr(s) function view(p::Documenter{<:GitHubPagesStyle}, t::Template, pkg::AbstractString) base = invoke(view, Tuple{Documenter, Template, AbstractString}, p, t, pkg) return merge(base, Dict("HAS_DEPLOY" => true)) end function validate(p::Documenter, ::Template) foreach(p.assets) do a isfile(a) || throw(ArgumentError("Asset file $a does not exist")) end foreach((:light, :dark)) do k logo = getfield(p.logo, k) if logo !== nothing && !isfile(logo) throw(ArgumentError("Logo file $logo does not exist")) end end end function validate(p::Documenter{T}, t::Template) where T <: YesDeploy invoke(validate, Tuple{Documenter, Template}, p, t) if !hasplugin(t, T) name = nameof(T) s = "Documenter: The $name plugin must be included for docs deployment to be set up" throw(ArgumentError(s)) end end function hook(p::Documenter, t::Template, pkg_dir::AbstractString) pkg = pkg_name(pkg_dir) docs_dir = joinpath(pkg_dir, "docs") # Generate files. make = render_file(p.make_jl, combined_view(p, t, pkg), tags(p)) index = render_file(p.index_md, combined_view(p, t, pkg), tags(p)) gen_file(joinpath(docs_dir, "make.jl"), make) gen_file(joinpath(docs_dir, "src", "index.md"), index) # Copy over any assets. assets_dir = joinpath(docs_dir, "src", "assets") mkpath(assets_dir) foreach(a -> cp(a, joinpath(assets_dir, basename(a))), p.assets) foreach((:light => "logo", :dark => "logo-dark")) do (k, f) logo = getfield(p.logo, k) if logo !== nothing _, ext = splitext(logo) cp(logo, joinpath(assets_dir, "$f$ext")) end end isempty(readdir(assets_dir)) && rm(assets_dir) # Create the documentation project. with_project(docs_dir) do Pkg.add(DOCUMENTER_DEP) cd(() -> Pkg.develop(PackageSpec(; path="..")), docs_dir) end end github_pages_url(t::Template, pkg::AbstractString) = "https://$(t.user).github.io/$pkg.jl" gitlab_pages_url(t::Template, pkg::AbstractString) = "https://$(t.user).gitlab.io/$pkg.jl" make_canonical(::Type{<:GitHubPagesStyle}) = github_pages_url make_canonical(::Type{GitLabCI}) = gitlab_pages_url make_canonical(::Type{NoDeploy}) = nothing needs_username(::Documenter) = true function customizable(::Type{<:Documenter}) return (:canonical_url => NotCustomizable, :makedocs_kwargs => NotCustomizable) end function interactive(::Type{Documenter}) styles = [NoDeploy, TravisCI, GitLabCI, GitHubActions] menu = RadioMenu(map(string, styles); pagesize=length(styles)) println("Documenter deploy style:") idx = request(menu) return interactive(Documenter{styles[idx]}) end function prompt(::Type{<:Documenter}, ::Type{Logo}, ::Val{:logo}) light = Base.prompt("Enter value for 'logo.light' (default: nothing)") dark = Base.prompt("Enter value for 'logo.dark' (default: nothing)") return Logo(; light=light, dark=dark) end ================================================ FILE: src/plugins/formatter.jl ================================================ """ Formatter(; file="$(contractuser(default_file(".JuliaFormatter.toml")))", style="nostyle" ) Create a `.JuliaFormatter.toml` file, used by [JuliaFormatter.jl](https://github.com/domluna/JuliaFormatter.jl) and the Julia VSCode extension to configure automatic code formatting. This file can be entirely customized by the user, see the [JuliaFormatter.jl docs](https://domluna.github.io/JuliaFormatter.jl/stable/). ## Keyword Arguments - `file::String`: Template file for `.JuliaFormatter.toml`. - `style::String`: Style name, defaults to `"nostyle"` for an empty style but can also be one of `("sciml", "blue", "yas")` for a fully preconfigured style. """ @plugin struct Formatter <: FilePlugin file::String = default_file(".JuliaFormatter.toml") style::String = "nostyle" end function validate(p::Formatter, t::Template) if p.style ∉ ("nostyle", "blue", "sciml", "yas") throw(ArgumentError("""JuliaFormatter style must be either "nostyle", "blue", "sciml" or "yas".""")) end end source(p::Formatter) = p.file destination(::Formatter) = ".JuliaFormatter.toml" function view(p::Formatter, t::Template, pkg::AbstractString) d = Dict{String,String}() if p.style == "nostyle" d["STYLE"] = "" else d["STYLE"] = """style = \"$(p.style)\"""" end return d end function prompt(::Type{Formatter}, ::Type{String}, ::Val{:style}) options = ["nostyle", "blue", "sciml", "yas"] menu = RadioMenu(options; pagesize=length(options)) println("Select a JuliaFormatter style:") idx = request(menu) return options[idx] end struct Runic{T} <: Plugin end Runic() = Runic{GitHubActions}() function validate(::Runic{T}, t::Template) where {T} if T === GitHubActions hasplugin(t, T) || throw(ArgumentError("Runic: The GitHubActions plugin must be included")) else throw(ArgumentError("Runic: Only GitHubActions is supported at the moment")) end end ================================================ FILE: src/plugins/git.jl ================================================ const DEFAULT_DEFAULT_BRANCH = "main" """ Git(; ignore=String[], name=nothing, email=nothing, branch=LibGit2.getconfig("init.defaultBranch", "$DEFAULT_DEFAULT_BRANCH") ssh=false, jl=true, manifest=false, gpgsign=false, ) Creates a Git repository and a `.gitignore` file. ## Keyword Arguments - `ignore::Vector{<:AbstractString}`: Patterns to add to the `.gitignore`. See also: [`gitignore`](@ref). - `name::AbstractString`: Your real name, if you have not set `user.name` with Git. - `email::AbstractString`: Your email address, if you have not set `user.email` with Git. - `branch::AbstractString`: The desired name of the repository's default branch. - `ssh::Bool`: Whether or not to use SSH for the remote. If left unset, HTTPS is used. - `jl::Bool`: Whether or not to add a `.jl` suffix to the remote URL. - `manifest::Bool`: Whether or not to commit `Manifest.toml`. - `gpgsign::Bool`: Whether or not to sign commits with your GPG key. This option requires that the Git CLI is installed, and for you to have a GPG key associated with your committer identity. """ @plugin struct Git <: Plugin ignore::Vector{String} = String[] name::Union{String, Nothing} = nothing email::Union{String, Nothing} = nothing branch::String = @mock(LibGit2.getconfig("init.defaultBranch", DEFAULT_DEFAULT_BRANCH)) ssh::Bool = false jl::Bool = true manifest::Bool = false gpgsign::Bool = false end # Try to make sure that no files are created after we commit. priority(::Git, ::typeof(posthook)) = 5 gitignore(p::Git) = p.ignore function validate(p::Git, t::Template) if p.gpgsign && !git_is_installed() throw(ArgumentError("Git: gpgsign is set but the Git CLI is not installed")) end foreach((:name, :email)) do k user_k = "user.$k" if getproperty(p, k) === nothing && isempty(@mock LibGit2.getconfig(user_k, "")) throw(ArgumentError("Git: Global Git config is missing required value '$user_k'")) end end end # Set up the Git repository. function prehook(p::Git, t::Template, pkg_dir::AbstractString) LibGit2.with(@mock LibGit2.init(pkg_dir)) do repo LibGit2.with(GitConfig(repo)) do config foreach((:name, :email)) do k v = getproperty(p, k) v === nothing || LibGit2.set!(config, "user.$k", v) end end commit(p, repo, pkg_dir, "Initial commit") pkg = pkg_name(pkg_dir) suffix = p.jl ? ".jl" : "" url = if p.ssh "git@$(t.host):$(t.user)/$pkg$suffix.git" else "https://$(t.host)/$(t.user)/$pkg$suffix" end default = LibGit2.branch(repo) branch = something(p.branch, default) if branch != default LibGit2.branch!(repo, branch) delete_branch(GitReference(repo, "refs/heads/$default")) end close(GitRemote(repo, "origin", url)) end end # Create the .gitignore. function hook(p::Git, t::Template, pkg_dir::AbstractString) ignore = mapreduce(gitignore, vcat, t.plugins) # Only ignore manifests at the repo root. p.manifest || "Manifest.toml" in ignore || push!(ignore, "/Manifest*.toml") unique!(sort!(ignore)) gen_file(joinpath(pkg_dir, ".gitignore"), join(ignore, "\n")) end # Commit the files. function posthook(p::Git, ::Template, pkg_dir::AbstractString) # Special case for issue 211. if Sys.iswindows() files = filter(f -> startswith(f, "_git2_"), readdir(pkg_dir)) foreach(f -> rm(joinpath(pkg_dir, f)), files) end # Ensure that the manifest exists if it's going to be committed. manifest = joinpath(pkg_dir, "Manifest.toml") if p.manifest && !isfile(manifest) with_project(Pkg.update, pkg_dir) end LibGit2.with(GitRepo(pkg_dir)) do repo LibGit2.add!(repo, ".") msg = "Files generated by PkgTemplates" v = @mock version_of("PkgTemplates") v === nothing || (msg *= "\n\nPkgTemplates version: $v") # TODO: Put the template config in the message too? commit(p, repo, pkg_dir, msg) end end function commit(p::Git, repo::GitRepo, pkg_dir::AbstractString, msg::AbstractString) if p.gpgsign run(pipeline(`git -C $pkg_dir commit -S --allow-empty -m $msg`; stdout=devnull)) else LibGit2.commit(repo, msg) end end needs_username(::Git) = true function git_is_installed() return try run(pipeline(`git --version`; stdout=devnull)) true catch false end end if isdefined(Pkg, :dependencies) function version_of(pkg::AbstractString) for p in values(Pkg.dependencies()) p.name == pkg && return p.version end return nothing end else version_of(pkg::AbstractString) = get(Pkg.installed(), pkg, nothing) end ================================================ FILE: src/plugins/license.jl ================================================ """ License(; name="MIT", path=nothing, destination="LICENSE") Creates a license file. ## Keyword Arguments - `name::AbstractString`: Name of a license supported by PkgTemplates. Available licenses can be seen [here](https://github.com/JuliaCI/PkgTemplates.jl/tree/master/templates/licenses). - `path::Union{AbstractString, Nothing}`: Path to a custom license file. This keyword takes priority over `name`. - `destination::AbstractString`: File destination, relative to the repository root. For example, `"LICENSE.md"` might be desired. """ struct License <: FilePlugin path::String destination::String end const LICENSE_ALIASES = Dict( # Legacy names kept for backward compatibility; prefer SPDX identifiers. "ASL" => "Apache-2.0", "BSD2" => "BSD-2-Clause", "BSD3" => "BSD-3-Clause", "MPL" => "MPL-2.0", "EUPL-1.2+" => "EUPL-1.2", "AGPL-3.0+" => "AGPL-3.0-or-later", "GPL-2.0+" => "GPL-2.0-or-later", "GPL-3.0+" => "GPL-3.0-or-later", "LGPL-2.1+" => "LGPL-2.1-or-later", "LGPL-3.0+" => "LGPL-3.0-or-later", ) function License(; name::AbstractString="MIT", path::Union{AbstractString, Nothing}=nothing, destination::AbstractString="LICENSE", ) if path === nothing if haskey(LICENSE_ALIASES, name) new = LICENSE_ALIASES[name] Base.depwarn("License name \"$name\" is deprecated; use \"$new\" instead.", :License) name = new end path = default_file("licenses", name) isfile(path) || throw(ArgumentError("License '$(basename(path))' is not available")) end return License(path, destination) end defaultkw(::Type{License}, ::Val{:path}) = nothing defaultkw(::Type{License}, ::Val{:name}) = "MIT" defaultkw(::Type{License}, ::Val{:destination}) = "LICENSE" source(p::License) = p.path destination(p::License) = p.destination view(::License, t::Template, ::AbstractString) = Dict( "AUTHORS" => join(t.authors, ", "), "YEAR" => year(today()), ) function prompt(::Type{License}, ::Type, ::Val{:name}) options = readdir(default_file("licenses")) # Move MIT to the top. deleteat!(options, findfirst(==("MIT"), options)) pushfirst!(options, "MIT") menu = RadioMenu(options; pagesize=length(options)) println("Select a license:") idx = request(menu) return options[idx] end customizable(::Type{License}) = (:name => String,) ================================================ FILE: src/plugins/pkgbenchmark.jl ================================================ """ PkgBenchmark(; file="$(contractuser(default_file("benchmark", "benchmarks.jlt")))") Sets up a [PkgBenchmark.jl](https://github.com/JuliaCI/PkgBenchmark.jl) benchmark suite. To ensure benchmark reproducibility, you will need to manually create an environment in the `benchmark` subfolder (for which the `Manifest.toml` is committed to version control). In this environment, you should at the very least: - `pkg> add BenchmarkTools` - `pkg> dev` your new package. ## Keyword Arguments - `file::AbstractString`: Template file for `benchmarks.jl`. """ @plugin struct PkgBenchmark <: FilePlugin file::String = default_file("benchmark", "benchmarks.jlt") end source(p::PkgBenchmark) = p.file destination(::PkgBenchmark) = joinpath("benchmark", "benchmarks.jl") view(::PkgBenchmark, ::Template, pkg::AbstractString) = Dict("PKG" => pkg) ================================================ FILE: src/plugins/project_file.jl ================================================ """ ProjectFile(; version=v"1.0.0-DEV") Creates a `Project.toml`. ## Keyword Arguments - `version::VersionNumber`: The initial version of created packages. """ @plugin struct ProjectFile <: Plugin version::VersionNumber = v"1.0.0-DEV" end # Other plugins like Tests will modify this file. priority(::ProjectFile, ::typeof(hook)) = typemax(Int) - 5 function hook(p::ProjectFile, t::Template, pkg_dir::AbstractString) toml = Dict( "name" => pkg_name(pkg_dir), "uuid" => string(@mock uuid4()), "authors" => t.authors, "version" => string(p.version), "compat" => Dict("julia" => compat_version(t.julia)), ) write_project(joinpath(pkg_dir, "Project.toml"), toml) end # Taken from: # https://github.com/JuliaLang/Pkg.jl/blob/v1.7.0/src/project.jl#L175-L177 function project_key_order(key::String) _project_key_order = ["name", "uuid", "keywords", "license", "desc", "deps", "compat"] return something(findfirst(x -> x == key, _project_key_order), length(_project_key_order) + 1) end write_project(path::AbstractString, dict) = open(io -> write_project(io, dict), path; write = true) write_project(io::IO, dict) = TOML.print(io, dict, sorted = true, by = key -> (project_key_order(key), key)) """ compat_version(v::VersionNumber) -> String Format a `VersionNumber` to exclude trailing zero components. """ function compat_version(v::VersionNumber) return if v.patch == 0 && v.minor == 0 "$(v.major)" elseif v.patch == 0 "$(v.major).$(v.minor)" else "$(v.major).$(v.minor).$(v.patch)" end end ================================================ FILE: src/plugins/readme.jl ================================================ """ Readme(; file="$(contractuser(default_file("README.md")))", destination="README.md", inline_badges=false, ) Creates a `README` file that contains badges for other included plugins. ## Keyword Arguments - `file::AbstractString`: Template file for the `README`. - `destination::AbstractString`: File destination, relative to the repository root. For example, values of `"README"` or `"README.rst"` might be desired. - `inline_badges::Bool`: Whether or not to put the badges on the same line as the package name. - `badge_order::Vector{typeof(Plugin)}`: Plugins in the order their badges should appear. - `badge_off::Vector{typeof(Plugin)}`: Plugins which should not have their badges added. """ @plugin struct Readme <: FilePlugin file::String = default_file("README.md") destination::String = "README.md" inline_badges::Bool = false badge_order::Vector{typeof(Plugin)} = default_badge_order() badge_off::Vector{typeof(Plugin)} = [] end source(p::Readme) = p.file destination(p::Readme) = p.destination function view(p::Readme, t::Template, pkg::AbstractString) # Explicitly ordered badges go first. strings = String[] done = DataType[] foreach(p.badge_order) do T if hasplugin(t, T) && !in(T, p.badge_off) append!(strings, badges(getplugin(t, T), t, pkg)) push!(done, T) end end # And the rest go after, in no particular order. foreach(setdiff(map(typeof, t.plugins), done)) do T if !in(T, p.badge_off) append!(strings, badges(getplugin(t, T), t, pkg)) end end return Dict( "BADGES" => strings, "HAS_CITATION" => hasplugin(t, Citation) && getplugin(t, Citation).readme, "HAS_INLINE_BADGES" => !isempty(strings) && p.inline_badges, "PKG" => pkg, ) end default_badge_order() = [ Documenter{GitHubActions}, Documenter{GitLabCI}, Documenter{TravisCI}, GitHubActions, GitLabCI, TravisCI, AppVeyor, DroneCI, CirrusCI, Codecov, Coveralls, subtypes(BadgePlugin)... ] ================================================ FILE: src/plugins/register.jl ================================================ """ RegisterAction(; file="$(contractuser(default_file("github", "workflows", "Register.yml")))", destination="Register.yml", prompt="Version to register or component to bump", ) Add a GitHub Actions workflow for registering a package with the General registry via workflow dispatch. See [here](https://github.com/julia-actions/RegisterAction) for more information. ## Keyword Arguments - `file::AbstractString`: Template file for the workflow file. - `destination::AbstractString`: Destination of the workflow file, relative to `.github/workflows`. - `prompt::AbstractString`: Prompt for workflow dispatch. """ @plugin struct RegisterAction <: FilePlugin file::String = default_file("github", "workflows", "Register.yml") destination::String = "Register.yml" prompt::String = "Version to register or component to bump" end source(p::RegisterAction) = p.file destination(p::RegisterAction) = joinpath(".github", "workflows", p.destination) tags(::RegisterAction) = "<<", ">>" view(p::RegisterAction, ::Template, ::AbstractString) = Dict("PROMPT" => p.prompt) ================================================ FILE: src/plugins/src_dir.jl ================================================ """ SrcDir(; file="$(contractuser(default_file("src", "module.jlt")))") Creates a module entrypoint. ## Keyword Arguments - `file::AbstractString`: Template file for `src/.jl`. """ @plugin mutable struct SrcDir <: FilePlugin file::String = default_file("src", "module.jlt") destination::String = "" end Base.:(==)(a::SrcDir, b::SrcDir) = a.file == b.file # Don't display the destination field. function Base.show(io::IO, ::MIME"text/plain", p::SrcDir) indent = get(io, :indent, 0) print(io, repeat(' ', indent), "SrcDir:") print(io, "\n", repeat(' ', indent + 2), "file: ", show_field(p.file)) end source(p::SrcDir) = p.file destination(p::SrcDir) = p.destination view(::SrcDir, ::Template, pkg::AbstractString) = Dict("PKG" => pkg) # Update the destination now that we know the package name. # Kind of hacky, but oh well. function prehook(p::SrcDir, ::Template, pkg_dir::AbstractString) p.destination = joinpath("src", pkg_name(pkg_dir) * ".jl") end ================================================ FILE: src/plugins/tagbot.jl ================================================ """ TagBot(; file="$(contractuser(default_file("github", "workflows", "TagBot.yml")))", destination="TagBot.yml", trigger="JuliaTagBot", token=Secret("GITHUB_TOKEN"), ssh=Secret("DOCUMENTER_KEY"), ssh_password=nothing, changelog=nothing, changelog_ignore=nothing, gpg=nothing, gpg_password=nothing, registry=nothing, branches=nothing, dispatch=nothing, dispatch_delay=nothing, ) Adds GitHub release support via [TagBot](https://github.com/JuliaRegistries/TagBot). ## Keyword Arguments - `file::AbstractString`: Template file for the workflow file. - `destination::AbstractString`: Destination of the workflow file, relative to `.github/workflows`. - `trigger::AbstractString`: Username of the trigger user for custom registries. - `token::Secret`: Name of the token secret to use. - `ssh::Secret`: Name of the SSH private key secret to use. - `ssh_password::Secret`: Name of the SSH key password secret to use. - `changelog::AbstractString`: Custom changelog template. - `changelog_ignore::Vector{<:AbstractString}`: Issue/pull request labels to ignore in the changelog. - `gpg::Secret`: Name of the GPG private key secret to use. - `gpg_password::Secret`: Name of the GPG private key password secret to use. - `registry::AbstractString`: Custom registry, in the format `owner/repo`. - `branches::Bool`: Whether or not to enable the `branches` option. - `dispatch::Bool`: Whether or not to enable the `dispatch` option. - `dispatch_delay::Int`: Number of minutes to delay for dispatch events. """ @plugin struct TagBot <: FilePlugin file::String = default_file("github", "workflows", "TagBot.yml") destination::String = "TagBot.yml" trigger::String = "JuliaTagBot" token::Secret = Secret("GITHUB_TOKEN") ssh::Union{Secret, Nothing} = Secret("DOCUMENTER_KEY") ssh_password::Union{Secret, Nothing} = nothing changelog::Union{String, Nothing} = nothing changelog_ignore::Union{Vector{String}, Nothing} = nothing gpg::Union{Secret, Nothing} = nothing gpg_password::Union{Secret, Nothing} = nothing registry::Union{String, Nothing} = nothing branches::Union{Bool, Nothing} = nothing dispatch::Union{Bool, Nothing} = nothing dispatch_delay::Union{Int, Nothing} = nothing end source(p::TagBot) = p.file destination(p::TagBot) = joinpath(".github", "workflows", p.destination) function view(p::TagBot, ::Template, ::AbstractString) changelog = if p.changelog === nothing nothing else # This magic number aligns the text block just right. lines = map(line -> rstrip(repeat(' ', 12) * line), split(p.changelog, "\n")) "|\n" * join(lines, "\n") end ignore = p.changelog_ignore === nothing ? nothing : join(p.changelog_ignore, ", ") return Dict( "BRANCHES" => p.branches === nothing ? nothing : string(p.branches), "CHANGELOG" => changelog, "CHANGELOG_IGNORE" => ignore, "TRIGGER" => p.trigger, "DISPATCH" => p.dispatch === nothing ? nothing : string(p.dispatch), "DISPATCH_DELAY" => p.dispatch_delay, "GPG" => p.gpg, "GPG_PASSWORD" => p.gpg_password, "REGISTRY" => p.registry, "SSH" => p.ssh, "SSH_PASSWORD" => p.ssh_password, "TOKEN" => p.token, ) end ================================================ FILE: src/plugins/tests.jl ================================================ const TEST_UUID = "8dfed614-e22c-5e08-85e1-65c5234f0b40" const TEST_DEP = PackageSpec(; name="Test", uuid=TEST_UUID) const AQUA_UUID = "4c88cf16-eb10-579e-8560-4a9242c79595" const AQUA_DEP = PackageSpec(; name="Aqua", uuid=AQUA_UUID) const JET_UUID = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b" const JET_DEP = PackageSpec(; name="JET", uuid=JET_UUID) """ Tests(; file="$(contractuser(default_file("test", "runtests.jlt")))", project=false, aqua=false, aqua_kwargs=NamedTuple(), jet=false, ) Sets up testing for packages. ## Keyword Arguments - `file::AbstractString`: Template file for `runtests.jl`. - `project::Bool`: Whether or not to create a new project for tests (`test/Project.toml`). See [the Pkg docs](https://julialang.github.io/Pkg.jl/v1/creating-packages/#Test-specific-dependencies-in-Julia-1.2-and-above-1) for more details. - `aqua::Bool`: Controls whether or not to add quality tests with [Aqua.jl](https://github.com/JuliaTesting/Aqua.jl). - `aqua_kwargs::NamedTuple`: Which keyword arguments to supply to Aqua tests (many people use `ambiguities=false` for example) - `jet::Bool`: Controls whether or not to add a linting test with [JET.jl](https://github.com/aviatesk/JET.jl) (works best on type-stable code) !!! note Managing test dependencies with `test/Project.toml` is only supported in Julia 1.2 and later. """ @plugin struct Tests <: FilePlugin file::String = default_file("test", "runtests.jlt") project::Bool = false aqua::Bool = false aqua_kwargs::NamedTuple = NamedTuple() jet::Bool = false end source(p::Tests) = p.file destination(::Tests) = joinpath("test", "runtests.jl") function view(p::Tests, ::Template, pkg::AbstractString) d = Dict("PKG" => pkg) if p.aqua if isempty(p.aqua_kwargs) kwargs_str = "" else kwargs_str = "; " * strip(string(p.aqua_kwargs), ['(', ')']) end d["AQUA_IMPORT"] = "\nusing Aqua" d["AQUA_TESTSET"] = """ @testset "Code quality (Aqua.jl)" begin Aqua.test_all($pkg$kwargs_str) end """ else d["AQUA_IMPORT"] = "" d["AQUA_TESTSET"] = "" end if p.jet d["JET_IMPORT"] = "\nusing JET" d["JET_TESTSET"] = """ @testset "Code linting (JET.jl)" begin JET.test_package($pkg; target_defined_modules = true) end """ else d["JET_IMPORT"] = "" d["JET_TESTSET"] = "" end return d end function validate(p::Tests, t::Template) invoke(validate, Tuple{FilePlugin,Template}, p, t) p.project && t.julia < v"1.2" && @warn string( "Tests: The project option is set to create a project (supported in Julia 1.2 and later) ", "but a Julia version older than 1.2 ($(t.julia)) is supported by the template", ) aqua_kwargs_names = ( :ambiguities, :unbound_args, :undefined_exports, :piracy, :project_extras, :stale_deps, :deps_compat, :project_toml_formatting, ) for (key, val) in pairs(p.aqua_kwargs) if !(val isa Bool) throw(ArgumentError("Aqua keyword arguments must have boolean values")) elseif !(key in aqua_kwargs_names) throw(ArgumentError("Aqua keyword arguments must belong to $aqua_kwargs_names")) end end end function hook(p::Tests, t::Template, pkg_dir::AbstractString) # Do the normal FilePlugin behaviour to create the test script. invoke(hook, Tuple{FilePlugin,Template,AbstractString}, p, t, pkg_dir) # Then set up the test depdendency in the chosen way. if p.project make_test_project(p, pkg_dir) else add_test_dependency(p, pkg_dir) end end # Create a new test project. function make_test_project(p::Tests, pkg_dir::AbstractString) with_project(() -> Pkg.add(TEST_DEP), joinpath(pkg_dir, "test")) if p.aqua with_project(() -> Pkg.add(AQUA_DEP), joinpath(pkg_dir, "test")) end if p.jet with_project(() -> Pkg.add(JET_DEP), joinpath(pkg_dir, "test")) end end # Add Test as a test-only dependency. function add_test_dependency(p::Tests, pkg_dir::AbstractString) # Add the dependency manually since there's no programmatic way to add to [extras]. path = joinpath(pkg_dir, "Project.toml") toml = TOML.parsefile(path) get!(toml, "extras", Dict())["Test"] = TEST_UUID if p.aqua get!(toml, "extras", Dict())["Aqua"] = AQUA_UUID end if p.jet get!(toml, "extras", Dict())["JET"] = JET_UUID end targets = String[] if p.aqua push!(targets, "Aqua") end if p.jet push!(targets, "JET") end push!(targets, "Test") get!(toml, "targets", Dict())["test"] = targets write_project(path, toml) # Generate the manifest by updating the project. with_project(Pkg.update, pkg_dir) end function badges(p::Tests) bs = Badge[] if p.aqua b = Badge( "Aqua", "https://raw.githubusercontent.com/JuliaTesting/Aqua.jl/master/badge.svg", "https://github.com/JuliaTesting/Aqua.jl", ) push!(bs, b) end return bs end ================================================ FILE: src/show.jl ================================================ function Base.show(io::IO, m::MIME"text/plain", t::Template) println(io, "Template:") foreach(fieldnames(Template)) do n n === :plugins || println(io, repeat(' ', 2), n, ": ", show_field(getfield(t, n))) end if isempty(t.plugins) print(io, " plugins: None") else print(io, repeat(' ', 2), "plugins:") foreach(sort(t.plugins; by=string)) do p println(io) show(IOContext(io, :indent => 4), m, p) end end end function Base.show(io::IO, ::MIME"text/plain", p::T) where T <: Plugin indent = get(io, :indent, 0) print(io, repeat(' ', indent), nameof(T)) ns = fieldnames(T) isempty(ns) || print(io, ":") foreach(ns) do n println(io) print(io, repeat(' ', indent + 2), n, ": ", show_field(getfield(p, n))) end end show_field(x) = repr(x) if Sys.iswindows() show_field(x::AbstractString) = replace(repr(contractuser(x)), "\\\\" => "\\") else show_field(x::AbstractString) = repr(contractuser(x)) end ================================================ FILE: src/template.jl ================================================ default_user() = LibGit2.getconfig("github.user", "") default_version() = v"1.10.10" # LTS as of June 2025, see https://julialang.org/downloads/#long_term_support_release default_plugins() = [ ProjectFile(), SrcDir(), Git(), License(), Readme(), Tests(), TagBot(), GitHubActions(), Dependabot(), ] function default_authors() name = LibGit2.getconfig("user.name", "") isempty(name) && return "contributors" email = LibGit2.getconfig("user.email", "") authors = isempty(email) ? name : "$name <$email>" return "$authors and contributors" end struct MissingUserException{T} <: Exception end function Base.showerror(io::IO, ::MissingUserException{T}) where T s = """$(nameof(T)): Git hosting service username is required, set one with keyword `user=""`""" print(io, s) end """ Template(; kwargs...) A configuration used to generate packages. ## Keyword Arguments ### User Options - `user::AbstractString="$(default_user())"`: GitHub (or other code hosting service) username. The default value comes from the global Git config (`github.user`). If no value is obtained, many plugins that use this value will not work. - `authors::Union{AbstractString, Vector{<:AbstractString}}="$(default_authors())"`: Package authors. Like `user`, it takes its default value from the global Git config (`user.name` and `user.email`). ### Package Options - `dir::AbstractString="$(contractuser(Pkg.devdir()))"`: Directory to place packages in. - `host::AbstractString="github.com"`: URL to the code hosting service where packages will reside. - `julia::VersionNumber=$(repr(default_version()))`: Minimum allowed Julia version. ### Template Plugins - `plugins::Vector{<:Plugin}=Plugin[]`: A list of [`Plugin`](@ref)s used by the template. The default plugins are [`ProjectFile`](@ref), [`SrcDir`](@ref), [`Tests`](@ref), [`Readme`](@ref), [`License`](@ref), [`Git`](@ref), [`Dependabot`](@ref), [`TagBot`](@ref) and [`GitHubActions`](@ref). To disable a default plugin, pass in the negated type: `!PluginType`. To override a default plugin instead of disabling it, pass in your own instance. ### Interactive Mode - `interactive::Bool=false`: In addition to specifying the template options with keywords, you can also build up a template by following a set of prompts. To create a template interactively, set this keyword to `true`. See also the similar [`generate`](@ref) function. --- To create a package from a `Template`, use the following syntax: ```julia julia> t = Template(); julia> t("PkgName") ``` """ struct Template authors::Vector{String} dir::String host::String julia::VersionNumber plugins::Vector{<:Plugin} user::String end Template(; interactive::Bool=false, kwargs...) = Template(Val(interactive); kwargs...) Template(::Val{true}; kwargs...) = interactive(Template; kwargs...) function Template(::Val{false}; kwargs...) kwargs = Dict(kwargs) user = @mock getkw!(kwargs, :user) dir = abspath(expanduser(getkw!(kwargs, :dir))) host = replace(getkw!(kwargs, :host), r".*://" => "") julia = getkw!(kwargs, :julia) authors = getkw!(kwargs, :authors) authors isa Vector || (authors = map(strip, split(authors, ","))) plugins = Vector{Any}(collect(getkw!(kwargs, :plugins))) disabled = map(d -> first(typeof(d).parameters), filter(p -> p isa Disabled, plugins)) filter!(p -> p isa Plugin, plugins) # Remove a default if the user has specified (or disabled) a plugin of that type. defaults = filter(default_plugins()) do p !(typeof(p) in vcat(typeof.(plugins), disabled)) end append!(plugins, defaults) plugins = Vector{Plugin}(sort(plugins; by=string)) if isempty(user) foreach(plugins) do p needs_username(p) && throw(MissingUserException{typeof(p)}()) end end if !isempty(kwargs) @warn "Unrecognized keywords were supplied, see the documentation for help" kwargs end t = Template(authors, dir, host, julia, plugins, user) foreach(p -> validate(p, t), t.plugins) return t end """ (::Template)(pkg::AbstractString) Generate a package named `pkg` from a [`Template`](@ref). Return the path to the package directory. """ function (t::Template)(pkg::AbstractString) _valid_pkg_name(pkg) pkg_dir = joinpath(t.dir, pkg) ispath(pkg_dir) && throw(ArgumentError("$pkg_dir already exists")) mkpath(pkg_dir) try foreach((prehook, hook, posthook)) do h @info "Running $(nameof(h))s" foreach(sort(t.plugins; by=p -> priority(p, h), rev=true)) do p h(p, t, pkg_dir) end end catch rm(pkg_dir; recursive=true, force=true) rethrow() end @info "New package is at $pkg_dir" return pkg_dir end function _valid_pkg_name(pkg::AbstractString) if endswith(pkg, ".jl") pkg = splitext(pkg)[1] end if repr(Symbol(pkg)) ≠ ":$(pkg)" throw(ArgumentError("The package name is invalid")) end end function Base.:(==)(a::Template, b::Template) return a.authors == b.authors && a.dir == b.dir && a.host == b.host && a.julia == b.julia && a.user == b.user && all(map(==, a.plugins, b.plugins)) end # Does the template have a plugin that satisfies some predicate? hasplugin(t::Template, f::Function) = any(f, t.plugins) hasplugin(t::Template, ::Type{T}) where T <: Plugin = hasplugin(t, p -> p isa T) """ getplugin(t::Template, ::Type{T<:Plugin}) -> Union{T, Nothing} Get the plugin of type `T` from the template `t`, if it's present. """ function getplugin(t::Template, ::Type{T}) where T <: Plugin i = findfirst(p -> p isa T, t.plugins) return i === nothing ? nothing : t.plugins[i] end # Get a keyword or a default value. getkw!(kwargs, k) = pop!(kwargs, k, defaultkw(Template, k)) # Default Template keyword values. defaultkw(::Type{T}, s::Symbol) where T = defaultkw(T, Val(s)) defaultkw(::Type{Template}, ::Val{:authors}) = default_authors() defaultkw(::Type{Template}, ::Val{:dir}) = contractuser(Pkg.devdir()) defaultkw(::Type{Template}, ::Val{:host}) = "github.com" defaultkw(::Type{Template}, ::Val{:julia}) = default_version() defaultkw(::Type{Template}, ::Val{:plugins}) = Plugin[] defaultkw(::Type{Template}, ::Val{:user}) = default_user() function interactive(::Type{Template}; kwargs...) # If the user supplied any keywords themselves, don't prompt for them. kwargs = Dict{Symbol, Any}(kwargs) options = [:user, :authors, :dir, :host, :julia, :plugins] customizable = setdiff(options, keys(kwargs)) # Make sure we don't try to show a menu with < 2 options. isempty(customizable) && return Template(; kwargs...) just_one = length(customizable) == 1 just_one && push!(customizable, :none) try println("Template keywords to customize:") opts = map(k -> "$k ($(repr(defaultkw(Template, k))))" , customizable) menu = MultiSelectMenu(opts; pagesize=length(customizable)) customize = customizable[sort!(collect(request(menu)))] just_one && last(customizable) in customize && return Template(; kwargs...) # Prompt for each keyword. foreach(customize) do k kwargs[k] = prompt(Template, fieldtype(Template, k), k) end while true try return Template(; kwargs...) catch e e isa MissingUserException || rethrow() kwargs[:user] = prompt(Template, String, :user) end end catch e e isa InterruptException || rethrow() println() @info "Cancelled" return nothing end end prompt(::Type{Template}, ::Type, ::Val{:pkg}) = Base.prompt("Package name") function prompt(::Type{Template}, ::Type, ::Val{:user}) return if isempty(@mock default_user()) input = Base.prompt("Enter value for 'user' (required)") input === nothing && throw(InterruptException()) return input else fallback_prompt(String, :user) end end function prompt(::Type{Template}, ::Type, ::Val{:host}) hosts = ["github.com", "gitlab.com", "bitbucket.org", "Other"] menu = RadioMenu(hosts; pagesize=length(hosts)) println("Select Git repository hosting service:") idx = request(menu) return if idx == lastindex(hosts) fallback_prompt(String, :host) else hosts[idx] end end function prompt(::Type{Template}, ::Type, ::Val{:julia}) versions = map(format_version, VersionNumber.(1, 0:VERSION.minor)) push!(versions, "Other") menu = RadioMenu(map(string, versions); pagesize=length(versions)) println("Select minimum Julia version:") idx = request(menu) return if idx == lastindex(versions) fallback_prompt(VersionNumber, :julia) else VersionNumber(versions[idx]) end end const CR = "\r" const DOWN = "\eOB" function prompt(::Type{Template}, ::Type, ::Val{:plugins}) defaults = map(typeof, default_plugins()) ndefaults = length(defaults) # Put the defaults first. options = unique!([defaults; concretes(Plugin)]) menu = MultiSelectMenu(map(T -> string(nameof(T)), options); pagesize=length(options)) println("Select plugins:") # Pre-select the default plugins and move the cursor to the first non-default. # To make this better, we need julia#30043. print(stdin.buffer, (CR * DOWN)^ndefaults) types = sort!(collect(request(menu))) plugins = Vector{Any}(map(interactive, options[types])) # Find any defaults that were disabled. foreach(i -> i in types || push!(plugins, !defaults[i]), 1:ndefaults) return plugins end # Call the default prompt method even if a specialized one exists. fallback_prompt(T::Type, name::Symbol) = prompt(Template, T, Val(name), nothing) function default_branch(t::Template) git = getplugin(t, Git) return git === nothing ? nothing : git.branch end ================================================ FILE: templates/.JuliaFormatter.toml ================================================ # See https://domluna.github.io/JuliaFormatter.jl/stable/ for a list of options {{{STYLE}}} ================================================ FILE: templates/CITATION.bib ================================================ @misc{<<&PKG>>.jl, author = {<<&AUTHORS>>}, title = {<<&PKG>>.jl}, url = {<<&URL>>}, version = {<<&VERSION>>}, year = {<<&YEAR>>}, month = {<<&MONTH>>} } ================================================ FILE: templates/README.md ================================================ # {{{PKG}}}{{#HAS_INLINE_BADGES}} {{#BADGES}}{{{.}}} {{/BADGES}}{{/HAS_INLINE_BADGES}} {{^HAS_INLINE_BADGES}} {{#BADGES}} {{{.}}} {{/BADGES}} {{/HAS_INLINE_BADGES}} {{#HAS_CITATION}} ## Citing See [`CITATION.bib`](CITATION.bib) for the relevant reference(s). {{/HAS_CITATION}} ================================================ FILE: templates/appveyor.yml ================================================ # Documentation: https://github.com/JuliaCI/Appveyor.jl environment: matrix: {{#VERSIONS}} - julia_version: {{{.}}} {{/VERSIONS}} platform: {{#PLATFORMS}} - {{{.}}} {{/PLATFORMS}} cache: - '%USERPROFILE%\.julia\artifacts' {{#HAS_ALLOW_FAILURES}} matrix: allow_failures: {{#ALLOW_FAILURES}} - julia_version: {{{.}}} {{/ALLOW_FAILURES}} {{/HAS_ALLOW_FAILURES}} branches: only: - {{{BRANCH}}} - /release-.*/ notifications: - provider: Email on_build_success: false on_build_failure: false on_build_status_changed: false install: - ps: iex ((new-object net.webclient).DownloadString("https://raw.githubusercontent.com/JuliaCI/Appveyor.jl/version-1/bin/install.ps1")) build_script: - echo "%JL_BUILD_SCRIPT%" - C:\julia\bin\julia -e "%JL_BUILD_SCRIPT%" test_script: - echo "%JL_TEST_SCRIPT%" - C:\julia\bin\julia -e "%JL_TEST_SCRIPT%" {{#HAS_CODECOV}} on_success: - echo "%JL_CODECOV_SCRIPT%" - C:\julia\bin\julia -e "%JL_CODECOV_SCRIPT%" {{/HAS_CODECOV}} ================================================ FILE: templates/benchmark/benchmarks.jlt ================================================ using {{{PKG}}} using BenchmarkTools SUITE = BenchmarkGroup() SUITE["rand"] = @benchmarkable rand(10) # Write your benchmarks here. ================================================ FILE: templates/cirrus.yml ================================================ freebsd_instance: image: {{{IMAGE}}} task: name: FreeBSD artifacts_cache: folder: ~/.julia/artifacts env: {{#VERSIONS}} JULIA_VERSION: {{{.}}} {{/VERSIONS}} install_script: - sh -c "$(fetch https://raw.githubusercontent.com/ararslan/CirrusCI.jl/master/bin/install.sh -o -)" build_script: - cirrusjl build test_script: - cirrusjl test {{#HAS_COVERAGE}} coverage_script: - cirrusjl coverage{{#HAS_CODECOV}} codecov{{/HAS_CODECOV}}{{#HAS_COVERALLS}} coveralls{{/HAS_COVERALLS}} {{/HAS_COVERAGE}} ================================================ FILE: templates/docs/make.jlt ================================================ using {{{PKG}}} using Documenter DocMeta.setdocmeta!({{{PKG}}}, :DocTestSetup, :(using {{{PKG}}}); recursive=true) makedocs(; modules=[{{{PKG}}}], authors="{{{AUTHORS}}}", sitename="{{{PKG}}}.jl", format=Documenter.HTML(; {{#CANONICAL}} canonical="{{{CANONICAL}}}", {{/CANONICAL}} {{#EDIT_LINK}} edit_link={{{EDIT_LINK}}}, {{/EDIT_LINK}} assets={{^HAS_ASSETS}}String{{/HAS_ASSETS}}[{{^HAS_ASSETS}}],{{/HAS_ASSETS}} {{#ASSETS}} "assets/{{{.}}}", {{/ASSETS}} {{#HAS_ASSETS}} ], {{/HAS_ASSETS}} ), pages=[ "Home" => "index.md", ], {{#MAKEDOCS_KWARGS}} {{{first}}}={{{second}}}, {{/MAKEDOCS_KWARGS}} ) {{#HAS_DEPLOY}} deploydocs(; repo="{{{REPO}}}", {{#BRANCH}} devbranch="{{{BRANCH}}}", {{/BRANCH}} ) {{/HAS_DEPLOY}} ================================================ FILE: templates/docs/src/index.md ================================================ ```@meta CurrentModule = {{{PKG}}} ``` # {{{PKG}}} Documentation for [{{{PKG}}}](https://{{{REPO}}}). ```@index ``` ```@autodocs Modules = [{{{PKG}}}] ``` ================================================ FILE: templates/drone.star ================================================ def main(ctx): pipelines = [] for arch in [{{{ARCHES}}}]: for julia in [{{{VERSIONS}}}]: pipelines.append(pipeline(arch, julia)) return pipelines def pipeline(arch, julia): return { "kind": "pipeline", "type": "docker", "name": "Julia %s - %s" % (julia, arch), "platform": { "os": "linux", "arch": arch, }, "steps": [ { "name": "test", "image": "julia:%s" % julia, "commands": [ "julia -e 'using InteractiveUtils; versioninfo()'", "julia --project=@. -e 'using Pkg; Pkg.instantiate(); Pkg.build(); Pkg.test();'", ], }, ], } ================================================ FILE: templates/github/dependabot.yml ================================================ # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates version: 2 updates: - package-ecosystem: "github-actions" directory: "/" schedule: interval: "weekly" # To group all GitHub Actions updates into a single PR, uncomment the following: # groups: # github-actions: # patterns: # - "*" - package-ecosystem: "julia" directories: - "/" - "/docs" - "/test" schedule: interval: "weekly" # To group all Julia dependency updates into a single PR, uncomment the following: # groups: # julia-dependencies: # patterns: # - "*" ================================================ FILE: templates/github/workflows/CI.yml ================================================ name: CI on: push: branches: <<#BRANCH>> - <> <> tags: ['*'] pull_request: workflow_dispatch: concurrency: # Skip intermediate builds: always. # Cancel intermediate builds: only if it is a pull request build. group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} jobs: test: name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} runs-on: ${{ matrix.os }} timeout-minutes: 60 permissions: # needed to allow julia-actions/cache to proactively delete old caches that it has created actions: write contents: read strategy: fail-fast: false matrix: version: <<#VERSIONS>> - '<<&.>>' <> os: <<#OS>> - <<&.>> <> arch: <<#ARCH>> - <<&.>> <> <<#HAS_EXCLUDES>> exclude: <> <<#EXCLUDES>> - os: <<&E_OS>> arch: <<&E_ARCH>> <<#E_VERSION>> version: '<<&E_VERSION>>' <> <> steps: - uses: actions/checkout@v6 - uses: julia-actions/setup-julia@v2 with: version: ${{ matrix.version }} arch: ${{ matrix.arch }} - uses: julia-actions/cache@v2 - uses: julia-actions/julia-buildpkg@v1 - uses: julia-actions/julia-runtest@v1 <<#HAS_CODECOV>> - uses: julia-actions/julia-processcoverage@v1 - uses: codecov/codecov-action@v4 with: files: lcov.info token: ${{ secrets.CODECOV_TOKEN }} fail_ci_if_error: false <> <<#HAS_COVERALLS>> - uses: julia-actions/julia-uploadcoveralls@v1 env: COVERALLS_TOKEN: ${{ secrets.COVERALLS_TOKEN }} <> <<#HAS_DOCUMENTER>> docs: name: Documentation runs-on: ubuntu-latest permissions: actions: write # needed to allow julia-actions/cache to proactively delete old caches that it has created contents: write statuses: write steps: - uses: actions/checkout@v6 - uses: julia-actions/setup-julia@v2 with: version: '1' - uses: julia-actions/cache@v2 - uses: julia-actions/julia-buildpkg@v1 - uses: julia-actions/julia-docdeploy@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} - name: Run doctests shell: julia --project=docs --color=yes {0} run: | using Documenter: DocMeta, doctest using <<&PKG>> DocMeta.setdocmeta!(<<&PKG>>, :DocTestSetup, :(using <<&PKG>>); recursive=true) doctest(<<&PKG>>) <> <<#HAS_RUNIC>> runic: name: Runic formatting runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - uses: fredrikekre/runic-action@v1 with: version: '1' <> ================================================ FILE: templates/github/workflows/CompatHelper.yml ================================================ name: CompatHelper on: schedule: - cron: <<&CRON>> workflow_dispatch: jobs: CompatHelper: runs-on: ubuntu-latest steps: - name: Install CompatHelper run: using Pkg; Pkg.add("CompatHelper") shell: julia --color=yes {0} - name: Run CompatHelper run: using CompatHelper; CompatHelper.main() shell: julia --color=yes {0} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }} ================================================ FILE: templates/github/workflows/Register.yml ================================================ name: Register Package on: workflow_dispatch: inputs: version: description: <<&PROMPT>> required: true jobs: register: runs-on: ubuntu-latest permissions: contents: write steps: - uses: julia-actions/RegisterAction@latest with: token: ${{ secrets.GITHUB_TOKEN }} ================================================ FILE: templates/github/workflows/TagBot.yml ================================================ name: TagBot on: issue_comment: types: - created workflow_dispatch: jobs: TagBot: if: github.event_name == 'workflow_dispatch' || github.actor == '{{{TRIGGER}}}' runs-on: ubuntu-latest steps: - uses: JuliaRegistries/TagBot@v1 with: token: {{{TOKEN}}} {{#SSH}} # For commits that modify workflow files: SSH key enables tagging, but # releases require manual creation. For full automation of such commits, # use a PAT with `workflow` scope instead of GITHUB_TOKEN. # See: https://github.com/JuliaRegistries/TagBot#commits-that-modify-workflow-files ssh: {{{SSH}}} {{/SSH}} {{#SSH_PASSWORD}} ssh_password: {{{SSH_PASSWORD}}} {{/SSH_PASSWORD}} {{#CHANGELOG}} changelog: {{{CHANGELOG}}} {{/CHANGELOG}} {{#CHANGELOG_IGNORE}} changelog_ignore: {{{CHANGELOG_IGNORE}}} {{/CHANGELOG_IGNORE}} {{#GPG}} gpg: {{{GPG}}} {{/GPG}} {{#GPG_PASSWORD}} gpg_password: {{{GPG_PASSWORD}}} {{/GPG_PASSWORD}} {{#REGISTRY}} registry: {{{REGISTRY}}} {{/REGISTRY}} {{#BRANCHES}} branches: {{{BRANCHES}}} {{/BRANCHES}} {{#DISPATCH}} dispatch: {{{DISPATCH}}} {{/DISPATCH}} {{#DISPATCH_DELAY}} dispatch_delay: {{{DISPATCH_DELAY}}} {{/DISPATCH_DELAY}} ================================================ FILE: templates/gitlab-ci.yml ================================================ .script: script: - | julia --project=@. -e ' using Pkg Pkg.build() Pkg.test({{#HAS_COVERAGE}}coverage=true{{/HAS_COVERAGE}})' {{#HAS_COVERAGE}} .coverage: coverage: /Test coverage (\d+\.\d+%)/ after_script: - | julia -e ' using Pkg Pkg.add("Coverage") using Coverage c, t = get_summary(process_folder()) using Printf @printf "Test coverage %.2f%%\n" 100c / t' {{/HAS_COVERAGE}} {{#VERSIONS}} Julia {{{.}}}: image: julia:{{{.}}} extends: - .script {{#HAS_COVERAGE}} - .coverage {{/HAS_COVERAGE}} {{/VERSIONS}} {{#HAS_DOCUMENTER}} pages: image: julia:{{{VERSION}}} stage: deploy script: - | julia --project=docs -e ' using Pkg Pkg.develop(PackageSpec(path=pwd())) Pkg.instantiate() using Documenter: doctest using {{{PKG}}} doctest({{{PKG}}}) include("docs/make.jl")' - mkdir -p public - mv docs/build public/dev artifacts: paths: - public only: - {{{BRANCH}}} {{/HAS_DOCUMENTER}} ================================================ FILE: templates/licenses/AGPL-3.0-or-later ================================================ Copyright (C) {{{YEAR}}} {{{AUTHORS}}} This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . GNU AFFERO GENERAL PUBLIC LICENSE Version 3, 19 November 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU Affero General Public License is a free, copyleft license for software and other kinds of works, specifically designed to ensure cooperation with the community in the case of network server software. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, our General Public Licenses are intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. Developers that use our General Public Licenses protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License which gives you legal permission to copy, distribute and/or modify the software. A secondary benefit of defending all users' freedom is that improvements made in alternate versions of the program, if they receive widespread use, become available for other developers to incorporate. Many developers of free software are heartened and encouraged by the resulting cooperation. However, in the case of software used on network servers, this result may fail to come about. The GNU General Public License permits making a modified version and letting the public access it on a server without ever releasing its source code to the public. The GNU Affero General Public License is designed specifically to ensure that, in such cases, the modified source code becomes available to the community. It requires the operator of a network server to provide the source code of the modified version running there to the users of that server. Therefore, public use of a modified version, on a publicly accessible server, gives the public access to the source code of the modified version. An older license, called the Affero General Public License and published by Affero, was designed to accomplish similar goals. This is a different license, not a version of the Affero GPL, but Affero has released a new version of the Affero GPL which permits relicensing under this license. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU Affero General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Remote Network Interaction; Use with the GNU General Public License. Notwithstanding any other provision of this License, if you modify the Program, your modified version must prominently offer all users interacting with it remotely through a computer network (if your version supports such interaction) an opportunity to receive the Corresponding Source of your version by providing access to the Corresponding Source from a network server at no charge, through some standard or customary means of facilitating copying of software. This Corresponding Source shall include the Corresponding Source for any work covered by version 3 of the GNU General Public License that is incorporated pursuant to the following paragraph. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the work with which it is combined will remain governed by version 3 of the GNU General Public License. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU Affero General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU Affero General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU Affero General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU Affero General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If your software can interact with users remotely through a computer network, you should also make sure that it provides a way for users to get its source. For example, if your program is a web application, its interface could display a "Source" link that leads users to an archive of the code. There are many ways you could offer source, and different solutions will be better for different programs; see section 13 for the specific requirements. You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU AGPL, see . ================================================ FILE: templates/licenses/Apache-2.0 ================================================ Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "{}" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ================================================ FILE: templates/licenses/BSD-2-Clause ================================================ BSD 2-Clause License Copyright (c) {{{YEAR}}}, {{{AUTHORS}}} All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ================================================ FILE: templates/licenses/BSD-3-Clause ================================================ BSD 3-Clause License Copyright (c) {{{YEAR}}}, {{{AUTHORS}}} All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ================================================ FILE: templates/licenses/EUPL-1.2 ================================================ European Union Public Licence V. 1.2 EUPL © the European Union 2007, 2016 This European Union Public Licence (the ‘EUPL’) applies to the Work (as defined below) which is provided under the terms of this Licence. Any use of the Work, other than as authorised under this Licence is prohibited (to the extent such use is covered by a right of the copyright holder of the Work). The Work is provided under the terms of this Licence when the Licensor (as defined below) has placed the following notice immediately following the copyright notice for the Work: “Licensed under the EUPL”, or has expressed by any other means his willingness to license under the EUPL. 1. Definitions In this Licence, the following terms have the following meaning: — ‘The Licence’: this Licence. — ‘The Original Work’: the work or software distributed or communicated by the ‘Licensor under this Licence, available as Source Code and also as ‘Executable Code as the case may be. — ‘Derivative Works’: the works or software that could be created by the ‘Licensee, based upon the Original Work or modifications thereof. This ‘Licence does not define the extent of modification or dependence on the ‘Original Work required in order to classify a work as a Derivative Work; ‘this extent is determined by copyright law applicable in the country ‘mentioned in Article 15. — ‘The Work’: the Original Work or its Derivative Works. — ‘The Source Code’: the human-readable form of the Work which is the most convenient for people to study and modify. — ‘The Executable Code’: any code which has generally been compiled and which is meant to be interpreted by a computer as a program. — ‘The Licensor’: the natural or legal person that distributes or communicates the Work under the Licence. — ‘Contributor(s)’: any natural or legal person who modifies the Work under the Licence, or otherwise contributes to the creation of a Derivative Work. — ‘The Licensee’ or ‘You’: any natural or legal person who makes any usage of the Work under the terms of the Licence. — ‘Distribution’ or ‘Communication’: any act of selling, giving, lending, renting, distributing, communicating, transmitting, or otherwise making available, online or offline, copies of the Work or providing access to its essential functionalities at the disposal of any other natural or legal person. 2. Scope of the rights granted by the Licence The Licensor hereby grants You a worldwide, royalty-free, non-exclusive, sublicensable licence to do the following, for the duration of copyright vested in the Original Work: — use the Work in any circumstance and for all usage, — reproduce the Work, — modify the Work, and make Derivative Works based upon the Work, — communicate to the public, including the right to make available or display the Work or copies thereof to the public and perform publicly, as the case may be, the Work, — distribute the Work or copies thereof, — lend and rent the Work or copies thereof, — sublicense rights in the Work or copies thereof. Those rights can be exercised on any media, supports and formats, whether now known or later invented, as far as the applicable law permits so. In the countries where moral rights apply, the Licensor waives his right to exercise his moral right to the extent allowed by law in order to make effective the licence of the economic rights here above listed. The Licensor grants to the Licensee royalty-free, non-exclusive usage rights to any patents held by the Licensor, to the extent necessary to make use of the rights granted on the Work under this Licence. 3. Communication of the Source Code The Licensor may provide the Work either in its Source Code form, or as Executable Code. If the Work is provided as Executable Code, the Licensor provides in addition a machine-readable copy of the Source Code of the Work along with each copy of the Work that the Licensor distributes or indicates, in a notice following the copyright notice attached to the Work, a repository where the Source Code is easily and freely accessible for as long as the Licensor continues to distribute or communicate the Work. 4. Limitations on copyright Nothing in this Licence is intended to deprive the Licensee of the benefits from any exception or limitation to the exclusive rights of the rights owners in the Work, of the exhaustion of those rights or of other applicable limitations thereto. 5. Obligations of the Licensee The grant of the rights mentioned above is subject to some restrictions and obligations imposed on the Licensee. Those obligations are the following: Attribution right: The Licensee shall keep intact all copyright, patent or trademarks notices and all notices that refer to the Licence and to the disclaimer of warranties. The Licensee must include a copy of such notices and a copy of the Licence with every copy of the Work he/she distributes or communicates. The Licensee must cause any Derivative Work to carry prominent notices stating that the Work has been modified and the date of modification. Copyleft clause: If the Licensee distributes or communicates copies of the Original Works or Derivative Works, this Distribution or Communication will be done under the terms of this Licence or of a later version of this Licence unless the Original Work is expressly distributed only under this version of the Licence — for example by communicating ‘EUPL v. 1.2 only’. The Licensee (becoming Licensor) cannot offer or impose any additional terms or conditions on the Work or Derivative Work that alter or restrict the terms of the Licence. Compatibility clause: If the Licensee Distributes or Communicates Derivative Works or copies thereof based upon both the Work and another work licensed under a Compatible Licence, this Distribution or Communication can be done under the terms of this Compatible Licence. For the sake of this clause, ‘Compatible Licence’ refers to the licences listed in the appendix attached to this Licence. Should the Licensee's obligations under the Compatible Licence conflict with his/her obligations under this Licence, the obligations of the Compatible Licence shall prevail. Provision of Source Code: When distributing or communicating copies of the Work, the Licensee will provide a machine-readable copy of the Source Code or indicate a repository where this Source will be easily and freely available for as long as the Licensee continues to distribute or communicate the Work. Legal Protection: This Licence does not grant permission to use the trade names, trademarks, service marks, or names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the copyright notice. 6. Chain of Authorship The original Licensor warrants that the copyright in the Original Work granted hereunder is owned by him/her or licensed to him/her and that he/she has the power and authority to grant the Licence. Each Contributor warrants that the copyright in the modifications he/she brings to the Work are owned by him/her or licensed to him/her and that he/she has the power and authority to grant the Licence. Each time You accept the Licence, the original Licensor and subsequent Contributors grant You a licence to their contributions to the Work, under the terms of this Licence. 7. Disclaimer of Warranty The Work is a work in progress, which is continuously improved by numerous Contributors. It is not a finished work and may therefore contain defects or ‘bugs’ inherent to this type of development. For the above reason, the Work is provided under the Licence on an ‘as is’ basis and without warranties of any kind concerning the Work, including without limitation merchantability, fitness for a particular purpose, absence of defects or errors, accuracy, non-infringement of intellectual property rights other than copyright as stated in Article 6 of this Licence. This disclaimer of warranty is an essential part of the Licence and a condition for the grant of any rights to the Work. 8. Disclaimer of Liability Except in the cases of wilful misconduct or damages directly caused to natural persons, the Licensor will in no event be liable for any direct or indirect, material or moral, damages of any kind, arising out of the Licence or of the use of the Work, including without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, loss of data or any commercial damage, even if the Licensor has been advised of the possibility of such damage. However, the Licensor will be liable under statutory product liability laws as far such laws apply to the Work. 9. Additional agreements While distributing the Work, You may choose to conclude an additional agreement, defining obligations or services consistent with this Licence. However, if accepting obligations, You may act only on your own behalf and on your sole responsibility, not on behalf of the original Licensor or any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against such Contributor by the fact You have accepted any warranty or additional liability. 10. Acceptance of the Licence The provisions of this Licence can be accepted by clicking on an icon ‘I agree’ placed under the bottom of a window displaying the text of this Licence or by affirming consent in any other similar way, in accordance with the rules of applicable law. Clicking on that icon indicates your clear and irrevocable acceptance of this Licence and all of its terms and conditions. Similarly, you irrevocably accept this Licence and all of its terms and conditions by exercising any rights granted to You by Article 2 of this Licence, such as the use of the Work, the creation by You of a Derivative Work or the Distribution or Communication by You of the Work or copies thereof. 11. Information to the public In case of any Distribution or Communication of the Work by means of electronic communication by You (for example, by offering to download the Work from a remote location) the distribution channel or media (for example, a website) must at least provide to the public the information requested by the applicable law regarding the Licensor, the Licence and the way it may be accessible, concluded, stored and reproduced by the Licensee. 12. Termination of the Licence The Licence and the rights granted hereunder will terminate automatically upon any breach by the Licensee of the terms of the Licence. Such a termination will not terminate the licences of any person who has received the Work from the Licensee under the Licence, provided such persons remain in full compliance with the Licence. 13. Miscellaneous Without prejudice of Article 9 above, the Licence represents the complete agreement between the Parties as to the Work. If any provision of the Licence is invalid or unenforceable under applicable law, this will not affect the validity or enforceability of the Licence as a whole. Such provision will be construed or reformed so as necessary to make it valid and enforceable. The European Commission may publish other linguistic versions or new versions of this Licence or updated versions of the Appendix, so far this is required and reasonable, without reducing the scope of the rights granted by the Licence. New versions of the Licence will be published with a unique version number. All linguistic versions of this Licence, approved by the European Commission, have identical value. Parties can take advantage of the linguistic version of their choice. 14. Jurisdiction Without prejudice to specific agreement between parties, — any litigation resulting from the interpretation of this License, arising between the European Union institutions, bodies, offices or agencies, as a Licensor, and any Licensee, will be subject to the jurisdiction of the Court of Justice of the European Union, as laid down in article 272 of the Treaty on the Functioning of the European Union, — any litigation arising between other parties and resulting from the interpretation of this License, will be subject to the exclusive jurisdiction of the competent court where the Licensor resides or conducts its primary business. 15. Applicable Law Without prejudice to specific agreement between parties, — this Licence shall be governed by the law of the European Union Member State where the Licensor has his seat, resides or has his registered office, — this licence shall be governed by Belgian law if the Licensor has no seat, residence or registered office inside a European Union Member State. Appendix ‘Compatible Licences’ according to Article 5 EUPL are: — GNU General Public License (GPL) v. 2, v. 3 — GNU Affero General Public License (AGPL) v. 3 — Open Software License (OSL) v. 2.1, v. 3.0 — Eclipse Public License (EPL) v. 1.0 — CeCILL v. 2.0, v. 2.1 — Mozilla Public Licence (MPL) v. 2 — GNU Lesser General Public Licence (LGPL) v. 2.1, v. 3 — Creative Commons Attribution-ShareAlike v. 3.0 Unported (CC BY-SA 3.0) for works other than software — European Union Public Licence (EUPL) v. 1.1, v. 1.2 — Québec Free and Open-Source Licence — Reciprocity (LiLiQ-R) or Strong Reciprocity (LiLiQ-R+) — The European Commission may update this Appendix to later versions of the above licences without producing a new version of the EUPL, as long as they provide the rights granted in Article 2 of this Licence and protect the covered Source Code from exclusive appropriation. — All other changes or additions to this Appendix require the production of a new EUPL version. ================================================ FILE: templates/licenses/GPL-2.0-or-later ================================================ Copyright (C) {{{YEAR}}} {{{AUTHORS}}} This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. ================================================ FILE: templates/licenses/GPL-3.0-or-later ================================================ Copyright (C) {{{YEAR}}} {{{AUTHORS}}} This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . ================================================ FILE: templates/licenses/ISC ================================================ ISC License Copyright (c) {{{YEAR}}}, {{{AUTHORS}}} Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ================================================ FILE: templates/licenses/LGPL-2.1-or-later ================================================ Copyright (C) {{{YEAR}}} {{{AUTHORS}}} This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! ================================================ FILE: templates/licenses/LGPL-3.0-or-later ================================================ Copyright (C) {{{YEAR}}} {{{AUTHORS}}} This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . GNU LESSER GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below. 0. Additional Definitions. As used herein, "this License" refers to version 3 of the GNU Lesser General Public License, and the "GNU GPL" refers to version 3 of the GNU General Public License. "The Library" refers to a covered work governed by this License, other than an Application or a Combined Work as defined below. An "Application" is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library. A "Combined Work" is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the "Linked Version". The "Minimal Corresponding Source" for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version. The "Corresponding Application Code" for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work. 1. Exception to Section 3 of the GNU GPL. You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL. 2. Conveying Modified Versions. If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version: a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy. 3. Object Code Incorporating Material from Library Header Files. The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following: a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License. b) Accompany the object code with a copy of the GNU GPL and this license document. 4. Combined Works. You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following: a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License. b) Accompany the Combined Work with a copy of the GNU GPL and this license document. c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document. d) Do one of the following: 0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source. 1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version. e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.) 5. Combined Libraries. You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License. b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 6. Revised Versions of the GNU Lesser General Public License. The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation. If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library. ================================================ FILE: templates/licenses/MIT ================================================ MIT License Copyright (c) {{{YEAR}}} {{{AUTHORS}}} Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: templates/licenses/MPL-2.0 ================================================ Mozilla Public License Version 2.0 ================================== 1. Definitions -------------- 1.1. "Contributor" means each individual or legal entity that creates, contributes to the creation of, or owns Covered Software. 1.2. "Contributor Version" means the combination of the Contributions of others (if any) used by a Contributor and that particular Contributor's Contribution. 1.3. "Contribution" means Covered Software of a particular Contributor. 1.4. "Covered Software" means Source Code Form to which the initial Contributor has attached the notice in Exhibit A, the Executable Form of such Source Code Form, and Modifications of such Source Code Form, in each case including portions thereof. 1.5. "Incompatible With Secondary Licenses" means (a) that the initial Contributor has attached the notice described in Exhibit B to the Covered Software; or (b) that the Covered Software was made available under the terms of version 1.1 or earlier of the License, but not also under the terms of a Secondary License. 1.6. "Executable Form" means any form of the work other than Source Code Form. 1.7. "Larger Work" means a work that combines Covered Software with other material, in a separate file or files, that is not Covered Software. 1.8. "License" means this document. 1.9. "Licensable" means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently, any and all of the rights conveyed by this License. 1.10. "Modifications" means any of the following: (a) any file in Source Code Form that results from an addition to, deletion from, or modification of the contents of Covered Software; or (b) any new file in Source Code Form that contains any Covered Software. 1.11. "Patent Claims" of a Contributor means any patent claim(s), including without limitation, method, process, and apparatus claims, in any patent Licensable by such Contributor that would be infringed, but for the grant of the License, by the making, using, selling, offering for sale, having made, import, or transfer of either its Contributions or its Contributor Version. 1.12. "Secondary License" means either the GNU General Public License, Version 2.0, the GNU Lesser General Public License, Version 2.1, the GNU Affero General Public License, Version 3.0, or any later versions of those licenses. 1.13. "Source Code Form" means the form of the work preferred for making modifications. 1.14. "You" (or "Your") means an individual or a legal entity exercising rights under this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with You. For purposes of this definition, "control" means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity. 2. License Grants and Conditions -------------------------------- 2.1. Grants Each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license: (a) under intellectual property rights (other than patent or trademark) Licensable by such Contributor to use, reproduce, make available, modify, display, perform, distribute, and otherwise exploit its Contributions, either on an unmodified basis, with Modifications, or as part of a Larger Work; and (b) under Patent Claims of such Contributor to make, use, sell, offer for sale, have made, import, and otherwise transfer either its Contributions or its Contributor Version. 2.2. Effective Date The licenses granted in Section 2.1 with respect to any Contribution become effective for each Contribution on the date the Contributor first distributes such Contribution. 2.3. Limitations on Grant Scope The licenses granted in this Section 2 are the only rights granted under this License. No additional rights or licenses will be implied from the distribution or licensing of Covered Software under this License. Notwithstanding Section 2.1(b) above, no patent license is granted by a Contributor: (a) for any code that a Contributor has removed from Covered Software; or (b) for infringements caused by: (i) Your and any other third party's modifications of Covered Software, or (ii) the combination of its Contributions with other software (except as part of its Contributor Version); or (c) under Patent Claims infringed by Covered Software in the absence of its Contributions. This License does not grant any rights in the trademarks, service marks, or logos of any Contributor (except as may be necessary to comply with the notice requirements in Section 3.4). 2.4. Subsequent Licenses No Contributor makes additional grants as a result of Your choice to distribute the Covered Software under a subsequent version of this License (see Section 10.2) or under the terms of a Secondary License (if permitted under the terms of Section 3.3). 2.5. Representation Each Contributor represents that the Contributor believes its Contributions are its original creation(s) or it has sufficient rights to grant the rights to its Contributions conveyed by this License. 2.6. Fair Use This License is not intended to limit any rights You have under applicable copyright doctrines of fair use, fair dealing, or other equivalents. 2.7. Conditions Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in Section 2.1. 3. Responsibilities ------------------- 3.1. Distribution of Source Form All distribution of Covered Software in Source Code Form, including any Modifications that You create or to which You contribute, must be under the terms of this License. You must inform recipients that the Source Code Form of the Covered Software is governed by the terms of this License, and how they can obtain a copy of this License. You may not attempt to alter or restrict the recipients' rights in the Source Code Form. 3.2. Distribution of Executable Form If You distribute Covered Software in Executable Form then: (a) such Covered Software must also be made available in Source Code Form, as described in Section 3.1, and You must inform recipients of the Executable Form how they can obtain a copy of such Source Code Form by reasonable means in a timely manner, at a charge no more than the cost of distribution to the recipient; and (b) You may distribute such Executable Form under the terms of this License, or sublicense it under different terms, provided that the license for the Executable Form does not attempt to limit or alter the recipients' rights in the Source Code Form under this License. 3.3. Distribution of a Larger Work You may create and distribute a Larger Work under terms of Your choice, provided that You also comply with the requirements of this License for the Covered Software. If the Larger Work is a combination of Covered Software with a work governed by one or more Secondary Licenses, and the Covered Software is not Incompatible With Secondary Licenses, this License permits You to additionally distribute such Covered Software under the terms of such Secondary License(s), so that the recipient of the Larger Work may, at their option, further distribute the Covered Software under the terms of either this License or such Secondary License(s). 3.4. Notices You may not remove or alter the substance of any license notices (including copyright notices, patent notices, disclaimers of warranty, or limitations of liability) contained within the Source Code Form of the Covered Software, except that You may alter any license notices to the extent required to remedy known factual inaccuracies. 3.5. Application of Additional Terms You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, You may do so only on Your own behalf, and not on behalf of any Contributor. You must make it absolutely clear that any such warranty, support, indemnity, or liability obligation is offered by You alone, and You hereby agree to indemnify every Contributor for any liability incurred by such Contributor as a result of warranty, support, indemnity or liability terms You offer. You may include additional disclaimers of warranty and limitations of liability specific to any jurisdiction. 4. Inability to Comply Due to Statute or Regulation --------------------------------------------------- If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Software due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be placed in a text file included with all distributions of the Covered Software under this License. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it. 5. Termination -------------- 5.1. The rights granted under this License will terminate automatically if You fail to comply with any of its terms. However, if You become compliant, then the rights granted under this License from a particular Contributor are reinstated (a) provisionally, unless and until such Contributor explicitly and finally terminates Your grants, and (b) on an ongoing basis, if such Contributor fails to notify You of the non-compliance by some reasonable means prior to 60 days after You have come back into compliance. Moreover, Your grants from a particular Contributor are reinstated on an ongoing basis if such Contributor notifies You of the non-compliance by some reasonable means, this is the first time You have received notice of non-compliance with this License from such Contributor, and You become compliant prior to 30 days after Your receipt of the notice. 5.2. If You initiate litigation against any entity by asserting a patent infringement claim (excluding declaratory judgment actions, counter-claims, and cross-claims) alleging that a Contributor Version directly or indirectly infringes any patent, then the rights granted to You by any and all Contributors for the Covered Software under Section 2.1 of this License shall terminate. 5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or Your distributors under this License prior to termination shall survive termination. ************************************************************************ * * * 6. Disclaimer of Warranty * * ------------------------- * * * * Covered Software is provided under this License on an "as is" * * basis, without warranty of any kind, either expressed, implied, or * * statutory, including, without limitation, warranties that the * * Covered Software is free of defects, merchantable, fit for a * * particular purpose or non-infringing. The entire risk as to the * * quality and performance of the Covered Software is with You. * * Should any Covered Software prove defective in any respect, You * * (not any Contributor) assume the cost of any necessary servicing, * * repair, or correction. This disclaimer of warranty constitutes an * * essential part of this License. No use of any Covered Software is * * authorized under this License except under this disclaimer. * * * ************************************************************************ ************************************************************************ * * * 7. Limitation of Liability * * -------------------------- * * * * Under no circumstances and under no legal theory, whether tort * * (including negligence), contract, or otherwise, shall any * * Contributor, or anyone who distributes Covered Software as * * permitted above, be liable to You for any direct, indirect, * * special, incidental, or consequential damages of any character * * including, without limitation, damages for lost profits, loss of * * goodwill, work stoppage, computer failure or malfunction, or any * * and all other commercial damages or losses, even if such party * * shall have been informed of the possibility of such damages. This * * limitation of liability shall not apply to liability for death or * * personal injury resulting from such party's negligence to the * * extent applicable law prohibits such limitation. Some * * jurisdictions do not allow the exclusion or limitation of * * incidental or consequential damages, so this exclusion and * * limitation may not apply to You. * * * ************************************************************************ 8. Litigation ------------- Any litigation relating to this License may be brought only in the courts of a jurisdiction where the defendant maintains its principal place of business and such litigation shall be governed by laws of that jurisdiction, without reference to its conflict-of-law provisions. Nothing in this Section shall prevent a party's ability to bring cross-claims or counter-claims. 9. Miscellaneous ---------------- This License represents the complete agreement concerning the subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not be used to construe this License against a Contributor. 10. Versions of the License --------------------------- 10.1. New Versions Mozilla Foundation is the license steward. Except as provided in Section 10.3, no one other than the license steward has the right to modify or publish new versions of this License. Each version will be given a distinguishing version number. 10.2. Effect of New Versions You may distribute the Covered Software under the terms of the version of the License under which You originally received the Covered Software, or under the terms of any subsequent version published by the license steward. 10.3. Modified Versions If you create software not governed by this License, and you want to create a new license for such software, you may create and use a modified version of this License if you rename the license and remove any references to the name of the license steward (except to note that such modified license differs from this License). 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses If You choose to distribute Source Code Form that is Incompatible With Secondary Licenses under the terms of this version of the License, the notice described in Exhibit B of this License must be attached. Exhibit A - Source Code Form License Notice ------------------------------------------- This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. If it is not possible or desirable to put the notice in a particular file, then You may include the notice in a location (such as a LICENSE file in a relevant directory) where a recipient would be likely to look for such a notice. You may add additional accurate notices of copyright ownership. Exhibit B - "Incompatible With Secondary Licenses" Notice --------------------------------------------------------- This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0. ================================================ FILE: templates/src/module.jlt ================================================ module {{{PKG}}} # Write your package code here. end ================================================ FILE: templates/test/runtests.jlt ================================================ using {{{PKG}}} using Test{{{AQUA_IMPORT}}}{{{JET_IMPORT}}} @testset "{{{PKG}}}.jl" begin {{{AQUA_TESTSET}}}{{{JET_TESTSET}}}# Write your tests here. end ================================================ FILE: templates/travis.yml ================================================ # Documentation: http://docs.travis-ci.com/user/languages/julia language: julia notifications: email: false julia: {{#VERSIONS}} - {{{.}}} {{/VERSIONS}} os: {{#OS}} - {{{.}}} {{/OS}} arch: {{#ARCH}} - {{{.}}} {{/ARCH}} cache: directories: - ~/.julia/artifacts jobs: fast_finish: true {{#HAS_ALLOW_FAILURES}} allow_failures: {{/HAS_ALLOW_FAILURES}} {{#ALLOW_FAILURES}} - julia: {{{.}}} {{/ALLOW_FAILURES}} {{#HAS_EXCLUDES}} exclude: {{/HAS_EXCLUDES}} {{#EXCLUDES}} - arch: {{{E_ARCH}}} {{#E_OS}} os: {{{E_OS}}} {{/E_OS}} {{#E_JULIA}} julia: {{{E_JULIA}}} {{/E_JULIA}} {{/EXCLUDES}} {{#HAS_DOCUMENTER}} include: - stage: Documentation julia: 1 script: - | julia --project=docs -e ' using Pkg Pkg.develop(PackageSpec(path=pwd())) Pkg.instantiate()' - | julia --project=docs -e ' using Pkg Pkg.develop(PackageSpec(path=pwd())) Pkg.instantiate() using Documenter: DocMeta, doctest using {{{PKG}}} DocMeta.setdocmeta!({{{PKG}}}, :DocTestSetup, :(using {{{PKG}}}); recursive=true) doctest({{{PKG}}}) include("docs/make.jl")' after_success: skip {{/HAS_DOCUMENTER}} {{#HAS_COVERAGE}} after_success: {{#HAS_CODECOV}} - | julia -e ' using Pkg Pkg.add("Coverage") using Coverage Codecov.submit(process_folder())' {{/HAS_CODECOV}} {{#HAS_COVERALLS}} - | julia -e ' using Pkg Pkg.add("Coverage") using Coverage Coveralls.submit(process_folder())' {{/HAS_COVERALLS}} {{/HAS_COVERAGE}} ================================================ FILE: test/fixtures/AllPlugins/.JuliaFormatter.toml ================================================ # See https://domluna.github.io/JuliaFormatter.jl/stable/ for a list of options ================================================ FILE: test/fixtures/AllPlugins/.appveyor.yml ================================================ # Documentation: https://github.com/JuliaCI/Appveyor.jl environment: matrix: - julia_version: 1.10 - julia_version: nightly platform: - x64 cache: - '%USERPROFILE%\.julia\artifacts' matrix: allow_failures: - julia_version: nightly branches: only: - main - /release-.*/ notifications: - provider: Email on_build_success: false on_build_failure: false on_build_status_changed: false install: - ps: iex ((new-object net.webclient).DownloadString("https://raw.githubusercontent.com/JuliaCI/Appveyor.jl/version-1/bin/install.ps1")) build_script: - echo "%JL_BUILD_SCRIPT%" - C:\julia\bin\julia -e "%JL_BUILD_SCRIPT%" test_script: - echo "%JL_TEST_SCRIPT%" - C:\julia\bin\julia -e "%JL_TEST_SCRIPT%" on_success: - echo "%JL_CODECOV_SCRIPT%" - C:\julia\bin\julia -e "%JL_CODECOV_SCRIPT%" ================================================ FILE: test/fixtures/AllPlugins/.cirrus.yml ================================================ freebsd_instance: image: freebsd-12-0-release-amd64 task: name: FreeBSD artifacts_cache: folder: ~/.julia/artifacts env: JULIA_VERSION: 1.10 JULIA_VERSION: nightly install_script: - sh -c "$(fetch https://raw.githubusercontent.com/ararslan/CirrusCI.jl/master/bin/install.sh -o -)" build_script: - cirrusjl build test_script: - cirrusjl test coverage_script: - cirrusjl coverage codecov coveralls ================================================ FILE: test/fixtures/AllPlugins/.drone.star ================================================ def main(ctx): pipelines = [] for arch in ["amd64"]: for julia in ["1.10"]: pipelines.append(pipeline(arch, julia)) return pipelines def pipeline(arch, julia): return { "kind": "pipeline", "type": "docker", "name": "Julia %s - %s" % (julia, arch), "platform": { "os": "linux", "arch": arch, }, "steps": [ { "name": "test", "image": "julia:%s" % julia, "commands": [ "julia -e 'using InteractiveUtils; versioninfo()'", "julia --project=@. -e 'using Pkg; Pkg.instantiate(); Pkg.build(); Pkg.test();'", ], }, ], } ================================================ FILE: test/fixtures/AllPlugins/.github/dependabot.yml ================================================ # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates version: 2 updates: - package-ecosystem: "github-actions" directory: "/" schedule: interval: "weekly" # To group all GitHub Actions updates into a single PR, uncomment the following: # groups: # github-actions: # patterns: # - "*" - package-ecosystem: "julia" directories: - "/" - "/docs" - "/test" schedule: interval: "weekly" # To group all Julia dependency updates into a single PR, uncomment the following: # groups: # julia-dependencies: # patterns: # - "*" ================================================ FILE: test/fixtures/AllPlugins/.github/workflows/CI.yml ================================================ name: CI on: push: branches: - main tags: ['*'] pull_request: workflow_dispatch: concurrency: # Skip intermediate builds: always. # Cancel intermediate builds: only if it is a pull request build. group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} jobs: test: name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} runs-on: ${{ matrix.os }} timeout-minutes: 60 permissions: # needed to allow julia-actions/cache to proactively delete old caches that it has created actions: write contents: read strategy: fail-fast: false matrix: version: - '1.10' - 'pre' os: - ubuntu-latest arch: - x64 steps: - uses: actions/checkout@v6 - uses: julia-actions/setup-julia@v2 with: version: ${{ matrix.version }} arch: ${{ matrix.arch }} - uses: julia-actions/cache@v2 - uses: julia-actions/julia-buildpkg@v1 - uses: julia-actions/julia-runtest@v1 - uses: julia-actions/julia-processcoverage@v1 - uses: codecov/codecov-action@v4 with: files: lcov.info token: ${{ secrets.CODECOV_TOKEN }} fail_ci_if_error: false - uses: julia-actions/julia-uploadcoveralls@v1 env: COVERALLS_TOKEN: ${{ secrets.COVERALLS_TOKEN }} runic: name: Runic formatting runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - uses: fredrikekre/runic-action@v1 with: version: '1' ================================================ FILE: test/fixtures/AllPlugins/.github/workflows/CompatHelper.yml ================================================ name: CompatHelper on: schedule: - cron: 0 0 * * * workflow_dispatch: jobs: CompatHelper: runs-on: ubuntu-latest steps: - name: Install CompatHelper run: using Pkg; Pkg.add("CompatHelper") shell: julia --color=yes {0} - name: Run CompatHelper run: using CompatHelper; CompatHelper.main() shell: julia --color=yes {0} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }} ================================================ FILE: test/fixtures/AllPlugins/.github/workflows/Register.yml ================================================ name: Register Package on: workflow_dispatch: inputs: version: description: Version to register or component to bump required: true jobs: register: runs-on: ubuntu-latest permissions: contents: write steps: - uses: julia-actions/RegisterAction@latest with: token: ${{ secrets.GITHUB_TOKEN }} ================================================ FILE: test/fixtures/AllPlugins/.github/workflows/TagBot.yml ================================================ name: TagBot on: issue_comment: types: - created workflow_dispatch: jobs: TagBot: if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot' runs-on: ubuntu-latest steps: - uses: JuliaRegistries/TagBot@v1 with: token: ${{ secrets.GITHUB_TOKEN }} # For commits that modify workflow files: SSH key enables tagging, but # releases require manual creation. For full automation of such commits, # use a PAT with `workflow` scope instead of GITHUB_TOKEN. # See: https://github.com/JuliaRegistries/TagBot#commits-that-modify-workflow-files ssh: ${{ secrets.DOCUMENTER_KEY }} ================================================ FILE: test/fixtures/AllPlugins/.gitignore ================================================ *.jl.*.cov *.jl.cov *.jl.mem /Manifest*.toml /docs/Manifest*.toml /docs/build/ ================================================ FILE: test/fixtures/AllPlugins/.gitlab-ci.yml ================================================ .script: script: - | julia --project=@. -e ' using Pkg Pkg.build() Pkg.test(coverage=true)' .coverage: coverage: /Test coverage (\d+\.\d+%)/ after_script: - | julia -e ' using Pkg Pkg.add("Coverage") using Coverage c, t = get_summary(process_folder()) using Printf @printf "Test coverage %.2f%%\n" 100c / t' Julia 1.10: image: julia:1.10 extends: - .script - .coverage ================================================ FILE: test/fixtures/AllPlugins/.travis.yml ================================================ # Documentation: http://docs.travis-ci.com/user/languages/julia language: julia notifications: email: false julia: - 1.10 - nightly os: - linux arch: - x64 cache: directories: - ~/.julia/artifacts jobs: fast_finish: true allow_failures: - julia: nightly after_success: - | julia -e ' using Pkg Pkg.add("Coverage") using Coverage Codecov.submit(process_folder())' - | julia -e ' using Pkg Pkg.add("Coverage") using Coverage Coveralls.submit(process_folder())' ================================================ FILE: test/fixtures/AllPlugins/CITATION.bib ================================================ @misc{AllPlugins.jl, author = {tester}, title = {AllPlugins.jl}, url = {https://github.com/tester/AllPlugins.jl}, version = {v1.0.0-DEV}, year = {2019}, month = {8} } ================================================ FILE: test/fixtures/AllPlugins/CODEOWNERS ================================================ ================================================ FILE: test/fixtures/AllPlugins/LICENSE ================================================ MIT License Copyright (c) 2019 tester Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: test/fixtures/AllPlugins/Manifest.toml ================================================ # This file is machine-generated - editing it directly is not advised ================================================ FILE: test/fixtures/AllPlugins/Project.toml ================================================ name = "AllPlugins" uuid = "c51a4d33-e9a4-4efb-a257-e0de888ecc28" authors = ["tester"] version = "1.0.0-DEV" [compat] julia = "1.10.10" [extras] Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [targets] test = ["Test"] ================================================ FILE: test/fixtures/AllPlugins/README.md ================================================ # AllPlugins [![Build Status](https://github.com/tester/AllPlugins.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/tester/AllPlugins.jl/actions/workflows/CI.yml?query=branch%3Amain) [![Build Status](https://github.com/tester/AllPlugins.jl/badges/main/pipeline.svg)](https://github.com/tester/AllPlugins.jl/pipelines) [![Coverage](https://github.com/tester/AllPlugins.jl/badges/main/coverage.svg)](https://github.com/tester/AllPlugins.jl/commits/main) [![Build Status](https://app.travis-ci.com/tester/AllPlugins.jl.svg?branch=main)](https://app.travis-ci.com/tester/AllPlugins.jl) [![Build Status](https://ci.appveyor.com/api/projects/status/github/tester/AllPlugins.jl?svg=true)](https://ci.appveyor.com/project/tester/AllPlugins-jl) [![Build Status](https://cloud.drone.io/api/badges/tester/AllPlugins.jl/status.svg)](https://cloud.drone.io/tester/AllPlugins.jl) [![Build Status](https://api.cirrus-ci.com/github/tester/AllPlugins.jl.svg)](https://cirrus-ci.com/github/tester/AllPlugins.jl) [![Coverage](https://codecov.io/gh/tester/AllPlugins.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/tester/AllPlugins.jl) [![Coverage](https://coveralls.io/repos/github/tester/AllPlugins.jl/badge.svg?branch=main)](https://coveralls.io/github/tester/AllPlugins.jl?branch=main) [![PkgEval](https://JuliaCI.github.io/NanosoldierReports/pkgeval_badges/A/AllPlugins.svg)](https://JuliaCI.github.io/NanosoldierReports/pkgeval_badges/A/AllPlugins.html) ================================================ FILE: test/fixtures/AllPlugins/benchmark/benchmarks.jl ================================================ using AllPlugins using BenchmarkTools SUITE = BenchmarkGroup() SUITE["rand"] = @benchmarkable rand(10) # Write your benchmarks here. ================================================ FILE: test/fixtures/AllPlugins/docs/Manifest.toml ================================================ # This file is machine-generated - editing it directly is not advised julia_version = "1.7.2" manifest_format = "2.0" [[deps.AllPlugins]] path = ".." uuid = "c51a4d33-e9a4-4efb-a257-e0de888ecc28" version = "1.0.0-DEV" [[deps.ArgTools]] uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f" [[deps.Artifacts]] uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" [[deps.Base64]] uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" [[deps.Dates]] deps = ["Printf"] uuid = "ade2ca70-3891-5945-98fb-dc099432e06a" [[deps.DocStringExtensions]] deps = ["LibGit2", "Markdown", "Pkg", "Test"] git-tree-sha1 = "88bb0edb352b16608036faadcc071adda068582a" uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" version = "0.8.1" [[deps.Documenter]] deps = ["Base64", "Dates", "DocStringExtensions", "InteractiveUtils", "JSON", "LibGit2", "Logging", "Markdown", "REPL", "Test", "Unicode"] git-tree-sha1 = "0be9bf63e854a2408c2ecd3c600d68d4d87d8a73" uuid = "e30172f5-a6a5-5a46-863b-614d45cd2de4" version = "0.24.2" [[deps.Downloads]] deps = ["ArgTools", "LibCURL", "NetworkOptions"] uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6" [[deps.InteractiveUtils]] deps = ["Markdown"] uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240" [[deps.JSON]] deps = ["Dates", "Mmap", "Parsers", "Unicode"] git-tree-sha1 = "b34d7cef7b337321e97d22242c3c2b91f476748e" uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" version = "0.21.0" [[deps.LibCURL]] deps = ["LibCURL_jll", "MozillaCACerts_jll"] uuid = "b27032c2-a3e7-50c8-80cd-2d36dbcbfd21" [[deps.LibCURL_jll]] deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll", "Zlib_jll", "nghttp2_jll"] uuid = "deac9b47-8bc7-5906-a0fe-35ac56dc84c0" [[deps.LibGit2]] deps = ["Base64", "NetworkOptions", "Printf", "SHA"] uuid = "76f85450-5226-5b5a-8eaa-529ad045b433" [[deps.LibSSH2_jll]] deps = ["Artifacts", "Libdl", "MbedTLS_jll"] uuid = "29816b5a-b9ab-546f-933c-edad1886dfa8" [[deps.Libdl]] uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb" [[deps.Logging]] uuid = "56ddb016-857b-54e1-b83d-db4d58db5568" [[deps.Markdown]] deps = ["Base64"] uuid = "d6f4376e-aef5-505a-96c1-9c027394607a" [[deps.MbedTLS_jll]] deps = ["Artifacts", "Libdl"] uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1" [[deps.Mmap]] uuid = "a63ad114-7e13-5084-954f-fe012c677804" [[deps.MozillaCACerts_jll]] uuid = "14a3606d-f60d-562e-9121-12d972cd8159" [[deps.NetworkOptions]] uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908" [[deps.Parsers]] deps = ["Dates", "Test"] git-tree-sha1 = "0139ba59ce9bc680e2925aec5b7db79065d60556" uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0" version = "0.3.10" [[deps.Pkg]] deps = ["Artifacts", "Dates", "Downloads", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"] uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" [[deps.Printf]] deps = ["Unicode"] uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7" [[deps.REPL]] deps = ["InteractiveUtils", "Markdown", "Sockets", "Unicode"] uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" [[deps.Random]] deps = ["SHA", "Serialization"] uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" [[deps.SHA]] uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" [[deps.Serialization]] uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b" [[deps.Sockets]] uuid = "6462fe0b-24de-5631-8697-dd941f90decc" [[deps.TOML]] deps = ["Dates"] uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76" [[deps.Tar]] deps = ["ArgTools", "SHA"] uuid = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e" [[deps.Test]] deps = ["InteractiveUtils", "Logging", "Random", "Serialization"] uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [[deps.UUIDs]] deps = ["Random", "SHA"] uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" [[deps.Unicode]] uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" [[deps.Zlib_jll]] deps = ["Libdl"] uuid = "83775a58-1f1d-513f-b197-d71354ab007a" [[deps.nghttp2_jll]] deps = ["Artifacts", "Libdl"] uuid = "8e850ede-7688-5339-a07c-302acd2aaf8d" [[deps.p7zip_jll]] deps = ["Artifacts", "Libdl"] uuid = "3f19e933-33d8-53b3-aaab-bd5110c3b7a0" ================================================ FILE: test/fixtures/AllPlugins/docs/Project.toml ================================================ [deps] Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" ================================================ FILE: test/fixtures/AllPlugins/docs/make.jl ================================================ using AllPlugins using Documenter DocMeta.setdocmeta!(AllPlugins, :DocTestSetup, :(using AllPlugins); recursive=true) makedocs(; modules=[AllPlugins], authors="tester", sitename="AllPlugins.jl", format=Documenter.HTML(; edit_link="main", assets=String[], ), pages=[ "Home" => "index.md", ], ) ================================================ FILE: test/fixtures/AllPlugins/docs/src/index.md ================================================ ```@meta CurrentModule = AllPlugins ``` # AllPlugins Documentation for [AllPlugins](https://github.com/tester/AllPlugins.jl). ```@index ``` ```@autodocs Modules = [AllPlugins] ``` ================================================ FILE: test/fixtures/AllPlugins/src/AllPlugins.jl ================================================ module AllPlugins # Write your package code here. end ================================================ FILE: test/fixtures/AllPlugins/test/runtests.jl ================================================ using AllPlugins using Test @testset "AllPlugins.jl" begin # Write your tests here. end ================================================ FILE: test/fixtures/Basic/.github/dependabot.yml ================================================ # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates version: 2 updates: - package-ecosystem: "github-actions" directory: "/" schedule: interval: "weekly" # To group all GitHub Actions updates into a single PR, uncomment the following: # groups: # github-actions: # patterns: # - "*" - package-ecosystem: "julia" directories: - "/" - "/docs" - "/test" schedule: interval: "weekly" # To group all Julia dependency updates into a single PR, uncomment the following: # groups: # julia-dependencies: # patterns: # - "*" ================================================ FILE: test/fixtures/Basic/.github/workflows/CI.yml ================================================ name: CI on: push: branches: - main tags: ['*'] pull_request: workflow_dispatch: concurrency: # Skip intermediate builds: always. # Cancel intermediate builds: only if it is a pull request build. group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} jobs: test: name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} runs-on: ${{ matrix.os }} timeout-minutes: 60 permissions: # needed to allow julia-actions/cache to proactively delete old caches that it has created actions: write contents: read strategy: fail-fast: false matrix: version: - '1.10' - 'pre' os: - ubuntu-latest arch: - x64 steps: - uses: actions/checkout@v6 - uses: julia-actions/setup-julia@v2 with: version: ${{ matrix.version }} arch: ${{ matrix.arch }} - uses: julia-actions/cache@v2 - uses: julia-actions/julia-buildpkg@v1 - uses: julia-actions/julia-runtest@v1 ================================================ FILE: test/fixtures/Basic/.github/workflows/TagBot.yml ================================================ name: TagBot on: issue_comment: types: - created workflow_dispatch: jobs: TagBot: if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot' runs-on: ubuntu-latest steps: - uses: JuliaRegistries/TagBot@v1 with: token: ${{ secrets.GITHUB_TOKEN }} # For commits that modify workflow files: SSH key enables tagging, but # releases require manual creation. For full automation of such commits, # use a PAT with `workflow` scope instead of GITHUB_TOKEN. # See: https://github.com/JuliaRegistries/TagBot#commits-that-modify-workflow-files ssh: ${{ secrets.DOCUMENTER_KEY }} ================================================ FILE: test/fixtures/Basic/.gitignore ================================================ /Manifest*.toml ================================================ FILE: test/fixtures/Basic/LICENSE ================================================ MIT License Copyright (c) 2019 tester Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: test/fixtures/Basic/Manifest.toml ================================================ # This file is machine-generated - editing it directly is not advised ================================================ FILE: test/fixtures/Basic/Project.toml ================================================ name = "Basic" uuid = "c51a4d33-e9a4-4efb-a257-e0de888ecc28" authors = ["tester"] version = "1.0.0-DEV" [compat] julia = "1.10.10" [extras] Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [targets] test = ["Test"] ================================================ FILE: test/fixtures/Basic/README.md ================================================ # Basic [![Build Status](https://github.com/tester/Basic.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/tester/Basic.jl/actions/workflows/CI.yml?query=branch%3Amain) ================================================ FILE: test/fixtures/Basic/src/Basic.jl ================================================ module Basic # Write your package code here. end ================================================ FILE: test/fixtures/Basic/test/runtests.jl ================================================ using Basic using Test @testset "Basic.jl" begin # Write your tests here. end ================================================ FILE: test/fixtures/DocumenterGitHubActions/.github/dependabot.yml ================================================ # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates version: 2 updates: - package-ecosystem: "github-actions" directory: "/" schedule: interval: "weekly" # To group all GitHub Actions updates into a single PR, uncomment the following: # groups: # github-actions: # patterns: # - "*" - package-ecosystem: "julia" directories: - "/" - "/docs" - "/test" schedule: interval: "weekly" # To group all Julia dependency updates into a single PR, uncomment the following: # groups: # julia-dependencies: # patterns: # - "*" ================================================ FILE: test/fixtures/DocumenterGitHubActions/.github/workflows/CI.yml ================================================ name: CI on: push: branches: - main tags: ['*'] pull_request: workflow_dispatch: concurrency: # Skip intermediate builds: always. # Cancel intermediate builds: only if it is a pull request build. group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} jobs: test: name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} runs-on: ${{ matrix.os }} timeout-minutes: 60 permissions: # needed to allow julia-actions/cache to proactively delete old caches that it has created actions: write contents: read strategy: fail-fast: false matrix: version: - '1.10' - 'pre' os: - ubuntu-latest arch: - x64 steps: - uses: actions/checkout@v6 - uses: julia-actions/setup-julia@v2 with: version: ${{ matrix.version }} arch: ${{ matrix.arch }} - uses: julia-actions/cache@v2 - uses: julia-actions/julia-buildpkg@v1 - uses: julia-actions/julia-runtest@v1 docs: name: Documentation runs-on: ubuntu-latest permissions: actions: write # needed to allow julia-actions/cache to proactively delete old caches that it has created contents: write statuses: write steps: - uses: actions/checkout@v6 - uses: julia-actions/setup-julia@v2 with: version: '1' - uses: julia-actions/cache@v2 - uses: julia-actions/julia-buildpkg@v1 - uses: julia-actions/julia-docdeploy@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} - name: Run doctests shell: julia --project=docs --color=yes {0} run: | using Documenter: DocMeta, doctest using DocumenterGitHubActions DocMeta.setdocmeta!(DocumenterGitHubActions, :DocTestSetup, :(using DocumenterGitHubActions); recursive=true) doctest(DocumenterGitHubActions) ================================================ FILE: test/fixtures/DocumenterGitHubActions/.github/workflows/TagBot.yml ================================================ name: TagBot on: issue_comment: types: - created workflow_dispatch: jobs: TagBot: if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot' runs-on: ubuntu-latest steps: - uses: JuliaRegistries/TagBot@v1 with: token: ${{ secrets.GITHUB_TOKEN }} # For commits that modify workflow files: SSH key enables tagging, but # releases require manual creation. For full automation of such commits, # use a PAT with `workflow` scope instead of GITHUB_TOKEN. # See: https://github.com/JuliaRegistries/TagBot#commits-that-modify-workflow-files ssh: ${{ secrets.DOCUMENTER_KEY }} ================================================ FILE: test/fixtures/DocumenterGitHubActions/.gitignore ================================================ /Manifest*.toml /docs/Manifest*.toml /docs/build/ ================================================ FILE: test/fixtures/DocumenterGitHubActions/LICENSE ================================================ MIT License Copyright (c) 2019 tester Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: test/fixtures/DocumenterGitHubActions/Project.toml ================================================ name = "DocumenterGitHubActions" uuid = "c51a4d33-e9a4-4efb-a257-e0de888ecc28" authors = ["tester"] version = "1.0.0-DEV" [compat] julia = "1.10.10" [extras] Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [targets] test = ["Test"] ================================================ FILE: test/fixtures/DocumenterGitHubActions/README.md ================================================ # DocumenterGitHubActions [![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://tester.github.io/DocumenterGitHubActions.jl/stable/) [![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://tester.github.io/DocumenterGitHubActions.jl/dev/) [![Build Status](https://github.com/tester/DocumenterGitHubActions.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/tester/DocumenterGitHubActions.jl/actions/workflows/CI.yml?query=branch%3Amain) ================================================ FILE: test/fixtures/DocumenterGitHubActions/docs/Manifest.toml ================================================ # This file is machine-generated - editing it directly is not advised julia_version = "1.7.2" manifest_format = "2.0" [[deps.ArgTools]] uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f" [[deps.Artifacts]] uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" [[deps.Base64]] uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" [[deps.Dates]] deps = ["Printf"] uuid = "ade2ca70-3891-5945-98fb-dc099432e06a" [[deps.DocStringExtensions]] deps = ["LibGit2", "Markdown", "Pkg", "Test"] git-tree-sha1 = "88bb0edb352b16608036faadcc071adda068582a" uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" version = "0.8.1" [[deps.Documenter]] deps = ["Base64", "Dates", "DocStringExtensions", "InteractiveUtils", "JSON", "LibGit2", "Logging", "Markdown", "REPL", "Test", "Unicode"] git-tree-sha1 = "0be9bf63e854a2408c2ecd3c600d68d4d87d8a73" uuid = "e30172f5-a6a5-5a46-863b-614d45cd2de4" version = "0.24.2" [[deps.DocumenterGitHubActions]] path = ".." uuid = "c51a4d33-e9a4-4efb-a257-e0de888ecc28" version = "1.0.0-DEV" [[deps.Downloads]] deps = ["ArgTools", "LibCURL", "NetworkOptions"] uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6" [[deps.InteractiveUtils]] deps = ["Markdown"] uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240" [[deps.JSON]] deps = ["Dates", "Mmap", "Parsers", "Unicode"] git-tree-sha1 = "b34d7cef7b337321e97d22242c3c2b91f476748e" uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" version = "0.21.0" [[deps.LibCURL]] deps = ["LibCURL_jll", "MozillaCACerts_jll"] uuid = "b27032c2-a3e7-50c8-80cd-2d36dbcbfd21" [[deps.LibCURL_jll]] deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll", "Zlib_jll", "nghttp2_jll"] uuid = "deac9b47-8bc7-5906-a0fe-35ac56dc84c0" [[deps.LibGit2]] deps = ["Base64", "NetworkOptions", "Printf", "SHA"] uuid = "76f85450-5226-5b5a-8eaa-529ad045b433" [[deps.LibSSH2_jll]] deps = ["Artifacts", "Libdl", "MbedTLS_jll"] uuid = "29816b5a-b9ab-546f-933c-edad1886dfa8" [[deps.Libdl]] uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb" [[deps.Logging]] uuid = "56ddb016-857b-54e1-b83d-db4d58db5568" [[deps.Markdown]] deps = ["Base64"] uuid = "d6f4376e-aef5-505a-96c1-9c027394607a" [[deps.MbedTLS_jll]] deps = ["Artifacts", "Libdl"] uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1" [[deps.Mmap]] uuid = "a63ad114-7e13-5084-954f-fe012c677804" [[deps.MozillaCACerts_jll]] uuid = "14a3606d-f60d-562e-9121-12d972cd8159" [[deps.NetworkOptions]] uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908" [[deps.Parsers]] deps = ["Dates", "Test"] git-tree-sha1 = "0139ba59ce9bc680e2925aec5b7db79065d60556" uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0" version = "0.3.10" [[deps.Pkg]] deps = ["Artifacts", "Dates", "Downloads", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"] uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" [[deps.Printf]] deps = ["Unicode"] uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7" [[deps.REPL]] deps = ["InteractiveUtils", "Markdown", "Sockets", "Unicode"] uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" [[deps.Random]] deps = ["SHA", "Serialization"] uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" [[deps.SHA]] uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" [[deps.Serialization]] uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b" [[deps.Sockets]] uuid = "6462fe0b-24de-5631-8697-dd941f90decc" [[deps.TOML]] deps = ["Dates"] uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76" [[deps.Tar]] deps = ["ArgTools", "SHA"] uuid = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e" [[deps.Test]] deps = ["InteractiveUtils", "Logging", "Random", "Serialization"] uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [[deps.UUIDs]] deps = ["Random", "SHA"] uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" [[deps.Unicode]] uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" [[deps.Zlib_jll]] deps = ["Libdl"] uuid = "83775a58-1f1d-513f-b197-d71354ab007a" [[deps.nghttp2_jll]] deps = ["Artifacts", "Libdl"] uuid = "8e850ede-7688-5339-a07c-302acd2aaf8d" [[deps.p7zip_jll]] deps = ["Artifacts", "Libdl"] uuid = "3f19e933-33d8-53b3-aaab-bd5110c3b7a0" ================================================ FILE: test/fixtures/DocumenterGitHubActions/docs/Project.toml ================================================ [deps] Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" ================================================ FILE: test/fixtures/DocumenterGitHubActions/docs/make.jl ================================================ using DocumenterGitHubActions using Documenter DocMeta.setdocmeta!(DocumenterGitHubActions, :DocTestSetup, :(using DocumenterGitHubActions); recursive=true) makedocs(; modules=[DocumenterGitHubActions], authors="tester", sitename="DocumenterGitHubActions.jl", format=Documenter.HTML(; canonical="https://tester.github.io/DocumenterGitHubActions.jl", edit_link="main", assets=String[], ), pages=[ "Home" => "index.md", ], ) deploydocs(; repo="github.com/tester/DocumenterGitHubActions.jl", devbranch="main", ) ================================================ FILE: test/fixtures/DocumenterGitHubActions/docs/src/index.md ================================================ ```@meta CurrentModule = DocumenterGitHubActions ``` # DocumenterGitHubActions Documentation for [DocumenterGitHubActions](https://github.com/tester/DocumenterGitHubActions.jl). ```@index ``` ```@autodocs Modules = [DocumenterGitHubActions] ``` ================================================ FILE: test/fixtures/DocumenterGitHubActions/src/DocumenterGitHubActions.jl ================================================ module DocumenterGitHubActions # Write your package code here. end ================================================ FILE: test/fixtures/DocumenterGitHubActions/test/runtests.jl ================================================ using DocumenterGitHubActions using Test @testset "DocumenterGitHubActions.jl" begin # Write your tests here. end ================================================ FILE: test/fixtures/DocumenterGitLabCI/.github/dependabot.yml ================================================ # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates version: 2 updates: - package-ecosystem: "github-actions" directory: "/" schedule: interval: "weekly" # To group all GitHub Actions updates into a single PR, uncomment the following: # groups: # github-actions: # patterns: # - "*" - package-ecosystem: "julia" directories: - "/" - "/docs" - "/test" schedule: interval: "weekly" # To group all Julia dependency updates into a single PR, uncomment the following: # groups: # julia-dependencies: # patterns: # - "*" ================================================ FILE: test/fixtures/DocumenterGitLabCI/.github/workflows/CI.yml ================================================ name: CI on: push: branches: - main tags: ['*'] pull_request: workflow_dispatch: concurrency: # Skip intermediate builds: always. # Cancel intermediate builds: only if it is a pull request build. group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} jobs: test: name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} runs-on: ${{ matrix.os }} timeout-minutes: 60 permissions: # needed to allow julia-actions/cache to proactively delete old caches that it has created actions: write contents: read strategy: fail-fast: false matrix: version: - '1.10' - 'pre' os: - ubuntu-latest arch: - x64 steps: - uses: actions/checkout@v6 - uses: julia-actions/setup-julia@v2 with: version: ${{ matrix.version }} arch: ${{ matrix.arch }} - uses: julia-actions/cache@v2 - uses: julia-actions/julia-buildpkg@v1 - uses: julia-actions/julia-runtest@v1 ================================================ FILE: test/fixtures/DocumenterGitLabCI/.github/workflows/TagBot.yml ================================================ name: TagBot on: issue_comment: types: - created workflow_dispatch: jobs: TagBot: if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot' runs-on: ubuntu-latest steps: - uses: JuliaRegistries/TagBot@v1 with: token: ${{ secrets.GITHUB_TOKEN }} # For commits that modify workflow files: SSH key enables tagging, but # releases require manual creation. For full automation of such commits, # use a PAT with `workflow` scope instead of GITHUB_TOKEN. # See: https://github.com/JuliaRegistries/TagBot#commits-that-modify-workflow-files ssh: ${{ secrets.DOCUMENTER_KEY }} ================================================ FILE: test/fixtures/DocumenterGitLabCI/.gitignore ================================================ *.jl.*.cov *.jl.cov *.jl.mem /Manifest*.toml /docs/Manifest*.toml /docs/build/ ================================================ FILE: test/fixtures/DocumenterGitLabCI/.gitlab-ci.yml ================================================ .script: script: - | julia --project=@. -e ' using Pkg Pkg.build() Pkg.test(coverage=true)' .coverage: coverage: /Test coverage (\d+\.\d+%)/ after_script: - | julia -e ' using Pkg Pkg.add("Coverage") using Coverage c, t = get_summary(process_folder()) using Printf @printf "Test coverage %.2f%%\n" 100c / t' Julia 1.10: image: julia:1.10 extends: - .script - .coverage pages: image: julia:1.10 stage: deploy script: - | julia --project=docs -e ' using Pkg Pkg.develop(PackageSpec(path=pwd())) Pkg.instantiate() using Documenter: doctest using DocumenterGitLabCI doctest(DocumenterGitLabCI) include("docs/make.jl")' - mkdir -p public - mv docs/build public/dev artifacts: paths: - public only: - main ================================================ FILE: test/fixtures/DocumenterGitLabCI/LICENSE ================================================ MIT License Copyright (c) 2019 tester Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: test/fixtures/DocumenterGitLabCI/Project.toml ================================================ name = "DocumenterGitLabCI" uuid = "c51a4d33-e9a4-4efb-a257-e0de888ecc28" authors = ["tester"] version = "1.0.0-DEV" [compat] julia = "1.10.10" [extras] Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [targets] test = ["Test"] ================================================ FILE: test/fixtures/DocumenterGitLabCI/README.md ================================================ # DocumenterGitLabCI [![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://tester.gitlab.io/DocumenterGitLabCI.jl/dev) [![Build Status](https://github.com/tester/DocumenterGitLabCI.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/tester/DocumenterGitLabCI.jl/actions/workflows/CI.yml?query=branch%3Amain) [![Build Status](https://github.com/tester/DocumenterGitLabCI.jl/badges/main/pipeline.svg)](https://github.com/tester/DocumenterGitLabCI.jl/pipelines) [![Coverage](https://github.com/tester/DocumenterGitLabCI.jl/badges/main/coverage.svg)](https://github.com/tester/DocumenterGitLabCI.jl/commits/main) ================================================ FILE: test/fixtures/DocumenterGitLabCI/docs/Manifest.toml ================================================ # This file is machine-generated - editing it directly is not advised julia_version = "1.7.2" manifest_format = "2.0" [[deps.ArgTools]] uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f" [[deps.Artifacts]] uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" [[deps.Base64]] uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" [[deps.Dates]] deps = ["Printf"] uuid = "ade2ca70-3891-5945-98fb-dc099432e06a" [[deps.DocStringExtensions]] deps = ["LibGit2", "Markdown", "Pkg", "Test"] git-tree-sha1 = "88bb0edb352b16608036faadcc071adda068582a" uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" version = "0.8.1" [[deps.Documenter]] deps = ["Base64", "Dates", "DocStringExtensions", "InteractiveUtils", "JSON", "LibGit2", "Logging", "Markdown", "REPL", "Test", "Unicode"] git-tree-sha1 = "0be9bf63e854a2408c2ecd3c600d68d4d87d8a73" uuid = "e30172f5-a6a5-5a46-863b-614d45cd2de4" version = "0.24.2" [[deps.DocumenterGitLabCI]] path = ".." uuid = "c51a4d33-e9a4-4efb-a257-e0de888ecc28" version = "1.0.0-DEV" [[deps.Downloads]] deps = ["ArgTools", "LibCURL", "NetworkOptions"] uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6" [[deps.InteractiveUtils]] deps = ["Markdown"] uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240" [[deps.JSON]] deps = ["Dates", "Mmap", "Parsers", "Unicode"] git-tree-sha1 = "b34d7cef7b337321e97d22242c3c2b91f476748e" uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" version = "0.21.0" [[deps.LibCURL]] deps = ["LibCURL_jll", "MozillaCACerts_jll"] uuid = "b27032c2-a3e7-50c8-80cd-2d36dbcbfd21" [[deps.LibCURL_jll]] deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll", "Zlib_jll", "nghttp2_jll"] uuid = "deac9b47-8bc7-5906-a0fe-35ac56dc84c0" [[deps.LibGit2]] deps = ["Base64", "NetworkOptions", "Printf", "SHA"] uuid = "76f85450-5226-5b5a-8eaa-529ad045b433" [[deps.LibSSH2_jll]] deps = ["Artifacts", "Libdl", "MbedTLS_jll"] uuid = "29816b5a-b9ab-546f-933c-edad1886dfa8" [[deps.Libdl]] uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb" [[deps.Logging]] uuid = "56ddb016-857b-54e1-b83d-db4d58db5568" [[deps.Markdown]] deps = ["Base64"] uuid = "d6f4376e-aef5-505a-96c1-9c027394607a" [[deps.MbedTLS_jll]] deps = ["Artifacts", "Libdl"] uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1" [[deps.Mmap]] uuid = "a63ad114-7e13-5084-954f-fe012c677804" [[deps.MozillaCACerts_jll]] uuid = "14a3606d-f60d-562e-9121-12d972cd8159" [[deps.NetworkOptions]] uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908" [[deps.Parsers]] deps = ["Dates", "Test"] git-tree-sha1 = "0139ba59ce9bc680e2925aec5b7db79065d60556" uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0" version = "0.3.10" [[deps.Pkg]] deps = ["Artifacts", "Dates", "Downloads", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"] uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" [[deps.Printf]] deps = ["Unicode"] uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7" [[deps.REPL]] deps = ["InteractiveUtils", "Markdown", "Sockets", "Unicode"] uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" [[deps.Random]] deps = ["SHA", "Serialization"] uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" [[deps.SHA]] uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" [[deps.Serialization]] uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b" [[deps.Sockets]] uuid = "6462fe0b-24de-5631-8697-dd941f90decc" [[deps.TOML]] deps = ["Dates"] uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76" [[deps.Tar]] deps = ["ArgTools", "SHA"] uuid = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e" [[deps.Test]] deps = ["InteractiveUtils", "Logging", "Random", "Serialization"] uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [[deps.UUIDs]] deps = ["Random", "SHA"] uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" [[deps.Unicode]] uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" [[deps.Zlib_jll]] deps = ["Libdl"] uuid = "83775a58-1f1d-513f-b197-d71354ab007a" [[deps.nghttp2_jll]] deps = ["Artifacts", "Libdl"] uuid = "8e850ede-7688-5339-a07c-302acd2aaf8d" [[deps.p7zip_jll]] deps = ["Artifacts", "Libdl"] uuid = "3f19e933-33d8-53b3-aaab-bd5110c3b7a0" ================================================ FILE: test/fixtures/DocumenterGitLabCI/docs/Project.toml ================================================ [deps] Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" ================================================ FILE: test/fixtures/DocumenterGitLabCI/docs/make.jl ================================================ using DocumenterGitLabCI using Documenter DocMeta.setdocmeta!(DocumenterGitLabCI, :DocTestSetup, :(using DocumenterGitLabCI); recursive=true) makedocs(; modules=[DocumenterGitLabCI], authors="tester", sitename="DocumenterGitLabCI.jl", format=Documenter.HTML(; canonical="https://tester.gitlab.io/DocumenterGitLabCI.jl", edit_link="main", assets=String[], ), pages=[ "Home" => "index.md", ], ) ================================================ FILE: test/fixtures/DocumenterGitLabCI/docs/src/index.md ================================================ ```@meta CurrentModule = DocumenterGitLabCI ``` # DocumenterGitLabCI Documentation for [DocumenterGitLabCI](https://github.com/tester/DocumenterGitLabCI.jl). ```@index ``` ```@autodocs Modules = [DocumenterGitLabCI] ``` ================================================ FILE: test/fixtures/DocumenterGitLabCI/src/DocumenterGitLabCI.jl ================================================ module DocumenterGitLabCI # Write your package code here. end ================================================ FILE: test/fixtures/DocumenterGitLabCI/test/runtests.jl ================================================ using DocumenterGitLabCI using Test @testset "DocumenterGitLabCI.jl" begin # Write your tests here. end ================================================ FILE: test/fixtures/DocumenterTravis/.github/dependabot.yml ================================================ # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates version: 2 updates: - package-ecosystem: "github-actions" directory: "/" schedule: interval: "weekly" # To group all GitHub Actions updates into a single PR, uncomment the following: # groups: # github-actions: # patterns: # - "*" - package-ecosystem: "julia" directories: - "/" - "/docs" - "/test" schedule: interval: "weekly" # To group all Julia dependency updates into a single PR, uncomment the following: # groups: # julia-dependencies: # patterns: # - "*" ================================================ FILE: test/fixtures/DocumenterTravis/.github/workflows/CI.yml ================================================ name: CI on: push: branches: - main tags: ['*'] pull_request: workflow_dispatch: concurrency: # Skip intermediate builds: always. # Cancel intermediate builds: only if it is a pull request build. group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} jobs: test: name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} runs-on: ${{ matrix.os }} timeout-minutes: 60 permissions: # needed to allow julia-actions/cache to proactively delete old caches that it has created actions: write contents: read strategy: fail-fast: false matrix: version: - '1.10' - 'pre' os: - ubuntu-latest arch: - x64 steps: - uses: actions/checkout@v6 - uses: julia-actions/setup-julia@v2 with: version: ${{ matrix.version }} arch: ${{ matrix.arch }} - uses: julia-actions/cache@v2 - uses: julia-actions/julia-buildpkg@v1 - uses: julia-actions/julia-runtest@v1 ================================================ FILE: test/fixtures/DocumenterTravis/.github/workflows/TagBot.yml ================================================ name: TagBot on: issue_comment: types: - created workflow_dispatch: jobs: TagBot: if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot' runs-on: ubuntu-latest steps: - uses: JuliaRegistries/TagBot@v1 with: token: ${{ secrets.GITHUB_TOKEN }} # For commits that modify workflow files: SSH key enables tagging, but # releases require manual creation. For full automation of such commits, # use a PAT with `workflow` scope instead of GITHUB_TOKEN. # See: https://github.com/JuliaRegistries/TagBot#commits-that-modify-workflow-files ssh: ${{ secrets.DOCUMENTER_KEY }} ================================================ FILE: test/fixtures/DocumenterTravis/.gitignore ================================================ /Manifest*.toml /docs/Manifest*.toml /docs/build/ ================================================ FILE: test/fixtures/DocumenterTravis/.travis.yml ================================================ # Documentation: http://docs.travis-ci.com/user/languages/julia language: julia notifications: email: false julia: - 1.10 - nightly os: - linux arch: - x64 cache: directories: - ~/.julia/artifacts jobs: fast_finish: true allow_failures: - julia: nightly include: - stage: Documentation julia: 1 script: - | julia --project=docs -e ' using Pkg Pkg.develop(PackageSpec(path=pwd())) Pkg.instantiate()' - | julia --project=docs -e ' using Pkg Pkg.develop(PackageSpec(path=pwd())) Pkg.instantiate() using Documenter: DocMeta, doctest using DocumenterTravis DocMeta.setdocmeta!(DocumenterTravis, :DocTestSetup, :(using DocumenterTravis); recursive=true) doctest(DocumenterTravis) include("docs/make.jl")' after_success: skip ================================================ FILE: test/fixtures/DocumenterTravis/LICENSE ================================================ MIT License Copyright (c) 2019 tester Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: test/fixtures/DocumenterTravis/Project.toml ================================================ name = "DocumenterTravis" uuid = "c51a4d33-e9a4-4efb-a257-e0de888ecc28" authors = ["tester"] version = "1.0.0-DEV" [compat] julia = "1.10.10" [extras] Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [targets] test = ["Test"] ================================================ FILE: test/fixtures/DocumenterTravis/README.md ================================================ # DocumenterTravis [![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://tester.github.io/DocumenterTravis.jl/stable/) [![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://tester.github.io/DocumenterTravis.jl/dev/) [![Build Status](https://github.com/tester/DocumenterTravis.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/tester/DocumenterTravis.jl/actions/workflows/CI.yml?query=branch%3Amain) [![Build Status](https://app.travis-ci.com/tester/DocumenterTravis.jl.svg?branch=main)](https://app.travis-ci.com/tester/DocumenterTravis.jl) ================================================ FILE: test/fixtures/DocumenterTravis/docs/Manifest.toml ================================================ # This file is machine-generated - editing it directly is not advised julia_version = "1.7.2" manifest_format = "2.0" [[deps.ArgTools]] uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f" [[deps.Artifacts]] uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" [[deps.Base64]] uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" [[deps.Dates]] deps = ["Printf"] uuid = "ade2ca70-3891-5945-98fb-dc099432e06a" [[deps.DocStringExtensions]] deps = ["LibGit2", "Markdown", "Pkg", "Test"] git-tree-sha1 = "88bb0edb352b16608036faadcc071adda068582a" uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" version = "0.8.1" [[deps.Documenter]] deps = ["Base64", "Dates", "DocStringExtensions", "InteractiveUtils", "JSON", "LibGit2", "Logging", "Markdown", "REPL", "Test", "Unicode"] git-tree-sha1 = "0be9bf63e854a2408c2ecd3c600d68d4d87d8a73" uuid = "e30172f5-a6a5-5a46-863b-614d45cd2de4" version = "0.24.2" [[deps.DocumenterTravis]] path = ".." uuid = "c51a4d33-e9a4-4efb-a257-e0de888ecc28" version = "1.0.0-DEV" [[deps.Downloads]] deps = ["ArgTools", "LibCURL", "NetworkOptions"] uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6" [[deps.InteractiveUtils]] deps = ["Markdown"] uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240" [[deps.JSON]] deps = ["Dates", "Mmap", "Parsers", "Unicode"] git-tree-sha1 = "b34d7cef7b337321e97d22242c3c2b91f476748e" uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" version = "0.21.0" [[deps.LibCURL]] deps = ["LibCURL_jll", "MozillaCACerts_jll"] uuid = "b27032c2-a3e7-50c8-80cd-2d36dbcbfd21" [[deps.LibCURL_jll]] deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll", "Zlib_jll", "nghttp2_jll"] uuid = "deac9b47-8bc7-5906-a0fe-35ac56dc84c0" [[deps.LibGit2]] deps = ["Base64", "NetworkOptions", "Printf", "SHA"] uuid = "76f85450-5226-5b5a-8eaa-529ad045b433" [[deps.LibSSH2_jll]] deps = ["Artifacts", "Libdl", "MbedTLS_jll"] uuid = "29816b5a-b9ab-546f-933c-edad1886dfa8" [[deps.Libdl]] uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb" [[deps.Logging]] uuid = "56ddb016-857b-54e1-b83d-db4d58db5568" [[deps.Markdown]] deps = ["Base64"] uuid = "d6f4376e-aef5-505a-96c1-9c027394607a" [[deps.MbedTLS_jll]] deps = ["Artifacts", "Libdl"] uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1" [[deps.Mmap]] uuid = "a63ad114-7e13-5084-954f-fe012c677804" [[deps.MozillaCACerts_jll]] uuid = "14a3606d-f60d-562e-9121-12d972cd8159" [[deps.NetworkOptions]] uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908" [[deps.Parsers]] deps = ["Dates", "Test"] git-tree-sha1 = "0139ba59ce9bc680e2925aec5b7db79065d60556" uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0" version = "0.3.10" [[deps.Pkg]] deps = ["Artifacts", "Dates", "Downloads", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"] uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" [[deps.Printf]] deps = ["Unicode"] uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7" [[deps.REPL]] deps = ["InteractiveUtils", "Markdown", "Sockets", "Unicode"] uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" [[deps.Random]] deps = ["SHA", "Serialization"] uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" [[deps.SHA]] uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" [[deps.Serialization]] uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b" [[deps.Sockets]] uuid = "6462fe0b-24de-5631-8697-dd941f90decc" [[deps.TOML]] deps = ["Dates"] uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76" [[deps.Tar]] deps = ["ArgTools", "SHA"] uuid = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e" [[deps.Test]] deps = ["InteractiveUtils", "Logging", "Random", "Serialization"] uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [[deps.UUIDs]] deps = ["Random", "SHA"] uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" [[deps.Unicode]] uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" [[deps.Zlib_jll]] deps = ["Libdl"] uuid = "83775a58-1f1d-513f-b197-d71354ab007a" [[deps.nghttp2_jll]] deps = ["Artifacts", "Libdl"] uuid = "8e850ede-7688-5339-a07c-302acd2aaf8d" [[deps.p7zip_jll]] deps = ["Artifacts", "Libdl"] uuid = "3f19e933-33d8-53b3-aaab-bd5110c3b7a0" ================================================ FILE: test/fixtures/DocumenterTravis/docs/Project.toml ================================================ [deps] Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" ================================================ FILE: test/fixtures/DocumenterTravis/docs/make.jl ================================================ using DocumenterTravis using Documenter DocMeta.setdocmeta!(DocumenterTravis, :DocTestSetup, :(using DocumenterTravis); recursive=true) makedocs(; modules=[DocumenterTravis], authors="tester", sitename="DocumenterTravis.jl", format=Documenter.HTML(; canonical="https://tester.github.io/DocumenterTravis.jl", edit_link="main", assets=String[], ), pages=[ "Home" => "index.md", ], ) deploydocs(; repo="github.com/tester/DocumenterTravis.jl", devbranch="main", ) ================================================ FILE: test/fixtures/DocumenterTravis/docs/src/index.md ================================================ ```@meta CurrentModule = DocumenterTravis ``` # DocumenterTravis Documentation for [DocumenterTravis](https://github.com/tester/DocumenterTravis.jl). ```@index ``` ```@autodocs Modules = [DocumenterTravis] ``` ================================================ FILE: test/fixtures/DocumenterTravis/src/DocumenterTravis.jl ================================================ module DocumenterTravis # Write your package code here. end ================================================ FILE: test/fixtures/DocumenterTravis/test/runtests.jl ================================================ using DocumenterTravis using Test @testset "DocumenterTravis.jl" begin # Write your tests here. end ================================================ FILE: test/fixtures/WackyOptions/.JuliaFormatter.toml ================================================ # See https://domluna.github.io/JuliaFormatter.jl/stable/ for a list of options style = "blue" ================================================ FILE: test/fixtures/WackyOptions/.appveyor.yml ================================================ # Documentation: https://github.com/JuliaCI/Appveyor.jl environment: matrix: - julia_version: 1.2 platform: - x64 - x86 cache: - '%USERPROFILE%\.julia\artifacts' branches: only: - whackybranch - /release-.*/ notifications: - provider: Email on_build_success: false on_build_failure: false on_build_status_changed: false install: - ps: iex ((new-object net.webclient).DownloadString("https://raw.githubusercontent.com/JuliaCI/Appveyor.jl/version-1/bin/install.ps1")) build_script: - echo "%JL_BUILD_SCRIPT%" - C:\julia\bin\julia -e "%JL_BUILD_SCRIPT%" test_script: - echo "%JL_TEST_SCRIPT%" - C:\julia\bin\julia -e "%JL_TEST_SCRIPT%" on_success: - echo "%JL_CODECOV_SCRIPT%" - C:\julia\bin\julia -e "%JL_CODECOV_SCRIPT%" ================================================ FILE: test/fixtures/WackyOptions/.cirrus.yml ================================================ freebsd_instance: image: freebsd-123 task: name: FreeBSD artifacts_cache: folder: ~/.julia/artifacts env: JULIA_VERSION: 1.2 JULIA_VERSION: 1.3 install_script: - sh -c "$(fetch https://raw.githubusercontent.com/ararslan/CirrusCI.jl/master/bin/install.sh -o -)" build_script: - cirrusjl build test_script: - cirrusjl test ================================================ FILE: test/fixtures/WackyOptions/.codecov.yml ================================================ DO NOT CHANGE THE CONTENTS OF THIS FILE! ================================================ FILE: test/fixtures/WackyOptions/.coveralls.yml ================================================ DO NOT CHANGE THE CONTENTS OF THIS FILE! ================================================ FILE: test/fixtures/WackyOptions/.drone.star ================================================ def main(ctx): pipelines = [] for arch in ["arm", "arm64"]: for julia in ["1.2", "1.3"]: pipelines.append(pipeline(arch, julia)) return pipelines def pipeline(arch, julia): return { "kind": "pipeline", "type": "docker", "name": "Julia %s - %s" % (julia, arch), "platform": { "os": "linux", "arch": arch, }, "steps": [ { "name": "test", "image": "julia:%s" % julia, "commands": [ "julia -e 'using InteractiveUtils; versioninfo()'", "julia --project=@. -e 'using Pkg; Pkg.instantiate(); Pkg.build(); Pkg.test();'", ], }, ], } ================================================ FILE: test/fixtures/WackyOptions/.github/dependabot.yml ================================================ # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates version: 2 updates: - package-ecosystem: "github-actions" directory: "/" schedule: interval: "weekly" # To group all GitHub Actions updates into a single PR, uncomment the following: # groups: # github-actions: # patterns: # - "*" - package-ecosystem: "julia" directories: - "/" - "/docs" - "/test" schedule: interval: "weekly" # To group all Julia dependency updates into a single PR, uncomment the following: # groups: # julia-dependencies: # patterns: # - "*" ================================================ FILE: test/fixtures/WackyOptions/.github/workflows/CI.yml ================================================ name: CI on: push: branches: - whackybranch tags: ['*'] pull_request: workflow_dispatch: concurrency: # Skip intermediate builds: always. # Cancel intermediate builds: only if it is a pull request build. group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} jobs: test: name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} runs-on: ${{ matrix.os }} timeout-minutes: 60 permissions: # needed to allow julia-actions/cache to proactively delete old caches that it has created actions: write contents: read strategy: fail-fast: false matrix: version: - '1.10' - '1.2' - 'pre' os: arch: - x64 - x86 steps: - uses: actions/checkout@v6 - uses: julia-actions/setup-julia@v2 with: version: ${{ matrix.version }} arch: ${{ matrix.arch }} - uses: julia-actions/cache@v2 - uses: julia-actions/julia-buildpkg@v1 - uses: julia-actions/julia-runtest@v1 docs: name: Documentation runs-on: ubuntu-latest permissions: actions: write # needed to allow julia-actions/cache to proactively delete old caches that it has created contents: write statuses: write steps: - uses: actions/checkout@v6 - uses: julia-actions/setup-julia@v2 with: version: '1' - uses: julia-actions/cache@v2 - uses: julia-actions/julia-buildpkg@v1 - uses: julia-actions/julia-docdeploy@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} - name: Run doctests shell: julia --project=docs --color=yes {0} run: | using Documenter: DocMeta, doctest using WackyOptions DocMeta.setdocmeta!(WackyOptions, :DocTestSetup, :(using WackyOptions); recursive=true) doctest(WackyOptions) ================================================ FILE: test/fixtures/WackyOptions/.github/workflows/CompatHelper.yml ================================================ name: CompatHelper on: schedule: - cron: 0 0 */3 * * workflow_dispatch: jobs: CompatHelper: runs-on: ubuntu-latest steps: - name: Install CompatHelper run: using Pkg; Pkg.add("CompatHelper") shell: julia --color=yes {0} - name: Run CompatHelper run: using CompatHelper; CompatHelper.main() shell: julia --color=yes {0} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }} ================================================ FILE: test/fixtures/WackyOptions/.github/workflows/Register.yml ================================================ name: Register Package on: workflow_dispatch: inputs: version: description: gimme version required: true jobs: register: runs-on: ubuntu-latest permissions: contents: write steps: - uses: julia-actions/RegisterAction@latest with: token: ${{ secrets.GITHUB_TOKEN }} ================================================ FILE: test/fixtures/WackyOptions/.github/workflows/TagBot.yml ================================================ name: TagBot on: issue_comment: types: - created workflow_dispatch: jobs: TagBot: if: github.event_name == 'workflow_dispatch' || github.actor == 'OtherUser' runs-on: ubuntu-latest steps: - uses: JuliaRegistries/TagBot@v1 with: token: ${{ secrets.MYTOKEN }} # For commits that modify workflow files: SSH key enables tagging, but # releases require manual creation. For full automation of such commits, # use a PAT with `workflow` scope instead of GITHUB_TOKEN. # See: https://github.com/JuliaRegistries/TagBot#commits-that-modify-workflow-files ssh: ${{ secrets.SSHKEY }} ssh_password: ${{ secrets.SSHPASS }} changelog: | Line 1 Line 2 Line 4 changelog_ignore: foo, bar gpg: ${{ secrets.GPGKEY }} gpg_password: ${{ secrets.GPGPASS }} registry: Foo/Bar branches: false dispatch: true dispatch_delay: 20 ================================================ FILE: test/fixtures/WackyOptions/.gitignore ================================================ *.jl.*.cov *.jl.cov *.jl.mem /docs/Manifest*.toml /docs/build/ a b c ================================================ FILE: test/fixtures/WackyOptions/.gitlab-ci.yml ================================================ .script: script: - | julia --project=@. -e ' using Pkg Pkg.build() Pkg.test()' Julia 1.2: image: julia:1.2 extends: - .script ================================================ FILE: test/fixtures/WackyOptions/.travis.yml ================================================ # Documentation: http://docs.travis-ci.com/user/languages/julia language: julia notifications: email: false julia: - 1.2 os: - linux arch: - x64 - x86 - arm64 cache: directories: - ~/.julia/artifacts jobs: fast_finish: true ================================================ FILE: test/fixtures/WackyOptions/CITATION.bib ================================================ @misc{WackyOptions.jl, author = {tester}, title = {WackyOptions.jl}, url = {https://x.com/tester/WackyOptions.jl}, version = {v1.0.0}, year = {2019}, month = {8} } ================================================ FILE: test/fixtures/WackyOptions/CODEOWNERS ================================================ * @user README.md @group user@example.com ================================================ FILE: test/fixtures/WackyOptions/LICENSE ================================================ ISC License Copyright (c) 2019, tester Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ================================================ FILE: test/fixtures/WackyOptions/Manifest.toml ================================================ # This file is machine-generated - editing it directly is not advised julia_version = "1.10.6" manifest_format = "2.0" project_hash = "4cda5991eecc2e1d07ef87b0be009754a63f367f" [deps] ================================================ FILE: test/fixtures/WackyOptions/Project.toml ================================================ name = "WackyOptions" uuid = "c51a4d33-e9a4-4efb-a257-e0de888ecc28" authors = ["tester"] version = "1.0.0" [compat] julia = "1.2" ================================================ FILE: test/fixtures/WackyOptions/README.md ================================================ # WackyOptions [![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://tester.github.io/WackyOptions.jl/stable/) [![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://tester.github.io/WackyOptions.jl/dev/) [![Build Status](https://github.com/tester/WackyOptions.jl/actions/workflows/CI.yml/badge.svg?branch=whackybranch)](https://github.com/tester/WackyOptions.jl/actions/workflows/CI.yml?query=branch%3Awhackybranch) [![Build Status](https://x.com/tester/WackyOptions.jl/badges/whackybranch/pipeline.svg)](https://x.com/tester/WackyOptions.jl/pipelines) [![Build Status](https://app.travis-ci.com/tester/WackyOptions.jl.svg?branch=whackybranch)](https://app.travis-ci.com/tester/WackyOptions.jl) [![Build Status](https://ci.appveyor.com/api/projects/status/github/tester/WackyOptions.jl?svg=true)](https://ci.appveyor.com/project/tester/WackyOptions-jl) [![Build Status](https://cloud.drone.io/api/badges/tester/WackyOptions.jl/status.svg)](https://cloud.drone.io/tester/WackyOptions.jl) [![Build Status](https://api.cirrus-ci.com/github/tester/WackyOptions.jl.svg)](https://cirrus-ci.com/github/tester/WackyOptions.jl) [![Coverage](https://coveralls.io/repos/github/tester/WackyOptions.jl/badge.svg?branch=whackybranch)](https://coveralls.io/github/tester/WackyOptions.jl?branch=whackybranch) [![Aqua](https://raw.githubusercontent.com/JuliaTesting/Aqua.jl/master/badge.svg)](https://github.com/JuliaTesting/Aqua.jl) ## Citing See [`CITATION.bib`](CITATION.bib) for the relevant reference(s). ================================================ FILE: test/fixtures/WackyOptions/docs/Manifest.toml ================================================ # This file is machine-generated - editing it directly is not advised julia_version = "1.7.2" manifest_format = "2.0" [[deps.ArgTools]] uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f" [[deps.Artifacts]] uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" [[deps.Base64]] uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" [[deps.Dates]] deps = ["Printf"] uuid = "ade2ca70-3891-5945-98fb-dc099432e06a" [[deps.DocStringExtensions]] deps = ["LibGit2", "Markdown", "Pkg", "Test"] git-tree-sha1 = "88bb0edb352b16608036faadcc071adda068582a" uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" version = "0.8.1" [[deps.Documenter]] deps = ["Base64", "Dates", "DocStringExtensions", "InteractiveUtils", "JSON", "LibGit2", "Logging", "Markdown", "REPL", "Test", "Unicode"] git-tree-sha1 = "0be9bf63e854a2408c2ecd3c600d68d4d87d8a73" uuid = "e30172f5-a6a5-5a46-863b-614d45cd2de4" version = "0.24.2" [[deps.Downloads]] deps = ["ArgTools", "LibCURL", "NetworkOptions"] uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6" [[deps.InteractiveUtils]] deps = ["Markdown"] uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240" [[deps.JSON]] deps = ["Dates", "Mmap", "Parsers", "Unicode"] git-tree-sha1 = "b34d7cef7b337321e97d22242c3c2b91f476748e" uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" version = "0.21.0" [[deps.LibCURL]] deps = ["LibCURL_jll", "MozillaCACerts_jll"] uuid = "b27032c2-a3e7-50c8-80cd-2d36dbcbfd21" [[deps.LibCURL_jll]] deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll", "Zlib_jll", "nghttp2_jll"] uuid = "deac9b47-8bc7-5906-a0fe-35ac56dc84c0" [[deps.LibGit2]] deps = ["Base64", "NetworkOptions", "Printf", "SHA"] uuid = "76f85450-5226-5b5a-8eaa-529ad045b433" [[deps.LibSSH2_jll]] deps = ["Artifacts", "Libdl", "MbedTLS_jll"] uuid = "29816b5a-b9ab-546f-933c-edad1886dfa8" [[deps.Libdl]] uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb" [[deps.Logging]] uuid = "56ddb016-857b-54e1-b83d-db4d58db5568" [[deps.Markdown]] deps = ["Base64"] uuid = "d6f4376e-aef5-505a-96c1-9c027394607a" [[deps.MbedTLS_jll]] deps = ["Artifacts", "Libdl"] uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1" [[deps.Mmap]] uuid = "a63ad114-7e13-5084-954f-fe012c677804" [[deps.MozillaCACerts_jll]] uuid = "14a3606d-f60d-562e-9121-12d972cd8159" [[deps.NetworkOptions]] uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908" [[deps.Parsers]] deps = ["Dates", "Test"] git-tree-sha1 = "0139ba59ce9bc680e2925aec5b7db79065d60556" uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0" version = "0.3.10" [[deps.Pkg]] deps = ["Artifacts", "Dates", "Downloads", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"] uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" [[deps.Printf]] deps = ["Unicode"] uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7" [[deps.REPL]] deps = ["InteractiveUtils", "Markdown", "Sockets", "Unicode"] uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" [[deps.Random]] deps = ["SHA", "Serialization"] uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" [[deps.SHA]] uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" [[deps.Serialization]] uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b" [[deps.Sockets]] uuid = "6462fe0b-24de-5631-8697-dd941f90decc" [[deps.TOML]] deps = ["Dates"] uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76" [[deps.Tar]] deps = ["ArgTools", "SHA"] uuid = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e" [[deps.Test]] deps = ["InteractiveUtils", "Logging", "Random", "Serialization"] uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [[deps.UUIDs]] deps = ["Random", "SHA"] uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" [[deps.Unicode]] uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" [[deps.WackyOptions]] path = ".." uuid = "c51a4d33-e9a4-4efb-a257-e0de888ecc28" version = "1.0.0" [[deps.Zlib_jll]] deps = ["Libdl"] uuid = "83775a58-1f1d-513f-b197-d71354ab007a" [[deps.nghttp2_jll]] deps = ["Artifacts", "Libdl"] uuid = "8e850ede-7688-5339-a07c-302acd2aaf8d" [[deps.p7zip_jll]] deps = ["Artifacts", "Libdl"] uuid = "3f19e933-33d8-53b3-aaab-bd5110c3b7a0" ================================================ FILE: test/fixtures/WackyOptions/docs/Project.toml ================================================ [deps] Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" ================================================ FILE: test/fixtures/WackyOptions/docs/make.jl ================================================ using WackyOptions using Documenter DocMeta.setdocmeta!(WackyOptions, :DocTestSetup, :(using WackyOptions); recursive=true) makedocs(; modules=[WackyOptions], authors="tester", sitename="WackyOptions.jl", format=Documenter.HTML(; canonical="http://example.com", edit_link=:commit, assets=[ "assets/static.txt", ], ), pages=[ "Home" => "index.md", ], bar="baz", foo="bar", ) deploydocs(; repo="x.com/tester/WackyOptions.jl", devbranch="foobar", ) ================================================ FILE: test/fixtures/WackyOptions/docs/src/assets/static.txt ================================================ DO NOT CHANGE THE CONTENTS OF THIS FILE! ================================================ FILE: test/fixtures/WackyOptions/docs/src/index.md ================================================ ```@meta CurrentModule = WackyOptions ``` # WackyOptions Documentation for [WackyOptions](https://x.com/tester/WackyOptions.jl). ```@index ``` ```@autodocs Modules = [WackyOptions] ``` ================================================ FILE: test/fixtures/WackyOptions/src/WackyOptions.jl ================================================ module WackyOptions # Write your package code here. end ================================================ FILE: test/fixtures/WackyOptions/test/Project.toml ================================================ [deps] Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" ================================================ FILE: test/fixtures/WackyOptions/test/runtests.jl ================================================ using WackyOptions using Test using Aqua using JET @testset "WackyOptions.jl" begin @testset "Code quality (Aqua.jl)" begin Aqua.test_all(WackyOptions; ambiguities = false, unbound_args = true) end @testset "Code linting (JET.jl)" begin JET.test_package(WackyOptions; target_defined_modules = true) end # Write your tests here. end ================================================ FILE: test/fixtures/static.txt ================================================ DO NOT CHANGE THE CONTENTS OF THIS FILE! ================================================ FILE: test/git.jl ================================================ @info "Running Git tests" @testset "Git repositories" begin @testset "Does not create Git repo" begin t = tpl(; plugins=[!Git]) with_pkg(t) do pkg pkg_dir = joinpath(t.dir, pkg) @test !isdir(joinpath(pkg_dir, ".git")) end end @testset "Creates Git repo" begin t = tpl(; plugins=[Git()]) with_pkg(t) do pkg pkg_dir = joinpath(t.dir, pkg) @test isdir(joinpath(pkg_dir, ".git")) end end @testset "With HTTPS" begin t = tpl(; plugins=[Git(; ssh=false)]) with_pkg(t) do pkg LibGit2.with(GitRepo(joinpath(t.dir, pkg))) do repo remote = LibGit2.get(GitRemote, repo, "origin") @test startswith(LibGit2.url(remote), "https://") end end end @testset "With SSH" begin t = tpl(; plugins=[Git(; ssh=true)]) with_pkg(t) do pkg LibGit2.with(GitRepo(joinpath(t.dir, pkg))) do repo remote = LibGit2.get(GitRemote, repo, "origin") @test startswith(LibGit2.url(remote), "git@") end end end @testset "Without .jl suffix" begin t = tpl(; plugins=[Git(; jl=false)]) with_pkg(t) do pkg LibGit2.with(GitRepo(joinpath(t.dir, pkg))) do repo remote = LibGit2.get(GitRemote, repo, "origin") @test !occursin(".jl", LibGit2.url(remote)) end end end @testset "With custom name/email" begin t = tpl(; plugins=[Git(; name="me", email="a@b.c")]) with_pkg(t) do pkg LibGit2.with(GitRepo(joinpath(t.dir, pkg))) do repo @test LibGit2.getconfig(repo, "user.name", "") == "me" @test LibGit2.getconfig(repo, "user.email", "") == "a@b.c" end end end @testset "Default branches" begin with_clean_gitconfig() do @test Git().branch == PT.DEFAULT_DEFAULT_BRANCH run(`git config init.defaultBranch foo`) @test Git().branch == "foo" end t = tpl(; plugins=[Git(; branch="main")]) with_pkg(t) do pkg LibGit2.with(GitRepo(joinpath(t.dir, pkg))) do repo @test LibGit2.branch(repo) == "main" end end end @testset "Adds version to commit message" begin # We're careful to avoid a Pkg.update as it triggers Cassette#130. t = tpl(; plugins=[Git(), !Tests]) patch = @patch PkgTemplates.version_of(t) = v"1.2.3" apply(patch) do with_pkg(t) do pkg pkg_dir = joinpath(t.dir, pkg) LibGit2.with(GitRepo(pkg_dir)) do repo commit = GitCommit(repo, "HEAD") @test occursin("PkgTemplates version: 1.2.3", LibGit2.message(commit)) end end end end end ================================================ FILE: test/interactive.jl ================================================ @info "Running interactive tests" using PkgTemplates: @with_kw_noshow const CR = "\r" const LF = "\n" const UP = "\eOA" const DOWN = "\eOB" const ALL = "a" const NONE = "n" const DONE = "d" const SIGINT = "\x03" # Because the plugin selection dialog prints directly to stdin in the same way # as we do here, and our input prints happen first, we're going to need to insert # the plugin selection prints ourselves, and then "undo" the extra ones at the end # by consuming whatever is left in stdin. const NDEFAULTS = length(PT.default_plugins()) const SELECT_DEFAULTS = (CR * DOWN)^NDEFAULTS struct FromString s::String end @testset "Interactive mode" begin @testset "Input conversion" begin generic(T, x) = PT.convert_input(PT.Plugin, T, x) @test generic(String, "foo") == "foo" @test generic(Float64, "1.23") == 1.23 @test generic(Int, "01") == 1 @test generic(Bool, "yes") === true @test generic(Bool, "True") === true @test generic(Bool, "No") === false @test generic(Bool, "false") === false @test generic(Vector{Int}, "1, 2, 3") == [1, 2, 3] @test generic(Vector{String}, "a, b,c") == ["a", "b", "c"] @test generic(FromString, "hello") == FromString("hello") if VERSION < v"1.1" @test_broken generic(Union{String, Nothing}, "nothing") === nothing else @test generic(Union{String, Nothing}, "nothing") === nothing end @test_throws ArgumentError generic(Int, "hello") @test_throws ArgumentError generic(Float64, "hello") @test_throws ArgumentError generic(Bool, "hello") end @testset "input_tips" begin @test isempty(PT.input_tips(String)) @test PT.input_tips(Int) == ["Int"] @test PT.input_tips(Bool) == ["Bool"] @test PT.input_tips(Symbol) == ["Symbol"] @test PT.input_tips(Vector{String}) == ["comma-delimited"] @test PT.input_tips(Union{Vector{String}, Nothing}) == ["comma-delimited", "'nothing' for nothing"] @test PT.input_tips(Union{String, Nothing}) == ["'nothing' for nothing"] @test PT.input_tips(Union{Vector{Secret}, Nothing}) == ["name only", "comma-delimited", "'nothing' for nothing"] end @testset "Interactive name/type pair collection" begin name = gensym() @eval begin PT.@plugin struct $name <: PT.Plugin x::Int = 0 y::String = "" end @test PT.interactive_pairs($name) == [:x => Int, :y => String] PT.customizable(::Type{$name}) = (:x => PT.NotCustomizable, :y => Float64, :z => Int) @test PT.interactive_pairs($name) == [:y => Float64, :z => Int] end end @testset "Simulated inputs" begin @testset "Default template" begin print( stdin.buffer, CR, # Select user DONE, # Finish menu USER, LF, # Enter user ) @test Template(; interactive=true) == Template(; user=USER) end @testset "Custom options, accept defaults" begin print( stdin.buffer, ALL, DONE, # Customize all fields "user", LF, # Enter user (don't assume we have default for this one). LF, # Enter authors LF, # Enter dir CR, # Enter host CR, # Enter julia SELECT_DEFAULTS, # Pre-select default plugins DONE, # Select no additional plugins DONE^NDEFAULTS, # Don't customize plugins ) @test Template(; interactive=true) == Template(; user="user", julia=v"1.0.0") readavailable(stdin.buffer) end @testset "Custom options, custom values" begin nversions = VERSION.minor + 1 print( stdin.buffer, ALL, DONE, # Customize all fields "user", LF, # Enter user "a, b", LF, # Enter authors "~", LF, # Enter dir DOWN^3, CR, # Choose "Other" for host "x.com", LF, # Enter host DOWN^nversions, CR, # Choose "Other" for julia "0.7", LF, # Enter Julia version SELECT_DEFAULTS, # Pre-select default plugins DONE, # Select no additional plugins DONE^NDEFAULTS, # Don't customize plugins ) @test Template(; interactive=true) == Template(; user="user", authors=["a", "b"], dir="~", host="x.com", julia=v"0.7", ) readavailable(stdin.buffer) end @testset "Disabling default plugins" begin print( stdin.buffer, CR, DOWN^5, CR, DONE, # Customize user and plugins USER, LF, # Enter user SELECT_DEFAULTS, # Pre-select default plugins UP^3, CR, UP^2, CR, DONE,# Disable TagBot and Readme DONE^(NDEFAULTS - 2), # Don't customize plugins ) @test Template(; interactive=true) == Template(; user=USER, plugins=[!Readme, !TagBot], ) readavailable(stdin.buffer) end @testset "Plugins" begin print( stdin.buffer, ALL, DONE, # Customize all fields "true", LF, # Enable ARM64 "no", LF, # Disable coverage "1.1,v1.2", LF, # Enter extra versions "x.txt", LF, # Enter file "Yes", LF, # Enable Linux "false", LF, # Disable OSX "TRUE", LF, # Enable Windows "YES", LF, # Enable x64 "NO", LF, # Disable x86 ) @test PT.interactive(TravisCI) == TravisCI(; arm64=true, coverage=false, extra_versions=["1.1", "v1.2"], file="x.txt", linux=true, osx=false, windows=true, x64=true, x86=false, ) print( stdin.buffer, DOWN^2, CR, # Select GitLabCI DOWN^2, CR, # Customize edit_link DOWN, CR, DONE, # Customize index_md ":commit", LF, # Enter edit_link "x.txt", LF, # Enter index file ) @test PT.interactive(Documenter) == Documenter{GitLabCI}(; edit_link=:commit, index_md="x.txt") print( stdin.buffer, CR, DOWN, CR, DONE, # Customize name and destination "COPYING", LF, # Enter destination CR, # Choose MIT for name (it's at the top) ) @test PT.interactive(License) == License(; destination="COPYING", name="MIT") end @testset "Quotes" begin print( stdin.buffer, CR, DOWN^2, CR, DONE, # Customize user and dir "\"me\"", LF, # Enter user with quotes "\"~\"", LF, # Enter home dir with quotes ) result = Template(; interactive=true) == Template(; user="me", dir="~") if get(ENV, "CI", "false") == "true" @test_broken result else @test_broken result # see https://github.com/JuliaCI/PkgTemplates.jl/issues/434 end print( stdin.buffer, DOWN^2, CR, DONE, # Customize extra_versions "\"1.1.1\", \"^1.5\", \"nightly\"", LF, # Enter versions with quotes ) @test PT.interactive(TravisCI) == TravisCI(; extra_versions=["1.1.1", "^1.5", "nightly"], ) end @testset "Union{T, Nothing} weirdness" begin print( stdin.buffer, DOWN, CR, DONE, # Customize changelog "hello", LF, # Enter changelog ) @test PT.interactive(TagBot) == TagBot(; changelog="hello") print( stdin.buffer, DOWN, CR, DONE, # Customize changelog "nothing", LF, # Set to null ) @test PT.interactive(TagBot) == TagBot(; changelog=nothing) end @testset "Only one field" begin print( stdin.buffer, DOWN, CR, DONE, # Select "None" option ) @test PT.interactive(Codecov) == Codecov() end @testset "Missing user" begin print( stdin.buffer, DONE, # Customize nothing "username", LF, # Enter user after it's prompted ) patch = @patch PkgTemplates.default_user() = "" apply(patch) do @test Template(; interactive=true) == Template(; user="username") end end @testset "Interrupts" begin print( stdin.buffer, SIGINT, # Send keyboard interrupt ) @test Template(; interactive=true) === nothing end println() end end ================================================ FILE: test/plugin.jl ================================================ # Don't move this line from the top, please. {{X}} {{Y}} {{Z}} @info "Running plugin tests" using Test: @test_deprecated struct FileTest <: PT.FilePlugin a::String b::Bool end PT.gitignore(::FileTest) = ["a", "aa", "aaa"] PT.source(::FileTest) = @__FILE__ PT.destination(::FileTest) = "foo.txt" PT.badges(::FileTest) = PT.Badge("{{X}}", "{{Y}}", "{{Z}}") PT.view(::FileTest, ::Template, ::AbstractString) = Dict("X" => 0, "Y" => 2) PT.user_view(::FileTest, ::Template, ::AbstractString) = Dict("X" => 1, "Z" => 3) @testset "Plugins" begin @testset "FilePlugin" begin p = FileTest("foo", true) t = tpl(; plugins=[p]) # The X from user_view should override the X from view. s = PT.render_plugin(p, t, "") @test occursin("1 2 3", first(split(s, "\n"))) with_pkg(t) do pkg pkg_dir = joinpath(t.dir, pkg) badge = string(PT.Badge("1", "2", "3")) @test occursin("a\naa\naaa", read(joinpath(pkg_dir, ".gitignore"), String)) @test occursin(badge, read(joinpath(pkg_dir, "README.md"), String)) @test read(joinpath(pkg_dir, "foo.txt"), String) == s end end @testset "Tests Project.toml warning on Julia < 1.2" begin p = Tests(; project=true) @test_logs (:warn, r"The project option is set") tpl(; julia=v"1", plugins=[p]) @test_logs (:warn, r"The project option is set") tpl(; julia=v"1.1", plugins=[p]) @test_logs tpl(; julia=v"1.2", plugins=[p]) @test_logs tpl(; julia=v"1.3", plugins=[p]) end @testset "CI versions" begin t = tpl(; julia=v"1") @test PT.collect_versions(t, ["1.0", "1.5", "nightly"]) == ["1.0", "1.5", "nightly"] t = tpl(; julia=v"2") @test PT.collect_versions(t, ["1.0", "1.5", "nightly"]) == ["2.0", "nightly"] end @testset "Equality" begin a = FileTest("foo", true) b = FileTest("foo", true) @test a == b c = FileTest("foo", false) @test a != c end @testset "Validations" begin t = tpl() p = TravisCI(; file="/does/not/exist") @test_throws ArgumentError PT.validate(p, t) p = Documenter(; assets=["/does/not/exist"]) @test_throws ArgumentError PT.validate(p, t) p = Documenter(; logo=Logo(; light="/does/not/exist")) @test_throws ArgumentError PT.validate(p, t) p = Documenter{TravisCI}() @test_throws ArgumentError PT.validate(p, t) end @testset "Custom badge plugins" begin t = tpl(; plugins=[!Readme, BlueStyleBadge()]) with_pkg(t) do pkg pkg_dir = joinpath(t.dir, pkg) @test !isfile(joinpath(pkg_dir, "README.md")) end @testset "$BadgeType" for (BadgeType, text) in ( BlueStyleBadge => "BlueStyle", ColPracBadge => "ColPrac", PkgEvalBadge => "PkgEval", ) @test BadgeType <: PT.BadgePlugin t = tpl(; plugins=[BadgeType()]) @test PT.hasplugin(t, BadgeType) with_pkg(t) do pkg pkg_dir = joinpath(t.dir, pkg) @test occursin(text, read(joinpath(pkg_dir, "README.md"), String)) end end end # https://github.com/JuliaCI/PkgTemplates.jl/issues/275 @testset "makedocs_kwargs sort bug" begin p = Documenter(; makedocs_kwargs=Dict(:strict => true, :checkdocs => :exports)) t = tpl(; plugins=[p]) # A failure looks like: `MethodError: no method matching isless(::Symbol, ::Bool)` with_pkg(t) do pkg pkg_dir = joinpath(t.dir, pkg) @test isdir(joinpath(pkg_dir, "docs")) end end @testset "`pkg_name`" begin using PkgTemplates: pkg_name @test pkg_name("foo/bar/Whee.jl") == "Whee" @test pkg_name("foo/bar/Whee") == "Whee" @test pkg_name("Whee") == "Whee" # Only the final suffix is removed---we don't correct for user error @test pkg_name("Whee.jl.jl") == "Whee.jl" end @testset "License aliases" begin # Backward-compatibility: legacy license names should still work, but emit a depwarn. apache = PT.default_file("licenses", "Apache-2.0") @assert isfile(apache) p = @test_deprecated License(; name="ASL") @test PT.source(p) == apache # SPDX identifiers should work without warnings. @test_logs License(; name="Apache-2.0") end end ================================================ FILE: test/reference.jl ================================================ @info "Running reference tests" const PROMPT = get(ENV, "PT_INTERACTIVE", "false") == "true" || !haskey(ENV, "CI") const STATIC_TXT = joinpath(@__DIR__, "fixtures", "static.txt") const STATIC_PNG = joinpath(@__DIR__, "fixtures", "static.png") const STATIC_DOCUMENTER = [ PackageSpec(; name="DocStringExtensions", version=v"0.8.1"), PackageSpec(; name="Documenter", version=v"0.24.2"), PackageSpec(; name="JSON", version=v"0.21.0"), PackageSpec(; name="Parsers", version=v"0.3.10"), ] function test_reference(reference, comparison) if !isfile(reference) # If the reference file doesn't yet exist, create it but fail the test. @info "Creating new reference file $reference" copy_file(comparison, reference) @test false return end a = read(reference, String) b = read(comparison, String) if a == b # If the files are equal, pass the test. @test true return end print_diff(a, b) println("Reference and comparison files do not match (see above)") println("Reference: $reference") println("Comparison: $comparison") update = false if haskey(ENV, "JULIA_REFERENCETESTS_UPDATE") copy_file(comparison, reference) elseif PROMPT while true println("Update reference file? [y/n]") answer = lowercase(strip(readline())) if startswith(answer, "y") || startswith(answer, "n") # If the user chooses to update the reference file, # replace its contents with the comparison file. startswith(answer, "y") && copy_file(comparison, reference) break end end end # Fail the test, but keep the output short # because we've already showed the diff. @test :reference == :comparison end function copy_file(src::AbstractString, dest::AbstractString) mkpath(dirname(dest)) cp(src, dest; force=true) end PT.user_view(::Citation, ::Template, ::AbstractString) = Dict("MONTH" => 8, "YEAR" => 2019) PT.user_view(::License, ::Template, ::AbstractString) = Dict("YEAR" => 2019) function pin_documenter(project_dir::AbstractString) @suppress PT.with_project(project_dir) do foreach(Pkg.add, STATIC_DOCUMENTER) end toml = joinpath(project_dir, "Project.toml") project = TOML.parsefile(toml) filter!(p -> p.first == "Documenter", project["deps"]) PT.write_project(toml, project) end function test_all(pkg::AbstractString; kwargs...) t = tpl(; kwargs...) # Ensure that the same output is generated (with the exception of the generated directory) # regardless of whether the user passes in Foo.jl or Foo for pkg_name in [pkg, pkg * ".jl"] with_pkg(t, pkg_name) do pkg_name pkg_dir = joinpath(t.dir, pkg_name) PT.hasplugin(t, Documenter) && pin_documenter(joinpath(pkg_dir, "docs")) foreach(readlines(`git -C $pkg_dir ls-files`)) do f # Don't check test Manifest: versions of dependencies may vary if !contains(f, joinpath("test", "Manifest.toml")) reference = joinpath(@__DIR__, "fixtures", pkg, f) comparison = joinpath(pkg_dir, f) test_reference(reference, comparison) end end end end end @testset "Reference tests" begin @testset "Default package" begin test_all("Basic"; authors=USER) end @testset "All plugins" begin test_all("AllPlugins"; authors=USER, plugins=[ AppVeyor(), CirrusCI(), Citation(), CodeOwners(), Codecov(), CompatHelper(), Coveralls(), Dependabot(), Develop(), Documenter(), DroneCI(), Formatter(), GitHubActions(), GitLabCI(), PkgBenchmark(), PkgEvalBadge(), RegisterAction(), TravisCI(), Runic{GitHubActions}(), ]) end @testset "Documenter (TravisCI)" begin test_all("DocumenterTravis"; authors=USER, plugins=[ Documenter{TravisCI}(), TravisCI(), ]) end @testset "Documenter (GitHubActions)" begin test_all("DocumenterGitHubActions"; authors=USER, plugins=[ Documenter{GitHubActions}(), GitHubActions(), ]) end @testset "Documenter (GitLabCI)" begin test_all("DocumenterGitLabCI"; authors=USER, plugins=[ Documenter{GitLabCI}(), GitLabCI(), ]) end @testset "Wacky options" begin test_all("WackyOptions"; authors=USER, julia=v"1.2", host="x.com", plugins=[ AppVeyor(; x86=true, coverage=true, extra_versions=[v"1.1"]), CirrusCI(; image="freebsd-123", coverage=false, extra_versions=["1.3"]), Citation(; readme=true), Codecov(; file=STATIC_TXT), CodeOwners(; owners=["*"=>["@user"], "README.md"=>["@group","user@example.com"]]), CompatHelper(; cron="0 0 */3 * *"), Coveralls(; file=STATIC_TXT), Dependabot(), Documenter{GitHubActions}(; assets=[STATIC_TXT], logo=Logo(; light=STATIC_PNG), makedocs_kwargs=Dict(:foo => "bar", :bar => "baz"), canonical_url=(_t, _pkg) -> "http://example.com", devbranch="foobar", edit_link=:commit, ), DroneCI(; amd64=false, arm=true, arm64=true, extra_versions=["1.3"]), Formatter(; style="blue"), Git(; ignore=["a", "b", "c"], manifest=true, branch="whackybranch"), GitHubActions(; x86=true, linux=false, coverage=false), GitLabCI(; coverage=false, extra_versions=[v"0.6"]), License(; name="ISC"), ProjectFile(; version=v"1"), Readme(; inline_badges=true, badge_off=[Codecov]), RegisterAction(; prompt="gimme version"), TagBot(; trigger="OtherUser", token=Secret("MYTOKEN"), ssh=Secret("SSHKEY"), ssh_password=Secret("SSHPASS"), changelog="Line 1\nLine 2\n\nLine 4", changelog_ignore=["foo", "bar"], gpg=Secret("GPGKEY"), gpg_password=Secret("GPGPASS"), registry="Foo/Bar", branches=false, dispatch=true, dispatch_delay=20, ), Tests(; project=true, aqua=true, aqua_kwargs=(; ambiguities=false, unbound_args=true), jet=true, ), TravisCI(; coverage=false, windows=false, x86=true, arm64=true, extra_versions=["1.1"], ), ]) end end ================================================ FILE: test/runtests.jl ================================================ using Base: UUID, contractuser using Base.Filesystem: path_separator using LibGit2: LibGit2, GitCommit, GitRemote, GitRepo using Pkg: Pkg, PackageSpec, TOML using Random: Random, randstring using Test: @test, @testset, @test_broken, @test_logs, @test_throws using UUIDs: uuid4 using DeepDiffs: deepdiff using Mocking using Suppressor: @suppress using PkgTemplates Mocking.activate() const PT = PkgTemplates const USER = "tester" Random.seed!(1) # Creata a template that won't error because of a missing username. tpl(; kwargs...) = Template(; user=USER, kwargs...) # Generate a random package name. pkgname() = titlecase(randstring('A':'Z', 16)) # Create a randomly named package with a template, and delete it afterwards. function with_pkg(f::Function, t::Template, pkg::AbstractString=pkgname()) patch = @patch uuid4() = UUID("c51a4d33-e9a4-4efb-a257-e0de888ecc28") @suppress apply(patch) do t(pkg) end try f(pkg) finally # On 1.4, this sometimes won't work, but the error is that the package isn't installed. # We're going to delete the package directory anyways, so just ignore any errors. PT.version_of(pkg) === nothing || try @suppress Pkg.rm(pkg) catch; end rm(joinpath(t.dir, pkg); recursive=true, force=true) end end function print_diff(a, b) old = Base.have_color @eval Base have_color = true try println(deepdiff(a, b)) finally @eval Base have_color = $old end end # LibGit2 doesn't respect the $GIT_CONFIG environment variable, # but we need to use it to avoid modifying the user's environment. function with_clean_gitconfig(f) function getconfig(key, default) try readchomp(`git config --get $key`) catch default end end patch = @patch LibGit2.getconfig(key, default) = getconfig(key, default) if !Sys.iswindows() mktemp() do file, _io withenv("GIT_CONFIG" => file) do apply(patch) do f() end end end else # Windows gives a permission error if an external command like `git` tries # to write to the file while Julia holds the `_io` handle. # So we use the less-safe tempname approach. file = touch(tempname()) withenv("GIT_CONFIG" => file) do apply(patch) do f() end end rm(file) end end mktempdir() do dir Pkg.activate(dir) pushfirst!(DEPOT_PATH, dir) try @testset "PkgTemplates.jl" begin include("template.jl") include("plugin.jl") include("show.jl") if VERSION < v"1.8" # Interactive tests disabled on Julia Version >= 1.8 due to: # https://github.com/JuliaCI/PkgTemplates.jl/issues/370 include("interactive.jl") else @info "Skipping interactive tests (requiring test_show( rstrip(expected), sprint(show, MIME("text/plain"), tpl(; authors=USER)), ) if PT.git_is_installed() with_clean_gitconfig() do run(`git config user.name Tester`) run(`git config user.email te@st.er`) f() end else f() end end @testset "show as serialization" begin t1 = tpl() t2 = eval(Meta.parse(sprint(show, t1))) @test t1 == t2 foreach((NoDeploy, GitHubActions)) do T p1 = Documenter{T}() p2 = eval(Meta.parse(sprint(show, p1))) @test p1 == p2 end end end ================================================ FILE: test/template.jl ================================================ @info "Running template tests" @testset "Template" begin @testset "Template constructor" begin @testset "user" begin msg = sprint(showerror, PT.MissingUserException{TravisCI}()) @test startswith(msg, "TravisCI: ") patch = @patch PkgTemplates.getkw!(kwargs, k) = "" apply(patch) do @test_throws PT.MissingUserException Template() @test isempty(Template(; plugins=[!Git, !GitHubActions]).user) end patch = @patch PkgTemplates.getkw!(kwargs, k) = "username" apply(patch) do @test Template().user == "username" end end @testset "authors" begin @test tpl(; authors=["a"]).authors == ["a"] @test tpl(; authors="a").authors == ["a"] @test tpl(; authors="a,b").authors == ["a", "b"] @test tpl(; authors="a, b").authors == ["a", "b"] end @testset "host" begin @test tpl(; host="https://foo.com").host == "foo.com" end @testset "dir" begin @test tpl(; dir="/foo/bar").dir == joinpath(path_separator, "foo", "bar") @test tpl(; dir="foo").dir == abspath("foo") @test tpl(; dir="~/foo").dir == abspath(expanduser("~/foo")) end @testset "plugins" begin function test_plugins(plugins, expected) t = tpl(; plugins=plugins) @test all(map(==, sort(t.plugins; by=string), sort(expected; by=string))) end defaults = PT.default_plugins() test_plugins([], defaults) test_plugins([Citation()], union(defaults, [Citation()])) # Overriding a default plugin. default_g = defaults[findfirst(p -> p isa Git, defaults)] g = Git(; ssh=true) test_plugins([g], union(setdiff(defaults, [default_g]), [g])) # Disabling a default plugin. test_plugins([!Git], setdiff(defaults, [default_g])) # Duplicated default plugins are supported g2 = Git(; branch="foo") test_plugins([g, g2], union(setdiff(defaults, [default_g]), [g, g2])) # Duplicated non-default plugins are supported c1 = Citation() c2 = Citation() test_plugins([c1, c2], vcat(defaults, [c1, c2])) end @testset "Unsupported keywords warning" begin @test_logs tpl() @test_logs (:warn, r"Unrecognized keywords were supplied") tpl(; x=1, y=2) end end @testset "Equality" begin a = tpl() b = tpl() @test a == b c = tpl(julia=v"0.3") @test a != c end @testset "hasplugin" begin t = tpl(; plugins=[TravisCI(), Documenter{TravisCI}()]) @test PT.hasplugin(t, typeof(first(PT.default_plugins()))) @test PT.hasplugin(t, Documenter) @test PT.hasplugin(t, PT.is_ci) @test PT.hasplugin(t, _ -> true) @test !PT.hasplugin(t, _ -> false) @test !PT.hasplugin(t, Citation) end @testset "validate" begin foreach((GitHubActions, TravisCI, GitLabCI)) do T @test_throws ArgumentError tpl(; plugins=[!GitHubActions, Documenter{T}()]) end patch = @patch LibGit2.getconfig(r, n) = "" apply(patch) do @test_throws ArgumentError tpl(; plugins=[Git()]) end end end @testset "Package generation errors" begin mktempdir() do dir t = tpl(; dir=dirname(dir)) @test_throws ArgumentError t(basename(dir)) end mktemp() do f, _io t = tpl(; dir=dirname(f)) @test_throws ArgumentError t(basename(f)) end t = tpl() pkg = pkgname() patch = @patch LibGit2.init(pkg_dir) = error() apply(patch) do @test_throws ErrorException @suppress t(pkg) end @test !isdir(joinpath(t.dir, pkg)) mktempdir() do dir t = tpl(; dir=dir) @test_throws ArgumentError t("42Foo.jl") @test_throws ArgumentError t("42Foo") @test_throws ArgumentError t("Foo Bar.jl") @test_throws ArgumentError t("Foo Bar") end end