Skip to content

Commit fb5e212

Browse files
committed
add editorconfig to code quality features menu
2 parents 7cc247f + ec6a235 commit fb5e212

13 files changed

Lines changed: 286 additions & 88 deletions

copier.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,20 @@
1515
!include copier/questions/package_details.yml
1616

1717
---
18-
# Features
19-
!include copier/questions/features.yml
18+
# code quality
19+
!include copier/questions/features_code_quality.yml
20+
21+
---
22+
# publish and release
23+
!include copier/questions/features_publish_release.yml
24+
25+
---
26+
# publish and release
27+
!include copier/questions/features_documentation.yml
28+
29+
---
30+
# community
31+
!include copier/questions/features_community.yml
2032

2133
---
2234
# User messages

copier/questions/essential.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,28 @@ package_name:
1010
{% endif %}
1111
version:
1212
type: str
13-
placeholder: 0.1.0
13+
default: 0.1.0
1414
help: Enter the version of the Python package
15+
validator: >-
16+
{% if not (version | regex_search('^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$')) %}
17+
Package version should use Semantic Versioning 2.0.0 (MAJOR.MINOR.PATCH)
18+
{% endif %}
19+
full_name:
20+
type: str
21+
placeholder: Jane Smith
22+
help: Enter your full name
23+
validator: >-
24+
{% if not full_name %}
25+
Name cannot be empty
26+
{% endif %}
1527
license:
1628
type: str
1729
choices:
18-
- "Apache Software License 2.0"
30+
- "Apache-2.0"
1931
- "MIT license"
2032
- "BSD license"
2133
- "ISC license"
2234
- "GNU General Public License v3 or later"
2335
- "GNU Lesser General Public License v3 or later"
2436
- "Not open source"
25-
default: "Apache Software License 2.0"
37+
default: "Apache-2.0"

copier/questions/features.yml

Lines changed: 0 additions & 67 deletions
This file was deleted.
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
---
2+
# Questions for code quality features
3+
4+
# the main menu
5+
SelectCodeQualityFeatures:
6+
when: "{{ template_profile != 'minimum' }}"
7+
type: yaml
8+
default: |-
9+
{% if template_profile == 'recommended' %}
10+
[SelectGitHubActions_flag, not_implemented_linting, AddSonarCloud_flag, AddEditorConfig_flag]
11+
{%- else -%}
12+
[]
13+
{%- endif %}
14+
help: Select code quality features
15+
multiselect: true
16+
choices:
17+
GitHub Actions:
18+
value: SelectGitHubActions_flag
19+
# validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}"
20+
Linting (using ruff NOT_IMPLEMENTED):
21+
value: not_implemented_linting
22+
# validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}"
23+
Pre-commit:
24+
value: AddPreCommit_flag
25+
# validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}"
26+
Code analysis (using SonarCloud):
27+
value: AddSonarCloud_flag
28+
# validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}"
29+
Editorconfig:
30+
value: AddEditorConfig_flag
31+
# validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}"
32+
33+
34+
# Sub-menus
35+
SelectGitHubActions:
36+
when: "{{ 'SelectGitHubActions_flag' in SelectCodeQualityFeatures }}"
37+
type: yaml
38+
default: |-
39+
{% if template_profile == 'recommended' %}
40+
[AddGitHubActionBuild_flag, AddGitHubActionDocumentation_flag]
41+
{%- else -%}
42+
[]
43+
{%- endif %}
44+
help: Select GitHub Action workflows
45+
multiselect: true
46+
choices:
47+
Build:
48+
value: AddGitHubActionBuild_flag
49+
# validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}"
50+
Documentation:
51+
value: AddGitHubActionDocumentation_flag
52+
# validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}"
53+
Link checker (reports broken URLs):
54+
value: AddLinkCheck_flag
55+
# validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}"
56+
57+
58+
# computed features
59+
AddGitHubActionBuild:
60+
type: bool
61+
default: "{{ 'AddGitHubActionBuild_flag' in SelectGitHubActions }}"
62+
when: false
63+
64+
AddGitHubActionDocumentation:
65+
type: bool
66+
default: "{{ 'AddGitHubActionDocumentation_flag' in SelectGitHubActions }}"
67+
when: false
68+
69+
AddLinkCheck:
70+
type: bool
71+
default: "{{ 'AddLinkCheck_flag' in SelectGitHubActions }}"
72+
when: false
73+
74+
AddPreCommit:
75+
type: bool
76+
default: "{{ 'AddPreCommit_flag' in SelectCodeQualityFeatures }}"
77+
when: false
78+
79+
AddSonarCloud:
80+
type: bool
81+
default: "{{ 'AddSonarCloud_flag' in SelectCodeQualityFeatures }}"
82+
when: false
83+
84+
AddEditorConfig:
85+
type: bool
86+
default: "{{ 'AddEditorConfig_flag' in SelectCodeQualityFeatures }}"
87+
when: false
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
# Questions for community features
3+
4+
# the main menu
5+
SelectCommunityFeatures:
6+
when: "{{ template_profile != 'minimum' }}"
7+
type: yaml
8+
default: |-
9+
{% if template_profile == 'recommended' %}
10+
[AddCodeConduct_flag, AddContributing_flag]
11+
{%- else -%}
12+
[]
13+
{%- endif %}
14+
help: Select community features
15+
multiselect: true
16+
choices:
17+
Code of conduct:
18+
value: AddCodeConduct_flag
19+
# validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}"
20+
Contributing guidelines:
21+
value: AddContributing_flag
22+
# validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}"
23+
24+
# computed features
25+
AddCodeConduct:
26+
type: bool
27+
default: "{{ 'AddCodeConduct_flag' in SelectCommunityFeatures }}"
28+
when: false
29+
30+
AddContributing:
31+
type: bool
32+
default: "{{ 'AddContributing_flag' in SelectCommunityFeatures }}"
33+
when: false
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
# Questions for documentation features
3+
4+
# the main menu
5+
SelectDocumentationFeatures:
6+
when: "{{ template_profile != 'minimum' }}"
7+
type: yaml
8+
default: |-
9+
{% if template_profile == 'recommended' %}
10+
[AddOnlineDocumentation_flag, AddDevDoc_flag, not_implemented_project_setup]
11+
{%- else -%}
12+
[]
13+
{%- endif %}
14+
help: Select documentation features
15+
multiselect: true
16+
choices:
17+
Online documentation (using Read the Docs):
18+
value: AddOnlineDocumentation_flag
19+
# validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}"
20+
Developer documentation:
21+
value: AddDevDoc_flag
22+
# validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}"
23+
Project setup description (NOT_IMPLEMENTED):
24+
value: not_implemented_project_setup
25+
# validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}"
26+
27+
# computed features
28+
AddOnlineDocumentation:
29+
type: bool
30+
default: "{{ 'AddOnlineDocumentation_flag' in SelectDocumentationFeatures }}"
31+
when: false
32+
33+
AddDevDoc:
34+
type: bool
35+
default: "{{ 'AddDevDoc_flag' in SelectDocumentationFeatures }}"
36+
when: false
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
---
2+
# Questions for publishing and releasing features
3+
4+
# the main menu
5+
SelectPublishReleaseFeatures:
6+
when: "{{ template_profile != 'minimum' }}"
7+
type: yaml
8+
default: |-
9+
{% if template_profile == 'recommended' %}
10+
[SelectCitation_flag, AddZenodo_flag]
11+
{%- else -%}
12+
[]
13+
{%- endif %}
14+
help: Select publish and release features
15+
multiselect: true
16+
choices:
17+
Citation:
18+
value: SelectCitation_flag
19+
# validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}"
20+
Changelog:
21+
value: AddChangeLog_flag
22+
# validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}"
23+
Zenodo integration instructions:
24+
value: AddZenodo_flag
25+
# validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}"
26+
Package keywords(NOT_IMPLEMENTED):
27+
value: not_implemented_keywords
28+
# validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}"
29+
30+
31+
# Sub-menus
32+
# split AddCitation --> enable_citation_file and enable_cffconvert
33+
SelectCitation:
34+
when: "{{ 'SelectCitation_flag' in SelectPublishReleaseFeatures }}"
35+
type: yaml
36+
default: |-
37+
{% if template_profile == 'recommended' %}
38+
[AddCitationFile_flag, AddCFFConvert_flag]
39+
{%- else -%}
40+
[]
41+
{%- endif %}
42+
help: Select citation features
43+
multiselect: true
44+
choices:
45+
CITATION.cff file:
46+
value: AddCitationFile_flag
47+
# validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}"
48+
cffconvert GitHub Action (to validate CITATION.cff files):
49+
value: AddCFFConvert_flag
50+
# validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}"
51+
52+
53+
# computed features
54+
AddCitation:
55+
type: bool
56+
default: "{{ 'AddCitationFile_flag' in SelectCitation }}"
57+
when: false
58+
59+
AddCFFConvert:
60+
type: bool
61+
default: "{{ 'AddCFFConvert_flag' in SelectCitation }}"
62+
when: false
63+
64+
AddChangeLog:
65+
type: bool
66+
default: "{{ 'AddChangeLog_flag' in SelectPublishReleaseFeatures }}"
67+
when: false
68+
69+
AddZenodo:
70+
type: bool
71+
default: "{{ 'AddZenodo_flag' in SelectPublishReleaseFeatures }}"
72+
when: false

0 commit comments

Comments
 (0)