Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/app/draft_notes.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func (a draftNoteService) listDraftNotes(w http.ResponseWriter, r *http.Request)

type PostDraftNoteRequest struct {
Comment string `json:"comment" validate:"required"`
DiscussionId string `json:"discussion_id,omitempty" validate:"required"`
DiscussionId string `json:"discussion_id,omitempty"`
PositionData // TODO: How to add validations to data from external package???
}

Expand Down
4 changes: 2 additions & 2 deletions cmd/app/git/git_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ func TestExtractGitInfo_FailToGetProjectRemoteUrl(t *testing.T) {
tC := FailTestCase{
desc: "Error returned by function to get the project remote url",
errMsg: "Some error",
expectedErr: "Could not get project Url: Some error",
expectedErr: "could not get project Url: Some error",
}
t.Run(tC.desc, func(t *testing.T) {
g := failingUrlManager{
Expand Down Expand Up @@ -227,7 +227,7 @@ func TestExtractGitInfo_FailToGetCurrentBranchName(t *testing.T) {
tC := FailTestCase{
desc: "Error returned by function to get the project remote url",
errMsg: "Some error",
expectedErr: "Failed to get current branch: Some error",
expectedErr: "failed to get current branch: Some error",
}
t.Run(tC.desc, func(t *testing.T) {
g := failingBranchManager{
Expand Down
2 changes: 2 additions & 0 deletions lua/gitlab/reviewer/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ M.jump = function(file_name, line_number, new_buffer)
line_number = number_of_lines
end
vim.api.nvim_win_set_cursor(0, { line_number, 0 })
u.open_fold_under_cursor()
vim.cmd("normal! zz")
end

---Get the data from diffview, such as line information and file name. May be used by
Expand Down
6 changes: 6 additions & 0 deletions lua/gitlab/utils/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -752,4 +752,10 @@ M.get_nested_field = function(table, field)
end
end

M.open_fold_under_cursor = function()
if vim.fn.foldclosed(vim.fn.line(".")) > -1 then
vim.cmd("normal! zo")
end
end

return M
4 changes: 2 additions & 2 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ PROJECTNAME=$(shell basename "$(PWD)")

## compile: build golang project
compile:
@cd cmd && go build -o bin && mv bin ../bin
@go build -o bin ./cmd
## test: run golang project tests
test:
@cd cmd/app && go test
@go test -v ./...

.PHONY: help
all: help
Expand Down
Loading