diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2022-08-11 21:17:01 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2022-08-13 13:55:08 +1000 |
commit | ae798157d2b54b61415c5f184dc851d185b8b6fb (patch) | |
tree | 3d651aaea4653707dad586d01252ed642f6894e9 /CONTRIBUTING.md | |
parent | a45b22e12f60f1e3d4d1caf2fd3abc14d1cd636d (diff) |
update comments
Diffstat (limited to 'CONTRIBUTING.md')
-rw-r--r-- | CONTRIBUTING.md | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 11fb75202..c6a68feae 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -63,9 +63,9 @@ by setting [`formatting.gofumpt`](https://github.com/golang/tools/blob/master/go ```jsonc // .vscode/settings.json { - "gopls": { - "formatting.gofumpt": true - } + "gopls": { + "formatting.gofumpt": true + } } ``` @@ -82,6 +82,7 @@ From most places in the codebase you have access to a logger e.g. `gui.Log.Warn( If you find that the existing logs are too noisy, you can set the log level with e.g. `LOG_LEVEL=warn go run main.go -debug` and then only use `Warn` logs yourself. If you need to log from code in the vendor directory (e.g. the `gocui` package), you won't have access to the logger, but you can easily add logging support by adding the following: + ```go func newLogger() *logrus.Entry { // REPLACE THE BELOW PATH WITH YOUR ACTUAL LOG PATH (YOU'LL SEE THIS PRINTED WHEN YOU RUN `lazygit --logs` @@ -118,9 +119,7 @@ If you want to trigger a debug session from VSCode, you can use the following sn "request": "launch", "mode": "auto", "program": "main.go", - "args": [ - "--debug" - ], + "args": ["--debug"], "console": "externalTerminal" // <-- you need this to actually see the lazygit UI in a window while debugging } ] @@ -129,7 +128,7 @@ If you want to trigger a debug session from VSCode, you can use the following sn ## Testing -Lazygit has two kinds of tests: unit tests and integration tests. Unit tests go in files that end in `_test.go`, and are written in Go. Lazygit has its own integration test system where you can build a sandbox repo with a shell script, record yourself doing something, and commit the resulting repo snapshot. It's pretty damn cool! To learn more see [here](https://github.com/jesseduffield/lazygit/blob/master/docs/Integration_Tests.md) +Lazygit has two kinds of tests: unit tests and integration tests. Unit tests go in files that end in `_test.go`, and are written in Go. For integration tests, see [here](https://github.com/jesseduffield/lazygit/blob/master/pkg/integration/README.md) ## Updating Gocui |