Skip to content

Commit

Permalink
Move contributing and developer docs to recommended
Browse files Browse the repository at this point in the history
These files are overkill for a minimal case. They can, in the
future, come back as simpler versions on the minimal case. However,
thinking about, for instance, a solo dev kickstarting the package and
using the minimal (so no formatter, no issue templates, no linting), it
won't make sense to have all these guidelines in place.

Closes #313

Breaking change: If you have are using the minimal version, this will
remove the files docs/src/90-contributing.md and
docs/src/91-developer.md.
  • Loading branch information
abelsiqueira committed Jul 8, 2024
1 parent d05e649 commit 56ef2bb
Show file tree
Hide file tree
Showing 11 changed files with 61 additions and 8 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 6 additions & 0 deletions copier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 9 additions & 1 deletion template/.github/PULL_REQUEST_TEMPLATE.md.jinja
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
<!--
Thanks for making a pull request to {{ PackageName }}.jl.
We have added this PR template to help you help us.
Make sure to read the contributing guidelines and abide to the code of conduct.
{% if AddContributionDocs and AddCodeOfConduct %}
Make sure to read the contributing guidelines and abide by the code of conduct.
{% elif AddContributionDocs %}
Make sure to read the contributing guidelines.
{% elif AddCodeOfConduct %}
Make sure to abide by the code of conduct.
{% endif %}
See the comments below, fill the required fields, and check the items.
-->

Expand All @@ -21,7 +27,9 @@ There is no related issue.

<!-- mark true if NA -->
<!-- leave PR as draft until all is checked -->
{% 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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions template/README.md.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
File renamed without changes.
26 changes: 19 additions & 7 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ template_options = Dict(
"AddMacToCI" => true,
"AddWinToCI" => true,
"RunJuliaNightlyOnCI" => true,
"SimplifiedPRTest" => true,
"AddContributionDocs" => true,
"UseCirrusCI" => false,
"AddPrecommit" => true,
"AddGitHubTemplates" => true,
Expand Down Expand Up @@ -141,27 +141,33 @@ 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
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
Expand All @@ -176,7 +182,13 @@ end
run(`git config user.email "[email protected]"`)
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
Expand Down

0 comments on commit 56ef2bb

Please sign in to comment.