From af842e40d4d11aea8f9534e42d312fff2860c0ba Mon Sep 17 00:00:00 2001 From: Karim Khaleel Date: Sat, 18 May 2024 19:46:06 +0300 Subject: [PATCH] Remove unnecesary schema validations in user config --- pkg/config/user_config.go | 6 +++--- schema/config.json | 9 ++------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/pkg/config/user_config.go b/pkg/config/user_config.go index c22594461..7a551bca6 100644 --- a/pkg/config/user_config.go +++ b/pkg/config/user_config.go @@ -252,7 +252,7 @@ type PagingConfig struct { // diff-so-fancy // delta --dark --paging=never // ydiff -p cat -s --wrap --width={{columnWidth}} - Pager PagerType `yaml:"pager" jsonschema:"minLength=1"` + Pager PagerType `yaml:"pager"` // If true, Lazygit will use whatever pager is specified in `$GIT_PAGER`, `$PAGER`, or your *git config*. If the pager ends with something like ` | less` we will strip that part out, because less doesn't play nice with our rendering approach. If the custom pager uses less under the hood, that will also break rendering (hence the `--paging=never` flag for the `delta` pager). UseConfig bool `yaml:"useConfig"` // e.g. 'difft --color=always' @@ -294,9 +294,9 @@ type LogConfig struct { type CommitPrefixConfig struct { // pattern to match on. E.g. for 'feature/AB-123' to match on the AB-123 use "^\\w+\\/(\\w+-\\w+).*" - Pattern string `yaml:"pattern" jsonschema:"example=^\\w+\\/(\\w+-\\w+).*,minLength=1"` + Pattern string `yaml:"pattern" jsonschema:"example=^\\w+\\/(\\w+-\\w+).*"` // Replace directive. E.g. for 'feature/AB-123' to start the commit message with 'AB-123 ' use "[$1] " - Replace string `yaml:"replace" jsonschema:"example=[$1] ,minLength=1"` + Replace string `yaml:"replace" jsonschema:"example=[$1]"` } type UpdateConfig struct { diff --git a/schema/config.json b/schema/config.json index 05a2db151..3e8bc7c80 100644 --- a/schema/config.json +++ b/schema/config.json @@ -428,7 +428,6 @@ }, "pager": { "type": "string", - "minLength": 1, "description": "e.g.\ndiff-so-fancy\ndelta --dark --paging=never\nydiff -p cat -s --wrap --width={{columnWidth}}", "default": "", "examples": [ @@ -543,7 +542,6 @@ "properties": { "pattern": { "type": "string", - "minLength": 1, "description": "pattern to match on. E.g. for 'feature/AB-123' to match on the AB-123 use \"^\\\\w+\\\\/(\\\\w+-\\\\w+).*\"", "examples": [ "^\\w+\\/(\\w+-\\w+).*" @@ -551,10 +549,9 @@ }, "replace": { "type": "string", - "minLength": 1, "description": "Replace directive. E.g. for 'feature/AB-123' to start the commit message with 'AB-123 ' use \"[$1] \"", "examples": [ - "[$1] " + "[$1]" ] } }, @@ -567,7 +564,6 @@ "properties": { "pattern": { "type": "string", - "minLength": 1, "description": "pattern to match on. E.g. for 'feature/AB-123' to match on the AB-123 use \"^\\\\w+\\\\/(\\\\w+-\\\\w+).*\"", "examples": [ "^\\w+\\/(\\w+-\\w+).*" @@ -575,10 +571,9 @@ }, "replace": { "type": "string", - "minLength": 1, "description": "Replace directive. E.g. for 'feature/AB-123' to start the commit message with 'AB-123 ' use \"[$1] \"", "examples": [ - "[$1] " + "[$1]" ] } },