提交 e6878ce5 编写于 作者: J Joao Moreno

Merge commit 'refs/pull/60407/head' of github.com:Microsoft/vscode into pr/60407

......@@ -1173,9 +1173,19 @@
},
"git.inputValidationLength": {
"type": "number",
"default": 72,
"default": 50,
"description": "%config.inputValidationLength%"
},
"git.subjectValidationLength": {
"type": "number",
"default": 50,
"description": "%config.subjectValidationLength%"
},
"git.bodyValidationLength": {
"type": "number",
"default": 72,
"description": "%config.bodyValidationLength%"
},
"git.detectSubmodules": {
"type": "boolean",
"scope": "resource",
......
......@@ -98,6 +98,8 @@
"config.showPushSuccessNotification": "Controls whether to show a notification when a push is successful.",
"config.inputValidation": "Controls when to show commit message input validation.",
"config.inputValidationLength": "Controls the commit message length threshold for showing a warning.",
"config.subjectValidationLength": "Controls the commit message subject length threshold for showing a warning.",
"config.bodyValidationLength": "Controls the commit message body length threshold for showing a warning.",
"config.detectSubmodules": "Controls whether to automatically detect git submodules.",
"config.detectSubmodulesLimit": "Controls the limit of git submodules detected.",
"config.alwaysShowStagedChangesResourceGroup": "Always show the Staged Changes resource group.",
......
......@@ -658,20 +658,20 @@ export class Repository implements Disposable {
end = match ? match.index : text.length;
const line = text.substring(start, end);
const threshold = Math.max(config.get<number>('inputValidationLength') || 72, 0) || 72;
const subjectThreshold = Math.max(config.get<number>('inputValidationLength') || 50, config.get<number>('subjectValidationLength') || 50, 0) || 50;
if (line.length <= threshold) {
if (line.length <= subjectThreshold) {
if (setting !== 'always') {
return;
}
return {
message: localize('commitMessageCountdown', "{0} characters left in current line", threshold - line.length),
message: localize('commitMessageCountdown', "{0} characters left in current line", subjectThreshold - line.length),
type: SourceControlInputBoxValidationType.Information
};
} else {
return {
message: localize('commitMessageWarning', "{0} characters over {1} in current line", line.length - threshold, threshold),
message: localize('commitMessageWarning', "{0} characters over {1} in current line", line.length - subjectThreshold, subjectThreshold),
type: SourceControlInputBoxValidationType.Warning
};
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册