Skip to content

Commit c3b0993

Browse files
committed
Include empty arrays and maps in the generated Config.md
It's not an ideal solution because there's no indication of what kind of objects you can add to those maps or arrays, but at least they show up at all (with a comment containing a link to more information), and that's already an improvement.
1 parent 0c9154c commit c3b0993

File tree

2 files changed

+30
-10
lines changed

2 files changed

+30
-10
lines changed

docs/Config.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,16 @@ This is only meant as a reference for what config options exist, and what their
3737
```yaml
3838
# Config relating to the Lazygit UI
3939
gui:
40+
# See https://github.com/jesseduffield/lazygit/blob/master/docs/Config.md#custom-author-color
41+
authorColors: {}
42+
43+
# See https://github.com/jesseduffield/lazygit/blob/master/docs/Config.md#custom-branch-color
44+
# Deprecated: use branchColorPatterns instead
45+
branchColors: {}
46+
47+
# See https://github.com/jesseduffield/lazygit/blob/master/docs/Config.md#custom-branch-color
48+
branchColorPatterns: {}
49+
4050
# The number of lines you scroll by when scrolling the main window
4151
scrollHeight: 2
4252

@@ -341,12 +351,21 @@ git:
341351
# Deprecated: Use `allBranchesLogCmds` instead.
342352
allBranchesLogCmd: git log --graph --all --color=always --abbrev-commit --decorate --date=relative --pretty=medium
343353

354+
# Commands used to display git log of all branches in the main window, they will be cycled in order of appearance (array of strings)
355+
allBranchesLogCmds: []
356+
344357
# If true, do not spawn a separate process when using GPG
345358
overrideGpg: false
346359

347360
# If true, do not allow force pushes
348361
disableForcePushing: false
349362

363+
# See https://github.com/jesseduffield/lazygit/blob/master/docs/Config.md#predefined-commit-message-prefix
364+
commitPrefix: []
365+
366+
# See https://github.com/jesseduffield/lazygit/blob/master/docs/Config.md#predefined-commit-message-prefix
367+
commitPrefixes: {}
368+
350369
# See https://github.com/jesseduffield/lazygit/blob/master/docs/Config.md#predefined-branch-name-prefix
351370
branchPrefix: ""
352371

@@ -459,6 +478,13 @@ os:
459478
# If true, don't display introductory popups upon opening Lazygit.
460479
disableStartupPopups: false
461480

481+
# User-configured commands that can be invoked from within Lazygit
482+
# See https://github.com/jesseduffield/lazygit/blob/master/docs/Custom_Command_Keybindings.md
483+
customCommands: []
484+
485+
# See https://github.com/jesseduffield/lazygit/blob/master/docs/Config.md#custom-pull-request-urls
486+
services: {}
487+
462488
# What to do when opening Lazygit outside of a git repo.
463489
# - 'prompt': (default) ask whether to initialize a new repo or open in the most recent repo
464490
# - 'create': initialize a new repo

pkg/jsonschema/generate_config_docs.go

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -205,16 +205,6 @@ func recurseOverSchema(rootSchema, schema *jsonschema.Schema, parent *Node) {
205205
for pair := schema.Properties.Oldest(); pair != nil; pair = pair.Next() {
206206
subSchema := getSubSchema(rootSchema, schema, pair.Key)
207207

208-
// Skip empty objects
209-
if subSchema.Type == "object" && subSchema.Properties == nil {
210-
continue
211-
}
212-
213-
// Skip empty arrays
214-
if isZeroValue(subSchema.Default) && subSchema.Type == "array" {
215-
continue
216-
}
217-
218208
node := Node{
219209
Name: pair.Key,
220210
Description: subSchema.Description,
@@ -235,6 +225,10 @@ func getZeroValue(val any, t string) any {
235225
return ""
236226
case "boolean":
237227
return false
228+
case "object":
229+
return map[string]any{}
230+
case "array":
231+
return []any{}
238232
default:
239233
return nil
240234
}

0 commit comments

Comments
 (0)