-
Notifications
You must be signed in to change notification settings - Fork 85
Expand file tree
/
Copy pathfeatures_code_quality.yml
More file actions
111 lines (104 loc) · 3.27 KB
/
features_code_quality.yml
File metadata and controls
111 lines (104 loc) · 3.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
---
# Questions for code quality features
# the main menu
SelectCodeQualityFeatures:
when: "{{ template_profile != 'minimum' }}"
type: yaml
default: |-
{% if template_profile == 'recommended' %}
[AddLocalTests_flag, SelectGitHubActions_flag, AddLinting_flag, AddSonarCloud_flag, AddEditorConfig_flag, AddTyping_flag]
{%- else -%}
[]
{%- endif %}
help: Select code quality features
multiselect: true
choices:
Unit tests (using pytest):
value: AddLocalTests_flag
# validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}"
GitHub Actions (select in the next step):
value: SelectGitHubActions_flag
# validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}"
Linting:
value: AddLinting_flag
# validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}"
Pre-commit:
value: AddPreCommit_flag
# validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}"
Code analysis (using SonarCloud):
value: AddSonarCloud_flag
# validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}"
Editorconfig:
value: AddEditorConfig_flag
# validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}"
Typing (select type checker later):
value: AddTyping_flag
# Sub-menus
SelectGitHubActions:
when: "{{ 'SelectGitHubActions_flag' in SelectCodeQualityFeatures }}"
type: yaml
default: |-
{% if template_profile == 'recommended' %}
[AddGitHubActionBuild_flag]
{%- else -%}
[]
{%- endif %}
help: Select GitHub Action workflows
multiselect: true
choices:
Build:
value: AddGitHubActionBuild_flag
# validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}"
Link checker (reports broken URLs):
value: AddLinkCheck_flag
# validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}"
AddTyping:
type: bool
default: "{{ 'AddTyping_flag' in SelectCodeQualityFeatures }}"
when: false
SelectTypeChecker:
when: "{{ template_profile != 'minimum' and AddTyping }}"
type: str
default: pyright
help: Select a type checker
choices:
Mypy:
value: mypy
Pyright:
value: pyright
# TODO add pyrefly https://pyrefly.org/
# TODO add ty https://github.com/astral-sh/ty
# TODO add runtime type checking (using pydantic or typeguard)
# TODO ask how strict to typecheck
# computed features
AddLocalTests:
type: bool
default: "{{
'AddLocalTests_flag' in SelectCodeQualityFeatures
or 'AddGitHubActionBuild_flag' in SelectGitHubActions
or 'AddSonarCloud_flag' in SelectCodeQualityFeatures }}"
when: false
AddGitHubActionBuild:
type: bool
default: "{{ 'AddGitHubActionBuild_flag' in SelectGitHubActions }}"
when: false
AddLinkCheck:
type: bool
default: "{{ 'AddLinkCheck_flag' in SelectGitHubActions }}"
when: false
AddPreCommit:
type: bool
default: "{{ 'AddPreCommit_flag' in SelectCodeQualityFeatures }}"
when: false
AddSonarCloud:
type: bool
default: "{{ 'AddSonarCloud_flag' in SelectCodeQualityFeatures }}"
when: false
AddLinting:
type: bool
default: "{{ 'AddLinting_flag' in SelectCodeQualityFeatures }}"
when: false
AddEditorConfig:
type: bool
default: "{{ 'AddEditorConfig_flag' in SelectCodeQualityFeatures }}"
when: false