diff --git a/CHANGELOG.md b/CHANGELOG.md index f025a6b5..8d427c63 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,10 +9,15 @@ and this project adheres to [Semantic Versioning]. ## [Unreleased] +### Added + +- New question: AddContributionDocs to decide whether to add 90-contributing.md and 91-developer.md (#313) + ### Changed - (breaking change) GitHub PR template is now part of the minimal options (#308) - (breaking change) TestOnPRs.yml is now part of the minimal options (#312) +- (breaking change) 90-contributing.md and 91-developer.md have moved from minimal to recommended. If you use the minimal option, then these files will be removed (#313) ### Removed diff --git a/copier.yml b/copier.yml index 7d3fc489..67717a4a 100644 --- a/copier.yml +++ b/copier.yml @@ -95,6 +95,12 @@ AddCopierCI: default: false # General +AddContributionDocs: + when: "{{ AnswerStrategy == 'ask' }}" + type: bool + default: "{{ AnswerStrategy != 'minimum' }}" + help: Add documentation files on how to contribute to the project (90-contributing.md will give general guidelines, and 91-developer.md will give practical information) + AddAllcontributors: when: "{{ AnswerStrategy == 'ask' }}" type: bool diff --git a/template/.github/PULL_REQUEST_TEMPLATE.md.jinja b/template/.github/PULL_REQUEST_TEMPLATE.md.jinja index 3564ca26..88e518a8 100644 --- a/template/.github/PULL_REQUEST_TEMPLATE.md.jinja +++ b/template/.github/PULL_REQUEST_TEMPLATE.md.jinja @@ -1,7 +1,13 @@ @@ -21,7 +27,9 @@ There is no related issue. +{% if AddContributionDocs %} - [ ] I am following the [contributing guidelines](https://github.com/{{ PackageOwner }}/{{ PackageName }}.jl/blob/main/docs/src/90-contributing.md) +{% endif %} - [ ] Tests are passing - [ ] Lint workflow is passing - [ ] Docs were updated and workflow is passing diff --git a/template/.github/{% if AddGitHubTemplates %}ISSUE_TEMPLATE{% endif %}/10-bug-report.yml.jinja b/template/.github/{% if AddGitHubTemplates %}ISSUE_TEMPLATE{% endif %}/10-bug-report.yml.jinja index 67f693e3..304bd19c 100644 --- a/template/.github/{% if AddGitHubTemplates %}ISSUE_TEMPLATE{% endif %}/10-bug-report.yml.jinja +++ b/template/.github/{% if AddGitHubTemplates %}ISSUE_TEMPLATE{% endif %}/10-bug-report.yml.jinja @@ -11,8 +11,12 @@ body: Please, before submitting, make sure that: - There is not an [existing issue](https://github.com/{{ PackageOwner }}/{{ PackageName }}.jl/issues) with the same question + {% if AddContributionDocs %} - You have read the [contributing guide](https://{{ PackageOwner }}.github.io/{{ PackageName }}.jl/dev/90-contributing/) + {% endif %} + {% if AddCodeOfConduct %} - You are following the [code of conduct](https://github.com/{{ PackageOwner }}/{{ PackageName }}.jl/blob/main/CODE_OF_CONDUCT.md) + {% endif %} The form below should help you in filling out this issue. - type: textarea diff --git a/template/.github/{% if AddGitHubTemplates %}ISSUE_TEMPLATE{% endif %}/20-feature-request.yml.jinja b/template/.github/{% if AddGitHubTemplates %}ISSUE_TEMPLATE{% endif %}/20-feature-request.yml.jinja index 4efa0822..396e6774 100644 --- a/template/.github/{% if AddGitHubTemplates %}ISSUE_TEMPLATE{% endif %}/20-feature-request.yml.jinja +++ b/template/.github/{% if AddGitHubTemplates %}ISSUE_TEMPLATE{% endif %}/20-feature-request.yml.jinja @@ -9,8 +9,12 @@ body: Please, before submitting, make sure that: - There is not an [existing issue](https://github.com/{{ PackageOwner }}/{{ PackageName }}.jl/issues) with the same question + {% if AddContributionDocs %} - You have read the [contributing guide](https://{{ PackageOwner }}.github.io/{{ PackageName }}.jl/dev/90-contributing/) + {% endif %} + {% if AddCodeOfConduct %} - You are following the [code of conduct](https://github.com/{{ PackageOwner }}/{{ PackageName }}.jl/blob/main/CODE_OF_CONDUCT.md) + {% endif %} The form below should help you in filling out this issue. - type: textarea diff --git a/template/.github/{% if AddGitHubTemplates %}ISSUE_TEMPLATE{% endif %}/30-usage.yml.jinja b/template/.github/{% if AddGitHubTemplates %}ISSUE_TEMPLATE{% endif %}/30-usage.yml.jinja index d5189821..c4e0052a 100644 --- a/template/.github/{% if AddGitHubTemplates %}ISSUE_TEMPLATE{% endif %}/30-usage.yml.jinja +++ b/template/.github/{% if AddGitHubTemplates %}ISSUE_TEMPLATE{% endif %}/30-usage.yml.jinja @@ -11,8 +11,12 @@ body: - You have checked the [documentation](https://{{ PackageOwner }}.github.io/{{ PackageName }}.jl) and haven't found enough information - There is not an [existing issue](https://github.com/{{ PackageOwner }}/{{ PackageName }}.jl/issues) with the same question + {% if AddContributionDocs %} - You have read the [contributing guide](https://{{ PackageOwner }}.github.io/{{ PackageName }}.jl/dev/90-contributing/) + {% endif %} + {% if AddCodeOfConduct %} - You are following the [code of conduct](https://github.com/{{ PackageOwner }}/{{ PackageName }}.jl/blob/main/CODE_OF_CONDUCT.md) + {% endif %} The form below should help you in filling out this issue. - type: textarea diff --git a/template/.github/{% if AddGitHubTemplates %}ISSUE_TEMPLATE{% endif %}/99-general.yml.jinja b/template/.github/{% if AddGitHubTemplates %}ISSUE_TEMPLATE{% endif %}/99-general.yml.jinja index 544d6fa0..7190c9df 100644 --- a/template/.github/{% if AddGitHubTemplates %}ISSUE_TEMPLATE{% endif %}/99-general.yml.jinja +++ b/template/.github/{% if AddGitHubTemplates %}ISSUE_TEMPLATE{% endif %}/99-general.yml.jinja @@ -9,8 +9,12 @@ body: Please, before submitting, make sure that: - There is not an [existing issue](https://github.com/{{ PackageOwner }}/{{ PackageName }}.jl/issues) with the same question + {% if AddContributionDocs %} - You have read the [contributing guide](https://{{ PackageOwner }}.github.io/{{ PackageName }}.jl/dev/90-contributing/) + {% endif %} + {% if AddCodeOfConduct %} - You are following the [code of conduct](https://github.com/{{ PackageOwner }}/{{ PackageName }}.jl/blob/main/CODE_OF_CONDUCT.md) + {% endif %} The form below should help you in filling out this issue. - type: textarea diff --git a/template/README.md.jinja b/template/README.md.jinja index c341361a..0e40c77d 100644 --- a/template/README.md.jinja +++ b/template/README.md.jinja @@ -16,9 +16,11 @@ If you use {{ PackageName }}.jl in your work, please cite using the reference given in [CITATION.cff](https://github.com/{{ PackageOwner }}/{{ PackageName }}.jl/blob/main/CITATION.cff). +{% if AddContributionDocs %} ## Contributing If you want to make contributions of any kind, please first that a look into our [contributing guide directly on GitHub](docs/src/90-contributing.md) or the [contributing page on the website](https://{{ PackageOwner }}.github.io/{{ PackageName }}.jl/dev/90-contributing/). +{% endif %} {% if AddAllcontributors %} --- diff --git a/template/docs/src/90-contributing.md.jinja b/template/docs/src/{% if AddContributionDocs %}90-contributing.md{% endif %}.jinja similarity index 94% rename from template/docs/src/90-contributing.md.jinja rename to template/docs/src/{% if AddContributionDocs %}90-contributing.md{% endif %}.jinja index a3ad35a9..8e886c24 100644 --- a/template/docs/src/90-contributing.md.jinja +++ b/template/docs/src/{% if AddContributionDocs %}90-contributing.md{% endif %}.jinja @@ -4,7 +4,11 @@ First of all, thanks for the interest! We welcome all kinds of contribution, including, but not limited to code, documentation, examples, configuration, issue creating, etc. +{% if AddCodeOfConduct %} Be polite and respectful, and follow the code of conduct. +{% else %} +Be polite and respectful. +{% endif %} ## Bug reports and discussions diff --git a/template/docs/src/91-developer.md.jinja b/template/docs/src/{% if AddContributionDocs %}91-developer.md{% endif %}.jinja similarity index 100% rename from template/docs/src/91-developer.md.jinja rename to template/docs/src/{% if AddContributionDocs %}91-developer.md{% endif %}.jinja diff --git a/test/runtests.jl b/test/runtests.jl index 7f48ef2d..639237a2 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -42,7 +42,7 @@ template_options = Dict( "AddMacToCI" => true, "AddWinToCI" => true, "RunJuliaNightlyOnCI" => true, - "SimplifiedPRTest" => true, + "AddContributionDocs" => true, "UseCirrusCI" => false, "AddPrecommit" => true, "AddGitHubTemplates" => true, @@ -141,7 +141,7 @@ end @testset "Test that BestieTemplate.generate warns and exits for existing copy" begin mktempdir(TMPDIR; prefix = "cli_") do dir_copier_cli - run(`copier copy --quiet $bash_args $template_url $dir_copier_cli`) + run(`copier copy --vcs-ref HEAD --quiet $bash_args $template_url $dir_copier_cli`) @test_logs (:warn,) BestieTemplate.generate(dir_copier_cli; quiet = true) end @@ -149,19 +149,25 @@ end @testset "Testing copy, recopy and rebase" begin mktempdir(TMPDIR; prefix = "cli_") do dir_copier_cli - run(`copier copy --quiet $bash_args $template_path $dir_copier_cli`) + run(`copier copy --vcs-ref HEAD --quiet $bash_args $template_path $dir_copier_cli`) @testset "Compare copied project vs copier CLI baseline" begin mktempdir(TMPDIR; prefix = "copy_") do tmpdir - BestieTemplate.Copier.copy(tmpdir, template_options; quiet = true) + BestieTemplate.Copier.copy(tmpdir, template_options; quiet = true, vcs_ref = "HEAD") test_diff_dir(tmpdir, dir_copier_cli) end end @testset "Compare recopied project vs copier CLI baseline" begin mktempdir(TMPDIR; prefix = "recopy_") do tmpdir - run(`copier copy --defaults --quiet $min_bash_args $template_path $tmpdir`) - BestieTemplate.Copier.recopy(tmpdir, template_options; quiet = true, overwrite = true) + run(`copier copy --vcs-ref HEAD --defaults --quiet $min_bash_args $template_path $tmpdir`) + BestieTemplate.Copier.recopy( + tmpdir, + template_options; + quiet = true, + overwrite = true, + vcs_ref = "HEAD", + ) test_diff_dir(tmpdir, dir_copier_cli) end end @@ -176,7 +182,13 @@ end run(`git config user.email "test@test.com"`) run(`git commit -q -m "First commit"`) end - BestieTemplate.Copier.update(tmpdir, template_options; overwrite = true, quiet = true) + BestieTemplate.Copier.update( + tmpdir, + template_options; + overwrite = true, + quiet = true, + vcs_ref = "HEAD", + ) test_diff_dir(tmpdir, dir_copier_cli) end end