Skip to content

Commit 38bde8a

Browse files
harrisoncramergkzejakubbortlik
authored
Bug Fixes (#382)
* fix: error messages and run all tests (#381) * feat: Automatically open fold under cursor (#380) * fix: discussion ID is not required (#383) This is a #PATCH release. --------- Co-authored-by: George Kontridze <george.kontridze@gmail.com> Co-authored-by: Jakub F. Bortlík <jakub.bortlik@proton.me>
1 parent 5c9b88d commit 38bde8a

File tree

5 files changed

+13
-5
lines changed

5 files changed

+13
-5
lines changed

cmd/app/draft_notes.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ func (a draftNoteService) listDraftNotes(w http.ResponseWriter, r *http.Request)
9090

9191
type PostDraftNoteRequest struct {
9292
Comment string `json:"comment" validate:"required"`
93-
DiscussionId string `json:"discussion_id,omitempty" validate:"required"`
93+
DiscussionId string `json:"discussion_id,omitempty"`
9494
PositionData // TODO: How to add validations to data from external package???
9595
}
9696

cmd/app/git/git_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ func TestExtractGitInfo_FailToGetProjectRemoteUrl(t *testing.T) {
198198
tC := FailTestCase{
199199
desc: "Error returned by function to get the project remote url",
200200
errMsg: "Some error",
201-
expectedErr: "Could not get project Url: Some error",
201+
expectedErr: "could not get project Url: Some error",
202202
}
203203
t.Run(tC.desc, func(t *testing.T) {
204204
g := failingUrlManager{
@@ -227,7 +227,7 @@ func TestExtractGitInfo_FailToGetCurrentBranchName(t *testing.T) {
227227
tC := FailTestCase{
228228
desc: "Error returned by function to get the project remote url",
229229
errMsg: "Some error",
230-
expectedErr: "Failed to get current branch: Some error",
230+
expectedErr: "failed to get current branch: Some error",
231231
}
232232
t.Run(tC.desc, func(t *testing.T) {
233233
g := failingBranchManager{

lua/gitlab/reviewer/init.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@ M.jump = function(file_name, line_number, new_buffer)
145145
line_number = number_of_lines
146146
end
147147
vim.api.nvim_win_set_cursor(0, { line_number, 0 })
148+
u.open_fold_under_cursor()
149+
vim.cmd("normal! zz")
148150
end
149151

150152
---Get the data from diffview, such as line information and file name. May be used by

lua/gitlab/utils/init.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -752,4 +752,10 @@ M.get_nested_field = function(table, field)
752752
end
753753
end
754754

755+
M.open_fold_under_cursor = function()
756+
if vim.fn.foldclosed(vim.fn.line(".")) > -1 then
757+
vim.cmd("normal! zo")
758+
end
759+
end
760+
755761
return M

makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ PROJECTNAME=$(shell basename "$(PWD)")
44

55
## compile: build golang project
66
compile:
7-
@cd cmd && go build -o bin && mv bin ../bin
7+
@go build -o bin ./cmd
88
## test: run golang project tests
99
test:
10-
@cd cmd/app && go test
10+
@go test -v ./...
1111

1212
.PHONY: help
1313
all: help

0 commit comments

Comments
 (0)