mirror of
https://github.com/Microsoft/vscode
synced 2024-09-13 13:46:13 +00:00
Merge commit 'refs/pull/60407/head' of github.com:Microsoft/vscode into pr/60407
This commit is contained in:
commit
e6878ce54f
|
@ -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
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue