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>
This commit is contained in:
committed by
GitHub
parent
5c9b88db4f
commit
38bde8a0e4
@@ -90,7 +90,7 @@ func (a draftNoteService) listDraftNotes(w http.ResponseWriter, r *http.Request)
|
|||||||
|
|
||||||
type PostDraftNoteRequest struct {
|
type PostDraftNoteRequest struct {
|
||||||
Comment string `json:"comment" validate:"required"`
|
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???
|
PositionData // TODO: How to add validations to data from external package???
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -198,7 +198,7 @@ func TestExtractGitInfo_FailToGetProjectRemoteUrl(t *testing.T) {
|
|||||||
tC := FailTestCase{
|
tC := FailTestCase{
|
||||||
desc: "Error returned by function to get the project remote url",
|
desc: "Error returned by function to get the project remote url",
|
||||||
errMsg: "Some error",
|
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) {
|
t.Run(tC.desc, func(t *testing.T) {
|
||||||
g := failingUrlManager{
|
g := failingUrlManager{
|
||||||
@@ -227,7 +227,7 @@ func TestExtractGitInfo_FailToGetCurrentBranchName(t *testing.T) {
|
|||||||
tC := FailTestCase{
|
tC := FailTestCase{
|
||||||
desc: "Error returned by function to get the project remote url",
|
desc: "Error returned by function to get the project remote url",
|
||||||
errMsg: "Some error",
|
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) {
|
t.Run(tC.desc, func(t *testing.T) {
|
||||||
g := failingBranchManager{
|
g := failingBranchManager{
|
||||||
|
|||||||
@@ -145,6 +145,8 @@ M.jump = function(file_name, line_number, new_buffer)
|
|||||||
line_number = number_of_lines
|
line_number = number_of_lines
|
||||||
end
|
end
|
||||||
vim.api.nvim_win_set_cursor(0, { line_number, 0 })
|
vim.api.nvim_win_set_cursor(0, { line_number, 0 })
|
||||||
|
u.open_fold_under_cursor()
|
||||||
|
vim.cmd("normal! zz")
|
||||||
end
|
end
|
||||||
|
|
||||||
---Get the data from diffview, such as line information and file name. May be used by
|
---Get the data from diffview, such as line information and file name. May be used by
|
||||||
|
|||||||
@@ -752,4 +752,10 @@ M.get_nested_field = function(table, field)
|
|||||||
end
|
end
|
||||||
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
|
return M
|
||||||
|
|||||||
4
makefile
4
makefile
@@ -4,10 +4,10 @@ PROJECTNAME=$(shell basename "$(PWD)")
|
|||||||
|
|
||||||
## compile: build golang project
|
## compile: build golang project
|
||||||
compile:
|
compile:
|
||||||
@cd cmd && go build -o bin && mv bin ../bin
|
@go build -o bin ./cmd
|
||||||
## test: run golang project tests
|
## test: run golang project tests
|
||||||
test:
|
test:
|
||||||
@cd cmd/app && go test
|
@go test -v ./...
|
||||||
|
|
||||||
.PHONY: help
|
.PHONY: help
|
||||||
all: help
|
all: help
|
||||||
|
|||||||
Reference in New Issue
Block a user