-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add default lazygit config generation in Config.md from JSON schema #3565
Add default lazygit config generation in Config.md from JSON schema #3565
Conversation
This is fantastic, really great work. A couple of thoughts:
To answer your questions:
Really awesome, I'm very happy about this. Let me know if there's anything I can do to help finish this. |
963fa77
to
4a437b3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thanks for addressing all my wishes. The solution with the orderedmap is really nice.
I have a few more, but this time I pushed WIP or fixup commits for them:
- The old, manually crafted default section had most of the comments as line comments after the value. I pushed a commit (81034ed) that makes it so that one-line descriptions go after the value, multi-line descriptions before the key. It's a matter of taste which one looks better; I don't have a strong opinion, I only changed it so that we're closer to how it was before. @jesseduffield, any opinion? For comparison, here is Karim's original version, and here is the one with line comments.
- I came up with a workaround for the missing
#
on blank lines in multi-line descriptions (bc7e29f), which means we could drop the removal of the empty lines again (7e7d1a8)
@@ -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"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes and the ones below in the same file could go into a separate commit (before this one).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved it out of this commit. Changed the history of the commits though. I think if I force push now the links you posted will break. I can add comments below yours with the updated hashes though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! I like the way it looks with the line comments.
This is great! I dropped the change that deleted those lines out of the user config. I think having the ability to add blank lines is important. I was also thinking about adding some more logic to drop the entries that are deprecated from the generated yaml. What do you think @stefanhaller? |
I pushed a new branch to avoid overwriting this one's commit history for now. This is what Config.md would look like with the removed deprecated configs. |
I would actually prefer to leave the deprecated configs in as long as we support them. I think it's good to document them too. No strong opinion though, again I'll leave the final decision about this to @jesseduffield. |
844652f
to
b72b62f
Compare
Reading through it, I'd actually like to have all comments sitting above the line they refer to. That makes it more consistent and I think would make it look neater too.
I agree: let's document deprecations. It prevents a user from having to read the code to understand how their current setup is working. If a user goes and makes use of a deprecated config and then we remove it, that's on them. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really great work. Left a couple comments
return | ||
} | ||
|
||
defaultSectionIndex := bytes.Index(markdown, []byte("## Default")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should add a hidden yaml comment which marks the beginning (and end if necessary) of the config so we can just replace that. Using ## Default
isn't very specific. Also this allows us to tell devs not to update it manually. So something like:
<!-- START CONFIG YAML: AUTOMATICALLY GENERATED with `go generate ./..., DO NOT UPDATE MANUALLY -->
...
<!-- END CONFIG YAML -->
|
||
const IndentLevel = 2 | ||
|
||
func setComment(yamlNode *yaml.Node, description string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would just always show the comment on top of the line
Kind: yaml.ScalarNode, | ||
Value: child.Name, | ||
} | ||
if child.Description != "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice if we could also separate keys that have comments with newlines, but I'm not sure how to do that after hacking it at for a couple minutes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't seem to be possible: go-yaml/yaml#627
But also, since almost all keys (except for keybindings) have comments now, wouldn't that consume too much vertical space?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not concerned about vertical space, but seems it's a moot point if the library doesn't support it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But we can insert the blank lines ourselves after marshalling; it's not that hard actually, and it does indeed make things much more readable:
diff --git a/pkg/jsonschema/generate_config_docs.go b/pkg/jsonschema/generate_config_docs.go
index 000aad53b..965477f2c 100644
--- a/pkg/jsonschema/generate_config_docs.go
+++ b/pkg/jsonschema/generate_config_docs.go
@@ -144,6 +144,30 @@ func parseNode(parent *Node, name string, value *orderedmap.OrderedMap) {
}
}
+func insertBlankLines(buffer bytes.Buffer) bytes.Buffer {
+ lines := strings.Split(strings.TrimRight(buffer.String(), "\n"), "\n")
+
+ var newBuffer bytes.Buffer
+
+ previousIndent := -1
+ wasComment := false
+
+ for _, line := range lines {
+ trimmedLine := strings.TrimLeft(line, " ")
+ indent := len(line) - len(trimmedLine)
+ isComment := strings.HasPrefix(trimmedLine, "#")
+ if isComment && !wasComment && indent <= previousIndent {
+ newBuffer.WriteString("\n")
+ }
+ newBuffer.WriteString(line)
+ newBuffer.WriteString("\n")
+ previousIndent = indent
+ wasComment = isComment
+ }
+
+ return newBuffer
+}
+
func writeToConfigDocs(buffer *bytes.Buffer) {
// Remove all `---` lines
strData := buffer.String()
@@ -235,5 +259,7 @@ func GenerateConfigDocs() {
}
}
+ buffer = insertBlankLines(buffer)
+
writeToConfigDocs(&buffer)
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah nice, I'm happy with that approach
@karimkhaleel Another thought: the original Config.md had Keybindings last, and I think that's good. We should reorder the UserConfig struct to move Keybinding to the end. (I'd do that as a separate commit at the end of the branch.) |
4e019d9
to
bdf297a
Compare
I think I addressed all the issues raised. Liking the spaces before entries with comments. I think all that's left is cleaning up the commit history, right? Any suggestions on what I should squash? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, great work. I'll let @stefanhaller advise on squashing of commits. I'd be happy for this to be squashed into a single commit because it doesn't touch much existing code but happy to defer to @stefanhaller 's judgement
I agree, great work. (I think I said this before. 😄) I'd keep the first two commits and the last one separate, and squash everything else into the third one. (Hope that's clear enough.) |
bdf297a
to
88e57fd
Compare
Awesome! Thank you for your feedback! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The perfectionist in me found a few more nits to pick, see below. I added fixups for all of them.
I'm going to squash them right away and merge to save another roundtrip, hoping they are uncontroversial enough.
|
||
// Remove trailing newline | ||
config := newBuffer.Bytes() | ||
config = config[:len(config)-1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are cutting off the last character, assuming that it is a newline, but we don't really check that. I think it's better to trim the space before splitting into lines, like we are doing in insertBlankLines
. Changed in 4225893.
|
||
for _, line := range lines { | ||
if strings.TrimSpace(line) != "---" { | ||
newBuffer.WriteString(line + "\n") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a potential memory allocation, and since we are using a bytes.Buffer
which is supposed to have smart buffering, it's more efficient to write the two things separately. Changed in fa16009.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!
|
||
startConfigSectionIndex := bytes.Index(markdown, []byte(DocumentationCommentStart)) | ||
if startConfigSectionIndex == -1 { | ||
return fmt.Errorf("Default config starting comment not found, %w", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes the generated default config in Config.md match the original order.
dd9f158
to
9b152d7
Compare
It used to be a common thing to have to update Config.md in a PR (and we often forgot despite the template). As of #3565 this is no longer necessary, so remove this from the template. Updating docs in general is still a good thing to think about, so we leave this in.
It used to be a common thing to have to update Config.md in a PR (and we often forgot despite the template). As of #3565 this is no longer necessary, so remove this from the template. Updating docs in general is still a good thing to think about, so we leave this in.
It used to be a common thing to have to update `Config.md` in a PR (and we often forgot despite the template). As of #3565 this is no longer necessary, so remove this from the template. Updating docs in general is still a good thing to think about, so we leave this in.
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Update | Change | |---|---|---| | [jesseduffield/lazygit](https://togithub.com/jesseduffield/lazygit) | minor | `v0.42.0` -> `v0.43.1` | --- ### Release Notes <details> <summary>jesseduffield/lazygit (jesseduffield/lazygit)</summary> ### [`v0.43.1`](https://togithub.com/jesseduffield/lazygit/releases/tag/v0.43.1) [Compare Source](https://togithub.com/jesseduffield/lazygit/compare/v0.43.0...v0.43.1) <!-- Release notes generated using configuration in .github/release.yml at v0.43.1 --> #### What's Changed ##### Fixes 🔧 - Fix language auto detection by [@​stefanhaller](https://togithub.com/stefanhaller) in [jesseduffield/lazygit#3744 **Full Changelog**: jesseduffield/lazygit@v0.43.0...v0.43.1 ### [`v0.43.0`](https://togithub.com/jesseduffield/lazygit/releases/tag/v0.43.0) [Compare Source](https://togithub.com/jesseduffield/lazygit/compare/v0.42.0...v0.43.0) #### What's Changed Thanks to all contributors who helped make this release happen! There's a lot of first-time contributors on this release as well so kudos to you all. There's quite a few things in this release. I'm going to single out a couple that have changed my workflow. ##### Base branch stuff https://github.com/user-attachments/assets/9f50824a-6221-4ca0-9cf3-a4d45cc43262 ##### Easier rebase onto base branch *(Add command to rebase onto base branch by [@​stefanhaller](https://togithub.com/stefanhaller) in [jesseduffield/lazygit#3615 When my feature branch gets out of date with the main branch, I like to rebase it onto the main branch. Up until now, that's required: - Navigating to the main branch - Pressing 'f' to fast-forward it onto its upstream branch - Pressing 'r' to rebase the checked-out branch onto the main branch That takes too long! Now you can just press 'r' followed by 'b' to rebase onto the base branch (which defaults to origin/main). ##### See the divergence count from the base branch *(Divergence from base branch display by [@​stefanhaller](https://togithub.com/stefanhaller) in [jesseduffield/lazygit#3613 You can now also configure to see the divergence from a branch and its base branch with the following config: ```yml gui: showDivergenceFromBaseBranch: arrowAndNumber # or 'onlyArrow' ``` This shows the divergence count in blue, next to the yellow count of divergence from the upstream branch. This is admittedly noisy, so it's an opt-in feature. But I think the noise is worth it. If you set the config value to 'onlyArrow' it's a lot less noisy: <img width="891" alt="image" src="https://github.com/user-attachments/assets/470cb003-8fc6-4a72-aa04-6e228c49f381"> ##### See detailed divergence from base branch *(Add command to show divergence from base branch as a left-right log by [@​stefanhaller](https://togithub.com/stefanhaller) in [jesseduffield/lazygit#3614 By pressing 'u' then 'b' on a branch you can see the divergence view for that branch compared to its base branch ##### Improved 'Find commit for fixup' feature *(Improve the "Find base commit for fixup" command by [@​stefanhaller](https://togithub.com/stefanhaller) in [jesseduffield/lazygit#3602 'Find commit for fixup' is not a very catchy name for this feature but I can't think of anything better at the moment. Nevertheless! The idea is that you often want to know for a given set of changes, which commit ought they be included in? Just press `ctrl+f` when in the files panel and lazygit will jump the cursor to the appropriate commit to fixup. With this release, the feature is smarter and more lenient so it's more likely to find you a match. If you haven't tried this out you should really give it a go! https://github.com/user-attachments/assets/220e4190-b631-40a5-b8dc-7d1a6116ab09 ##### Other Enhancements 🔥 - Add Squash merge by [@​noahfraiture](https://togithub.com/noahfraiture) in [jesseduffield/lazygit#3566 - Now when you press `shift+m` you get the option to do a regular merge or a squash merge. If you already have muscle memory for regular merge; don't worry: it's the same sequence of keypresses. - Improve "Find base commit for fixup" command when there are changes for master commits by [@​stefanhaller](https://togithub.com/stefanhaller) in [jesseduffield/lazygit#3645 - Allow setting the similarity threshold for detecting renames by [@​isti115](https://togithub.com/isti115) in [jesseduffield/lazygit#3025 - For this, press ')' and '(' to increase/decrease the similarity threshold. https://github.com/user-attachments/assets/a85825b8-9110-4090-ba89-ba8221cbc7a8 - Reduce memory consumption when loading large number of commits by [@​stefanhaller](https://togithub.com/stefanhaller) in [jesseduffield/lazygit#3687 - 2-6x less memory usage when dealing with lots of commits. HUGE improvement. - Focus on local commits view after moving code into new commit by [@​AzraelSec](https://togithub.com/AzraelSec) in [jesseduffield/lazygit#3577 - Add property outputTitle to CustomCommand by [@​stefanhaller](https://togithub.com/stefanhaller) in [jesseduffield/lazygit#3579 - Add user config `gui.expandedSidePanelWeight` by [@​stefanhaller](https://togithub.com/stefanhaller) in [jesseduffield/lazygit#3623 - You can now increase the height of the selected side panel when you've configured the accordion effect ```yml gui: expandFocusedSidePanel: true expandedSidePanelWeight: 3 ``` <img width="891" alt="image" src="https://github.com/user-attachments/assets/8a47bd1c-67b0-4d2f-a885-56e6a07ece12"> - Support range select for amending commit attributes by [@​AzraelSec](https://togithub.com/AzraelSec) in [jesseduffield/lazygit#3587 - This lets you select a range of commits and update the author / set the co-author on all of them at once. https://github.com/user-attachments/assets/2d3e15a9-4acc-4b81-b0e2-a34490ad77ad - Show "exec" todos in the list of rebase todos by [@​stefanhaller](https://togithub.com/stefanhaller) in [jesseduffield/lazygit#3654 - Search the model instead of the view in the commits panel by [@​stefanhaller](https://togithub.com/stefanhaller) in [jesseduffield/lazygit#3642 - Add prompt to the remote branch checkout menu by [@​stefanhaller](https://togithub.com/stefanhaller) in [jesseduffield/lazygit#3652 - Always show the "Discard unchanged changes" menu item by [@​stefanhaller](https://togithub.com/stefanhaller) in [jesseduffield/lazygit#3683 - Show current value in menus by [@​stefanhaller](https://togithub.com/stefanhaller) in [jesseduffield/lazygit#3628 - Add command to paste commit message from clipboard by [@​WaterLemons2k](https://togithub.com/WaterLemons2k) in [jesseduffield/lazygit#3676 - Stagger popup panels by [@​stefanhaller](https://togithub.com/stefanhaller) in [jesseduffield/lazygit#3694 - Make commit author length configurable by [@​stefanhaller](https://togithub.com/stefanhaller) in [jesseduffield/lazygit#3688 (initial implementation by [@​anikiforov](https://togithub.com/anikiforov)) - Make opening git difftool more consistent by [@​part22](https://togithub.com/part22) in [jesseduffield/lazygit#3691 - Update tracking behaviour for branches created from remote branches by [@​part22](https://togithub.com/part22) in [jesseduffield/lazygit#3712 - Allow setting a default name when creating new branches by [@​elliotcubit](https://togithub.com/elliotcubit) in [jesseduffield/lazygit#3487 - Add Token credential request handling by [@​gmlexx](https://togithub.com/gmlexx) in [jesseduffield/lazygit#3647 - Switch between multiple log views by [@​mkock](https://togithub.com/mkock) in [jesseduffield/lazygit#3354 - Faster startup by [@​jwhitley](https://togithub.com/jwhitley) in [jesseduffield/lazygit#3284 - Extend icon coverage on remotes and file extensions by [@​hasecilu](https://togithub.com/hasecilu) in [jesseduffield/lazygit#3484 - Add nerdfont icons for .bicep & .bicepparam files by [@​scottmckendry](https://togithub.com/scottmckendry) in [jesseduffield/lazygit#3053 ##### Fixes 🔧 - Fix tooltip for fixup command by [@​stefanhaller](https://togithub.com/stefanhaller) in [jesseduffield/lazygit#3601 - Fix pushing to branch when upstream not stored locally by [@​stefanhaller](https://togithub.com/stefanhaller) in [jesseduffield/lazygit#3619 - ([#​3618](https://togithub.com/jesseduffield/lazygit/issues/3618)) Fix pushing a branch to remote with a different name causing error by [@​JordanllHarper](https://togithub.com/JordanllHarper) in [jesseduffield/lazygit#3630 - Fix secondary window resize by [@​AzraelSec](https://togithub.com/AzraelSec) in [jesseduffield/lazygit#3637 - Fix truncation of branch names containing non-ASCII characters by [@​stefanhaller](https://togithub.com/stefanhaller) in [jesseduffield/lazygit#3685 - Fix duplicate keybinding suggestions in status bar after switching repos by [@​stefanhaller](https://togithub.com/stefanhaller) in [jesseduffield/lazygit#3660 - Fix PTY layout problems by [@​stefanhaller](https://togithub.com/stefanhaller) in [jesseduffield/lazygit#3658 - Fix custom patch operations for added files by [@​stefanhaller](https://togithub.com/stefanhaller) in [jesseduffield/lazygit#3684 - Improve render performance by [@​stefanhaller](https://togithub.com/stefanhaller) in [jesseduffield/lazygit#3686 - Fix wrong highlight in staging panel when entering file with only staged changes by [@​stefanhaller](https://togithub.com/stefanhaller) in [jesseduffield/lazygit#3667 - Always reapply filters on filtered views when model changes, even inactive ones by [@​stefanhaller](https://togithub.com/stefanhaller) in [jesseduffield/lazygit#3697 - Turn off the highlight of the suggestions panel when it loses focus by [@​stefanhaller](https://togithub.com/stefanhaller) in [jesseduffield/lazygit#3696 - Fix running lazygit with a language other than English on Windows by [@​stefanhaller](https://togithub.com/stefanhaller) in [jesseduffield/lazygit#3705 - Fix multi selection stage/discard not working for files with substrings by [@​brandondong](https://togithub.com/brandondong) in [jesseduffield/lazygit#3599 - Only add commit prefix if branch name matches regex pattern by [@​phaze-ZA](https://togithub.com/phaze-ZA) in [jesseduffield/lazygit#3703 ##### Maintenance ⚙️ - Add default lazygit config generation in Config.md from JSON schema by [@​karimkhaleel](https://togithub.com/karimkhaleel) in [jesseduffield/lazygit#3565 - Remove hint about Config.md from PR template by [@​stefanhaller](https://togithub.com/stefanhaller) in [jesseduffield/lazygit#3578 - Add `copyloopvar` to enabled linters by [@​kyu08](https://togithub.com/kyu08) in [jesseduffield/lazygit#3586 - Add `lint` to make target by [@​kyu08](https://togithub.com/kyu08) in [jesseduffield/lazygit#3593 - Delete the TODO comment about enabling `goconst` in the future from `.golangci.yml` by [@​kyu08](https://togithub.com/kyu08) in [jesseduffield/lazygit#3596 - Pin golangci version to 1.58 by [@​stefanhaller](https://togithub.com/stefanhaller) in [jesseduffield/lazygit#3611 - Improve branch and reflog loading when sorting branches by date by [@​stefanhaller](https://togithub.com/stefanhaller) in [jesseduffield/lazygit#3609 - Fix boolean config keys not appearing in the generated Config.md by [@​stefanhaller](https://togithub.com/stefanhaller) in [jesseduffield/lazygit#3622 - Make profiling easier by [@​stefanhaller](https://togithub.com/stefanhaller) in [jesseduffield/lazygit#3634 - Update `rebase_onto` demo test to match new the rebase menu title by [@​AzraelSec](https://togithub.com/AzraelSec) in [jesseduffield/lazygit#3636 - Include demos when running integration tests on CI by [@​stefanhaller](https://togithub.com/stefanhaller) in [jesseduffield/lazygit#3640 - Fix reporting of unexpected selections in integration tests by [@​stefanhaller](https://togithub.com/stefanhaller) in [jesseduffield/lazygit#3662 - Convert TranslationSets to json by [@​stefanhaller](https://togithub.com/stefanhaller) in [jesseduffield/lazygit#3649 - Fix go generate on windows by [@​stefanhaller](https://togithub.com/stefanhaller) in [jesseduffield/lazygit#3706 - Update translations from Crowdin by [@​stefanhaller](https://togithub.com/stefanhaller) in [jesseduffield/lazygit#3707 - Bump `actions/checkout`, `actions/setup-go`, `actions/cache/restore`, `actions/cache/save` by [@​kyu08](https://togithub.com/kyu08) in [jesseduffield/lazygit#3594 - Check for fixup commits on CI by [@​jesseduffield](https://togithub.com/jesseduffield) in [jesseduffield/lazygit#3742 ##### Docs 📖 - Upgrade to Alpine Linux v3.19 by [@​fossdd](https://togithub.com/fossdd) in [jesseduffield/lazygit#3541 - Add flox install by [@​bryanhonof](https://togithub.com/bryanhonof) in [jesseduffield/lazygit#3656 #### New Contributors - [@​JordanllHarper](https://togithub.com/JordanllHarper) made their first contribution in [jesseduffield/lazygit#3630 - [@​anikiforov](https://togithub.com/anikiforov) made their first contribution in [jesseduffield/lazygit#3625 - [@​WaterLemons2k](https://togithub.com/WaterLemons2k) made their first contribution in [jesseduffield/lazygit#3676 - [@​noahfraiture](https://togithub.com/noahfraiture) made their first contribution in [jesseduffield/lazygit#3566 - [@​fossdd](https://togithub.com/fossdd) made their first contribution in [jesseduffield/lazygit#3541 - [@​scottmckendry](https://togithub.com/scottmckendry) made their first contribution in [jesseduffield/lazygit#3053 - [@​elliotcubit](https://togithub.com/elliotcubit) made their first contribution in [jesseduffield/lazygit#3487 - [@​bryanhonof](https://togithub.com/bryanhonof) made their first contribution in [jesseduffield/lazygit#3656 - [@​gmlexx](https://togithub.com/gmlexx) made their first contribution in [jesseduffield/lazygit#3647 - [@​mkock](https://togithub.com/mkock) made their first contribution in [jesseduffield/lazygit#3354 - [@​phaze-ZA](https://togithub.com/phaze-ZA) made their first contribution in [jesseduffield/lazygit#3703 - [@​hasecilu](https://togithub.com/hasecilu) made their first contribution in [jesseduffield/lazygit#3484 **Full Changelog**: jesseduffield/lazygit@v0.42.0...v0.43.0 #### Shameless Plug I (Jesse) quit my day job and co-founded Subble, a startup that helps your company manage its SaaS subscriptions (discovery of subscriptions, onboarding/offboarding etc) to save you time and money. Check it out! https://www.subble.com/ </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/d-issy/dotfiles). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MjUuMSIsInVwZGF0ZWRJblZlciI6IjM3LjQyNS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This uses the JSON schema generated in Add UserConfig jsonschema generation script #3039 to generate and replace the default lazygit config in Config.md when running
go generate ./...
Relevant issue: #3441
The generated config contains all the entries that have default values set in
user_config.go
Several notes:
windowSize
is an enum ofnormal, half, full
, but we set it to an empty string inuser_config.go
. I set it tonormal
because the comment we have there says thatnormal
is the default value.pager
has a validation ofminLength=1
, but we set it to equal an empty string inuser_config.go
. Not sure what to do about this field, we explicitly set it to equal an empty string in the user config but require a min length of 1.commitPrefix
'spattern
andreplace
both also fail validation because they are set to be empty strings by default but have a min length validation of 1.So at the moment we have 3 validation issues in the generated config that I am not sure how to fix.
go generate ./...
)docs/Config.md
) have been updated if necessary