From f7f8698bdc3a818dfce0e198f6d9bf93c2916a02 Mon Sep 17 00:00:00 2001 From: Olga Lyashevska Date: Thu, 22 Aug 2024 13:51:38 +0200 Subject: [PATCH 1/4] Optional code of conduct --- copier.yml | 7 +++++++ template/CONTRIBUTING.md.jinja | 2 +- template/project_setup.md.jinja | 2 ++ ...f AddCodeConduct %}CODE_OF_CONDUCT.md{% endif %}.jinja} | 0 4 files changed, 10 insertions(+), 1 deletion(-) rename template/{CODE_OF_CONDUCT.md.jinja => {% if AddCodeConduct %}CODE_OF_CONDUCT.md{% endif %}.jinja} (100%) diff --git a/copier.yml b/copier.yml index 04222e9b..b83ee4f5 100644 --- a/copier.yml +++ b/copier.yml @@ -107,6 +107,13 @@ AddPreCommit: default: "{{ template_profile != 'minimum' }}" help: Add pre-commit hook to check code style and format on every commit? +AddCodeConduct: + when: "{{ template_profile == 'ask' }}" + type: bool + default: "{{ template_profile != 'minimum' }}" + help: Add code of conduct? + + # internal fields _subdirectory: template diff --git a/template/CONTRIBUTING.md.jinja b/template/CONTRIBUTING.md.jinja index cc1a1787..4c3f90e0 100644 --- a/template/CONTRIBUTING.md.jinja +++ b/template/CONTRIBUTING.md.jinja @@ -1,6 +1,6 @@ # Contributing guidelines -We welcome any kind of contribution to our software, from simple comment or question to a full fledged [pull request](https://help.github.com/articles/about-pull-requests/). Please read and follow our [Code of Conduct](CODE_OF_CONDUCT.md). +We welcome any kind of contribution to our software, from simple comment or question to a full fledged [pull request](https://help.github.com/articles/about-pull-requests/). {% if AddCodeConduct -%}Please read and follow our [Code of Conduct](CODE_OF_CONDUCT.md).{%- endif %} A contribution can be one of the following cases: diff --git a/template/project_setup.md.jinja b/template/project_setup.md.jinja index ba015fc9..d0a5ad09 100644 --- a/template/project_setup.md.jinja +++ b/template/project_setup.md.jinja @@ -100,10 +100,12 @@ help you decide which tool to use for packaging. - Follow the [making software citable](https://guide.esciencecenter.nl/#/citable_software/making_software_citable) section in the guide. {%- endif -%} +{% if AddCodeConduct -%} ## CODE_OF_CONDUCT.md - Information about how to behave professionally - [Relevant section in the guide](https://guide.esciencecenter.nl/#/best_practices/documentation?id=code-of-conduct) +{%- endif -%} ## CONTRIBUTING.md diff --git a/template/CODE_OF_CONDUCT.md.jinja b/template/{% if AddCodeConduct %}CODE_OF_CONDUCT.md{% endif %}.jinja similarity index 100% rename from template/CODE_OF_CONDUCT.md.jinja rename to template/{% if AddCodeConduct %}CODE_OF_CONDUCT.md{% endif %}.jinja From b173def8f393dd62bdc88ef427f4231a35c5d4e2 Mon Sep 17 00:00:00 2001 From: Olga Lyashevska Date: Thu, 22 Aug 2024 13:59:14 +0200 Subject: [PATCH 2/4] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index da19350b..ebbc7a22 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ ### Added +* Make Code of Conduct optional [#464](https://github.com/NLeSC/python-template/pull/530) * Make citation optional [#471](https://github.com/NLeSC/python-template/pull/471) * Make online documentation optional [#476](https://github.com/NLeSC/python-template/pull/476) * Added Python 3.12 support [#356](https://github.com/NLeSC/python-template/issues/356) From 76bbfbc2d1dc0d169091f50756071029c1aa1944 Mon Sep 17 00:00:00 2001 From: Olga Lyashevska Date: Thu, 22 Aug 2024 17:21:28 +0200 Subject: [PATCH 3/4] Update copier.yml Co-authored-by: fdiblen <144492+fdiblen@users.noreply.github.com> --- copier.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/copier.yml b/copier.yml index 09249c6c..2a966d8a 100644 --- a/copier.yml +++ b/copier.yml @@ -114,7 +114,6 @@ AddCodeConduct: default: "{{ template_profile != 'minimum' }}" help: Add code of conduct? - AddSonarCloud: when: "{{ template_profile == 'ask' }}" type: bool From e852fa2850057de6d2133936c283ce3f57d6c6fb Mon Sep 17 00:00:00 2001 From: Olga Lyashevska Date: Fri, 23 Aug 2024 13:59:01 +0200 Subject: [PATCH 4/4] fix empty lines --- template/project_setup.md.jinja | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/template/project_setup.md.jinja b/template/project_setup.md.jinja index a5c31ec5..f3914fab 100644 --- a/template/project_setup.md.jinja +++ b/template/project_setup.md.jinja @@ -73,7 +73,7 @@ help you decide which tool to use for packaging. - `sonar-project.properties` is the SonarCloud [configuration](https://docs.sonarqube.org/latest/analysis/analysis-parameters/) file - `.github/workflows/sonarcloud.yml` is the GitHub action workflow which performs the SonarCloud analysis -{%- endif -%} +{%- endif %} ## Package version number @@ -100,14 +100,14 @@ help you decide which tool to use for packaging. - To allow others to cite your software, add a `CITATION.cff` file - It only makes sense to do this once there is something to cite (e.g., a software release with a DOI). - Follow the [making software citable](https://guide.esciencecenter.nl/#/citable_software/making_software_citable) section in the guide. -{%- endif -%} +{%- endif %} {% if AddCodeConduct -%} ## CODE_OF_CONDUCT.md - Information about how to behave professionally - [Relevant section in the guide](https://guide.esciencecenter.nl/#/best_practices/documentation?id=code-of-conduct) -{%- endif -%} +{%- endif %} ## CONTRIBUTING.md