You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
f"{_get_icon_for_rule(rules_output_status['error_type'])}{_color_purple('<type>')} is mandatory, use one of the following: [{_color_purple(allowed_types(args))}]",
131
-
f"{_get_icon_for_rule(rules_output_status['error_scope_format'])}{_color_blue('(<optional-scope>)')} if used, must be enclosed in parentheses",
132
-
f"{_get_icon_for_rule(rules_output_status['error_scope_capitalization'])}{_color_blue('(<optional-scope>)')} if used, must be written in lower case without whitespace",
133
-
f"{_get_icon_for_rule(rules_output_status['error_summary_period'])}{_color_orange('<summary>')} must not end with a period",
134
-
f"{_get_icon_for_rule(rules_output_status['error_summary_length'])}{_color_orange('<summary>')} must be between {args.subject_min_length} and {args.subject_max_length} characters long",
135
-
f"{_get_icon_for_rule(rules_output_status['error_body_length'])}{_color_grey('<body>')} lines must be no longer than {args.body_max_line_length} characters",
136
-
f"{_get_icon_for_rule(rules_output_status['error_body_format'])}{_color_grey('<body>')} must be separated from the 'summary' by a blank line",
137
-
]
138
-
139
-
# Dynamically add the additional rules set by arguments
140
+
rule_messages: List[str] = []
141
+
142
+
# TYPES messages
143
+
rule_messages.append(
144
+
f"{_get_icon_for_rule(rules_output_status['error_type'])}{_color_purple('<type>')} is mandatory, use one of the following: [{_color_purple(', '.join(get_allowed_types(args)))}]"
145
+
)
146
+
147
+
# SCOPE messages
148
+
rule_messages.append(
149
+
f"{_get_icon_for_rule(rules_output_status['error_scope_format'])}{_color_blue('(<optional-scope>)')} if used, must be enclosed in parentheses"
150
+
)
151
+
rule_messages.append(
152
+
f"{_get_icon_for_rule(rules_output_status['error_scope_capitalization'])}{_color_blue('(<optional-scope>)')} if used, must be written in lower case without whitespace"
153
+
)
154
+
ifargs.scopes:
155
+
rule_messages.append(
156
+
f"{_get_icon_for_rule(rules_output_status['error_scope_allowed'])}{_color_blue('(<optional-scope>)')} if used, must be one of the following allowed scopes: [{_color_blue(', '.join(args.scopes))}]"
157
+
)
158
+
159
+
# SUMMARY messages
160
+
rule_messages.append(
161
+
f"{_get_icon_for_rule(rules_output_status['error_summary_period'])}{_color_orange('<summary>')} must not end with a period"
162
+
)
163
+
rule_messages.append(
164
+
f"{_get_icon_for_rule(rules_output_status['error_summary_length'])}{_color_orange('<summary>')} must be between {args.subject_min_length} and {args.subject_max_length} characters long"
165
+
)
140
166
ifargs.summary_uppercase:
141
167
rule_messages.append(
142
168
f"{_get_icon_for_rule(rules_output_status['error_summary_capitalization'])}{_color_orange('<summary>')} must start with an uppercase letter"
143
169
)
144
170
171
+
# BODY messages
172
+
rule_messages.append(
173
+
f"{_get_icon_for_rule(rules_output_status['error_body_length'])}{_color_grey('<body>')} lines must be no longer than {args.body_max_line_length} characters"
174
+
)
175
+
rule_messages.append(
176
+
f"{_get_icon_for_rule(rules_output_status['error_body_format'])}{_color_grey('<body>')} must be separated from the 'summary' by a blank line"
177
+
)
178
+
145
179
# Combine the rule messages into the final report block
0 commit comments