Adds Formatting to the CI (#69)
This MR adds linting and formatting to the CI pipeline for the repository for both the Golang and Lua code.
This commit is contained in:
committed by
GitHub
parent
3a67424fec
commit
a055c4c988
119
.editorconfig
119
.editorconfig
@@ -1,119 +0,0 @@
|
|||||||
# see https://github.com/CppCXY/EmmyLuaCodeStyle
|
|
||||||
[*.lua]
|
|
||||||
# [basic]
|
|
||||||
|
|
||||||
# optional space/tab
|
|
||||||
indent_style = space
|
|
||||||
# if indent_style is space, this is valid
|
|
||||||
indent_size = 2
|
|
||||||
# if indent_style is tab, this is valid
|
|
||||||
tab_width = 2
|
|
||||||
# none/single/double
|
|
||||||
quote_style = "double"
|
|
||||||
|
|
||||||
continuation_indent = 2
|
|
||||||
|
|
||||||
#optional keep/never/always/smart
|
|
||||||
trailing_table_separator = keep
|
|
||||||
|
|
||||||
# keep/remove/remove_table_only/remove_string_only
|
|
||||||
call_arg_parentheses = keep
|
|
||||||
|
|
||||||
detect_end_of_line = false
|
|
||||||
|
|
||||||
# this will check text end with new line
|
|
||||||
insert_final_newline = false
|
|
||||||
|
|
||||||
# [space]
|
|
||||||
space_around_table_field_list = true
|
|
||||||
|
|
||||||
space_before_attribute = true
|
|
||||||
|
|
||||||
space_before_function_open_parenthesis = false
|
|
||||||
|
|
||||||
space_before_function_call_open_parenthesis = false
|
|
||||||
|
|
||||||
space_before_closure_open_parenthesis = false
|
|
||||||
|
|
||||||
space_before_function_call_single_arg = true
|
|
||||||
|
|
||||||
space_before_open_square_bracket = false
|
|
||||||
|
|
||||||
space_inside_function_call_parentheses = false
|
|
||||||
|
|
||||||
space_inside_function_param_list_parentheses = false
|
|
||||||
|
|
||||||
space_inside_square_brackets = false
|
|
||||||
|
|
||||||
# like t[#t+1] = 1
|
|
||||||
space_around_table_append_operator = true
|
|
||||||
|
|
||||||
ignore_spaces_inside_function_call = false
|
|
||||||
|
|
||||||
space_before_inline_comment = 1
|
|
||||||
|
|
||||||
# [operator space]
|
|
||||||
space_around_math_operator = true
|
|
||||||
|
|
||||||
space_after_comma = true
|
|
||||||
|
|
||||||
space_after_comma_in_for_statement = true
|
|
||||||
|
|
||||||
space_around_concat_operator = true
|
|
||||||
|
|
||||||
# [align]
|
|
||||||
|
|
||||||
align_call_args = false
|
|
||||||
|
|
||||||
align_function_params = true
|
|
||||||
|
|
||||||
align_continuous_assign_statement = true
|
|
||||||
|
|
||||||
align_continuous_rect_table_field = true
|
|
||||||
|
|
||||||
align_if_branch = true
|
|
||||||
|
|
||||||
align_array_table = true
|
|
||||||
|
|
||||||
# [indent]
|
|
||||||
|
|
||||||
never_indent_before_if_condition = false
|
|
||||||
|
|
||||||
never_indent_comment_on_if_branch = false
|
|
||||||
|
|
||||||
# [line space]
|
|
||||||
|
|
||||||
# The following configuration supports four expressions
|
|
||||||
# keep
|
|
||||||
# fixed(n)
|
|
||||||
# min(n)
|
|
||||||
# max(n)
|
|
||||||
# for eg. min(2)
|
|
||||||
|
|
||||||
line_space_after_if_statement = keep
|
|
||||||
|
|
||||||
line_space_after_do_statement = keep
|
|
||||||
|
|
||||||
line_space_after_while_statement = keep
|
|
||||||
|
|
||||||
line_space_after_repeat_statement = keep
|
|
||||||
|
|
||||||
line_space_after_for_statement = keep
|
|
||||||
|
|
||||||
line_space_after_local_or_assign_statement = keep
|
|
||||||
|
|
||||||
line_space_after_function_statement = fixed(2)
|
|
||||||
|
|
||||||
line_space_after_expression_statement = keep
|
|
||||||
|
|
||||||
line_space_after_comment = keep
|
|
||||||
|
|
||||||
# [line break]
|
|
||||||
break_all_list_when_line_exceed = false
|
|
||||||
|
|
||||||
auto_collapse_lines = false
|
|
||||||
|
|
||||||
# [preference]
|
|
||||||
ignore_space_after_colon = true
|
|
||||||
|
|
||||||
remove_call_expression_list_finish_comma = false
|
|
||||||
39
.github/workflows/lint-and-format.yaml
vendored
Normal file
39
.github/workflows/lint-and-format.yaml
vendored
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
name: Linting and Formatting
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
jobs:
|
||||||
|
luacheck:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Luacheck linter
|
||||||
|
uses: lunarmodules/luacheck@v1
|
||||||
|
with:
|
||||||
|
args: --globals vim --no-max-line-length -- .
|
||||||
|
stylua:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Action
|
||||||
|
uses: JohnnyMorganz/stylua-action@v3
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
version: latest
|
||||||
|
args: --check .
|
||||||
|
golangci:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: actions/setup-go@v4
|
||||||
|
with:
|
||||||
|
go-version: '1.19'
|
||||||
|
cache: false
|
||||||
|
- name: golangci-lint
|
||||||
|
uses: golangci/golangci-lint-action@v3
|
||||||
|
with:
|
||||||
|
version: v1.54
|
||||||
|
only-new-issues: true
|
||||||
@@ -30,5 +30,8 @@ func ApproveHandler(w http.ResponseWriter, r *http.Request) {
|
|||||||
Status: http.StatusOK,
|
Status: http.StatusOK,
|
||||||
}
|
}
|
||||||
|
|
||||||
json.NewEncoder(w).Encode(response)
|
err = json.NewEncoder(w).Encode(response)
|
||||||
|
if err != nil {
|
||||||
|
c.handleError(w, err, "Could not encode response", http.StatusInternalServerError)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,6 +65,8 @@ func AssigneesHandler(w http.ResponseWriter, r *http.Request) {
|
|||||||
Assignees: mr.Assignees,
|
Assignees: mr.Assignees,
|
||||||
}
|
}
|
||||||
|
|
||||||
json.NewEncoder(w).Encode(response)
|
err = json.NewEncoder(w).Encode(response)
|
||||||
|
if err != nil {
|
||||||
|
c.handleError(w, err, "Could not encode response", http.StatusInternalServerError)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ func AttachmentHandler(w http.ResponseWriter, r *http.Request) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
fileResponse := AttachmentResponse{
|
response := AttachmentResponse{
|
||||||
SuccessResponse: SuccessResponse{
|
SuccessResponse: SuccessResponse{
|
||||||
Status: http.StatusOK,
|
Status: http.StatusOK,
|
||||||
Message: "File uploaded successfully",
|
Message: "File uploaded successfully",
|
||||||
@@ -67,5 +67,8 @@ func AttachmentHandler(w http.ResponseWriter, r *http.Request) {
|
|||||||
Url: projectFile.URL,
|
Url: projectFile.URL,
|
||||||
}
|
}
|
||||||
|
|
||||||
json.NewEncoder(w).Encode(fileResponse)
|
err = json.NewEncoder(w).Encode(response)
|
||||||
|
if err != nil {
|
||||||
|
c.handleError(w, err, "Could not encode response", http.StatusInternalServerError)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,13 +14,11 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type Client struct {
|
type Client struct {
|
||||||
command string
|
|
||||||
projectId string
|
projectId string
|
||||||
mergeId int
|
mergeId int
|
||||||
gitlabInstance string
|
gitlabInstance string
|
||||||
authToken string
|
authToken string
|
||||||
logPath string
|
logPath string
|
||||||
debug bool
|
|
||||||
git *gitlab.Client
|
git *gitlab.Client
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -41,11 +39,14 @@ var requestLogger retryablehttp.RequestLogHook = func(l retryablehttp.Logger, r
|
|||||||
token := r.Header.Get("Private-Token")
|
token := r.Header.Get("Private-Token")
|
||||||
r.Header.Set("Private-Token", "REDACTED")
|
r.Header.Set("Private-Token", "REDACTED")
|
||||||
res, err := httputil.DumpRequest(r, true)
|
res, err := httputil.DumpRequest(r, true)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
r.Header.Set("Private-Token", token)
|
r.Header.Set("Private-Token", token)
|
||||||
|
|
||||||
_, err = file.Write([]byte("\n-- REQUEST --\n"))
|
_, err = file.Write([]byte("\n-- REQUEST --\n")) //nolint:all
|
||||||
_, err = file.Write(res)
|
_, err = file.Write(res) //nolint:all
|
||||||
_, err = file.Write([]byte("\n"))
|
_, err = file.Write([]byte("\n")) //nolint:all
|
||||||
}
|
}
|
||||||
|
|
||||||
var responseLogger retryablehttp.ResponseLogHook = func(l retryablehttp.Logger, response *http.Response) {
|
var responseLogger retryablehttp.ResponseLogHook = func(l retryablehttp.Logger, response *http.Response) {
|
||||||
@@ -58,10 +59,13 @@ var responseLogger retryablehttp.ResponseLogHook = func(l retryablehttp.Logger,
|
|||||||
defer file.Close()
|
defer file.Close()
|
||||||
|
|
||||||
res, err := httputil.DumpResponse(response, true)
|
res, err := httputil.DumpResponse(response, true)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
_, err = file.Write([]byte("\n-- RESPONSE --\n"))
|
_, err = file.Write([]byte("\n-- RESPONSE --\n")) //nolint:all
|
||||||
_, err = file.Write(res)
|
_, err = file.Write(res) //nolint:all
|
||||||
_, err = file.Write([]byte("\n"))
|
_, err = file.Write([]byte("\n")) //nolint:all
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This will initialize the client with the token and check for the basic project ID and command arguments */
|
/* This will initialize the client with the token and check for the basic project ID and command arguments */
|
||||||
@@ -155,5 +159,9 @@ func (c *Client) handleError(w http.ResponseWriter, err error, message string, s
|
|||||||
Details: err.Error(),
|
Details: err.Error(),
|
||||||
Status: status,
|
Status: status,
|
||||||
}
|
}
|
||||||
json.NewEncoder(w).Encode(response)
|
|
||||||
|
err = json.NewEncoder(w).Encode(response)
|
||||||
|
if err != nil {
|
||||||
|
c.handleError(w, err, "Could not encode response", http.StatusInternalServerError)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,8 +11,6 @@ import (
|
|||||||
"github.com/xanzy/go-gitlab"
|
"github.com/xanzy/go-gitlab"
|
||||||
)
|
)
|
||||||
|
|
||||||
const mrVersionsUrl = "%s/api/v4/projects/%s/merge_requests/%d/versions"
|
|
||||||
|
|
||||||
type PostCommentRequest struct {
|
type PostCommentRequest struct {
|
||||||
Comment string `json:"comment"`
|
Comment string `json:"comment"`
|
||||||
FileName string `json:"file_name"`
|
FileName string `json:"file_name"`
|
||||||
@@ -103,7 +101,10 @@ func DeleteComment(w http.ResponseWriter, r *http.Request) {
|
|||||||
Status: http.StatusOK,
|
Status: http.StatusOK,
|
||||||
}
|
}
|
||||||
|
|
||||||
json.NewEncoder(w).Encode(response)
|
err = json.NewEncoder(w).Encode(response)
|
||||||
|
if err != nil {
|
||||||
|
c.handleError(w, err, "Could not encode response", http.StatusInternalServerError)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func PostComment(w http.ResponseWriter, r *http.Request) {
|
func PostComment(w http.ResponseWriter, r *http.Request) {
|
||||||
@@ -186,7 +187,10 @@ func PostComment(w http.ResponseWriter, r *http.Request) {
|
|||||||
Discussion: discussion,
|
Discussion: discussion,
|
||||||
}
|
}
|
||||||
|
|
||||||
json.NewEncoder(w).Encode(response)
|
err = json.NewEncoder(w).Encode(response)
|
||||||
|
if err != nil {
|
||||||
|
c.handleError(w, err, "Could not encode response", http.StatusInternalServerError)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func EditComment(w http.ResponseWriter, r *http.Request) {
|
func EditComment(w http.ResponseWriter, r *http.Request) {
|
||||||
@@ -241,5 +245,8 @@ func EditComment(w http.ResponseWriter, r *http.Request) {
|
|||||||
Comment: note,
|
Comment: note,
|
||||||
}
|
}
|
||||||
|
|
||||||
json.NewEncoder(w).Encode(response)
|
err = json.NewEncoder(w).Encode(response)
|
||||||
|
if err != nil {
|
||||||
|
c.handleError(w, err, "Could not encode response", http.StatusInternalServerError)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,6 +68,9 @@ func SummaryHandler(w http.ResponseWriter, r *http.Request) {
|
|||||||
MergeRequest: mr,
|
MergeRequest: mr,
|
||||||
}
|
}
|
||||||
|
|
||||||
json.NewEncoder(w).Encode(response)
|
err = json.NewEncoder(w).Encode(response)
|
||||||
|
if err != nil {
|
||||||
|
c.handleError(w, err, "Could not encode response", http.StatusInternalServerError)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ func (c *Client) Info() ([]byte, error) {
|
|||||||
defer res.Body.Close()
|
defer res.Body.Close()
|
||||||
|
|
||||||
if res.StatusCode < 200 || res.StatusCode >= 300 {
|
if res.StatusCode < 200 || res.StatusCode >= 300 {
|
||||||
return nil, errors.New(fmt.Sprintf("Recieved non-200 response: %d", res.StatusCode))
|
return nil, fmt.Errorf("Recieved non-200 response: %d", res.StatusCode)
|
||||||
}
|
}
|
||||||
|
|
||||||
body, err := io.ReadAll(res.Body)
|
body, err := io.ReadAll(res.Body)
|
||||||
@@ -83,5 +83,8 @@ func InfoHandler(w http.ResponseWriter, r *http.Request) {
|
|||||||
Info: mergeRequest,
|
Info: mergeRequest,
|
||||||
}
|
}
|
||||||
|
|
||||||
json.NewEncoder(w).Encode(response)
|
err = json.NewEncoder(w).Encode(response)
|
||||||
|
if err != nil {
|
||||||
|
c.handleError(w, err, "Could not encode response", http.StatusInternalServerError)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,6 +40,9 @@ func JobHandler(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
reader, _, err := c.git.Jobs.GetTraceFile(c.projectId, jobTraceRequest.JobId)
|
reader, _, err := c.git.Jobs.GetTraceFile(c.projectId, jobTraceRequest.JobId)
|
||||||
|
if err != nil {
|
||||||
|
c.handleError(w, err, "Could not get trace file for job", http.StatusBadRequest)
|
||||||
|
}
|
||||||
|
|
||||||
file, err := io.ReadAll(reader)
|
file, err := io.ReadAll(reader)
|
||||||
|
|
||||||
@@ -55,5 +58,8 @@ func JobHandler(w http.ResponseWriter, r *http.Request) {
|
|||||||
File: string(file),
|
File: string(file),
|
||||||
}
|
}
|
||||||
|
|
||||||
json.NewEncoder(w).Encode(response)
|
err = json.NewEncoder(w).Encode(response)
|
||||||
|
if err != nil {
|
||||||
|
c.handleError(w, err, "Could not encode response", http.StatusInternalServerError)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ func (c *Client) ListDiscussions(blacklist []string) ([]*gitlab.Discussion, []*g
|
|||||||
if note.Type == gitlab.NoteTypeValue("DiffNote") {
|
if note.Type == gitlab.NoteTypeValue("DiffNote") {
|
||||||
linkedDiscussions = append(linkedDiscussions, discussion)
|
linkedDiscussions = append(linkedDiscussions, discussion)
|
||||||
break
|
break
|
||||||
} else if note.System == false && note.Position == nil {
|
} else if !note.System && note.Position == nil {
|
||||||
unlinkedDiscussions = append(unlinkedDiscussions, discussion)
|
unlinkedDiscussions = append(unlinkedDiscussions, discussion)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@@ -118,5 +118,8 @@ func ListDiscussionsHandler(w http.ResponseWriter, r *http.Request) {
|
|||||||
UnlinkedDiscussions: unlinkedDiscussions,
|
UnlinkedDiscussions: unlinkedDiscussions,
|
||||||
}
|
}
|
||||||
|
|
||||||
json.NewEncoder(w).Encode(response)
|
err = json.NewEncoder(w).Encode(response)
|
||||||
|
if err != nil {
|
||||||
|
c.handleError(w, err, "Could not encode response", http.StatusInternalServerError)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -88,9 +88,12 @@ func main() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type ClientString string
|
||||||
|
|
||||||
func withGitlabContext(next http.HandlerFunc, c Client) http.Handler {
|
func withGitlabContext(next http.HandlerFunc, c Client) http.Handler {
|
||||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||||
ctx := context.WithValue(context.Background(), "client", c)
|
var cl ClientString = "client"
|
||||||
|
ctx := context.WithValue(context.Background(), cl, c)
|
||||||
next.ServeHTTP(w, r.WithContext(ctx))
|
next.ServeHTTP(w, r.WithContext(ctx))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,7 +37,8 @@ func ProjectMembersHandler(w http.ResponseWriter, r *http.Request) {
|
|||||||
ProjectMembers: projectMembers,
|
ProjectMembers: projectMembers,
|
||||||
}
|
}
|
||||||
|
|
||||||
json.NewEncoder(w).Encode(response)
|
err = json.NewEncoder(w).Encode(response)
|
||||||
|
if err != nil {
|
||||||
return
|
c.handleError(w, err, "Could not encode response", http.StatusInternalServerError)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,7 +67,10 @@ func GetJobs(w http.ResponseWriter, r *http.Request) {
|
|||||||
Jobs: jobs,
|
Jobs: jobs,
|
||||||
}
|
}
|
||||||
|
|
||||||
json.NewEncoder(w).Encode(response)
|
err = json.NewEncoder(w).Encode(response)
|
||||||
|
if err != nil {
|
||||||
|
c.handleError(w, err, "Could not encode response", http.StatusInternalServerError)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -104,6 +107,8 @@ func RetriggerPipeline(w http.ResponseWriter, r *http.Request) {
|
|||||||
Pipeline: pipeline,
|
Pipeline: pipeline,
|
||||||
}
|
}
|
||||||
|
|
||||||
json.NewEncoder(w).Encode(response)
|
err = json.NewEncoder(w).Encode(response)
|
||||||
|
if err != nil {
|
||||||
|
c.handleError(w, err, "Could not encode response", http.StatusInternalServerError)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,5 +79,8 @@ func ReplyHandler(w http.ResponseWriter, r *http.Request) {
|
|||||||
Note: note,
|
Note: note,
|
||||||
}
|
}
|
||||||
|
|
||||||
json.NewEncoder(w).Encode(response)
|
err = json.NewEncoder(w).Encode(response)
|
||||||
|
if err != nil {
|
||||||
|
c.handleError(w, err, "Could not encode response", http.StatusInternalServerError)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,6 +65,8 @@ func ReviewersHandler(w http.ResponseWriter, r *http.Request) {
|
|||||||
Reviewers: mr.Reviewers,
|
Reviewers: mr.Reviewers,
|
||||||
}
|
}
|
||||||
|
|
||||||
json.NewEncoder(w).Encode(response)
|
err = json.NewEncoder(w).Encode(response)
|
||||||
|
if err != nil {
|
||||||
|
c.handleError(w, err, "Could not encode response", http.StatusInternalServerError)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,6 +38,9 @@ func RevisionsHandler(w http.ResponseWriter, r *http.Request) {
|
|||||||
Revisions: versionInfo,
|
Revisions: versionInfo,
|
||||||
}
|
}
|
||||||
|
|
||||||
json.NewEncoder(w).Encode(response)
|
err = json.NewEncoder(w).Encode(response)
|
||||||
|
if err != nil {
|
||||||
|
c.handleError(w, err, "Could not encode response", http.StatusInternalServerError)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,5 +31,8 @@ func RevokeHandler(w http.ResponseWriter, r *http.Request) {
|
|||||||
Status: http.StatusOK,
|
Status: http.StatusOK,
|
||||||
}
|
}
|
||||||
|
|
||||||
json.NewEncoder(w).Encode(response)
|
err = json.NewEncoder(w).Encode(response)
|
||||||
|
if err != nil {
|
||||||
|
c.handleError(w, err, "Could not encode response", http.StatusInternalServerError)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,33 +6,35 @@ local state = require("gitlab.state")
|
|||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
M.add_assignee = function()
|
M.add_assignee = function()
|
||||||
M.add_popup('assignee')
|
M.add_popup("assignee")
|
||||||
end
|
end
|
||||||
|
|
||||||
M.delete_assignee = function()
|
M.delete_assignee = function()
|
||||||
M.delete_popup('assignee')
|
M.delete_popup("assignee")
|
||||||
end
|
end
|
||||||
|
|
||||||
M.add_reviewer = function()
|
M.add_reviewer = function()
|
||||||
M.add_popup('reviewer')
|
M.add_popup("reviewer")
|
||||||
end
|
end
|
||||||
|
|
||||||
M.delete_reviewer = function()
|
M.delete_reviewer = function()
|
||||||
M.delete_popup('reviewer')
|
M.delete_popup("reviewer")
|
||||||
end
|
end
|
||||||
|
|
||||||
M.add_popup = function(type)
|
M.add_popup = function(type)
|
||||||
local plural = type .. 's'
|
local plural = type .. "s"
|
||||||
local current = state.INFO[plural]
|
local current = state.INFO[plural]
|
||||||
local eligible = M.filter_eligible(state.PROJECT_MEMBERS, current)
|
local eligible = M.filter_eligible(state.PROJECT_MEMBERS, current)
|
||||||
vim.ui.select(eligible, {
|
vim.ui.select(eligible, {
|
||||||
prompt = 'Choose ' .. type .. ' to add',
|
prompt = "Choose " .. type .. " to add",
|
||||||
format_item = function(user)
|
format_item = function(user)
|
||||||
return user.username .. " (" .. user.name .. ")"
|
return user.username .. " (" .. user.name .. ")"
|
||||||
end
|
end,
|
||||||
}, function(choice)
|
}, function(choice)
|
||||||
if not choice then return end
|
if not choice then
|
||||||
local current_ids = u.extract(current, 'id')
|
return
|
||||||
|
end
|
||||||
|
local current_ids = u.extract(current, "id")
|
||||||
table.insert(current_ids, choice.id)
|
table.insert(current_ids, choice.id)
|
||||||
local body = { ids = current_ids }
|
local body = { ids = current_ids }
|
||||||
job.run_job("/mr/" .. type, "PUT", body, function(data)
|
job.run_job("/mr/" .. type, "PUT", body, function(data)
|
||||||
@@ -43,16 +45,18 @@ M.add_popup = function(type)
|
|||||||
end
|
end
|
||||||
|
|
||||||
M.delete_popup = function(type)
|
M.delete_popup = function(type)
|
||||||
local plural = type .. 's'
|
local plural = type .. "s"
|
||||||
local current = state.INFO[plural]
|
local current = state.INFO[plural]
|
||||||
vim.ui.select(current, {
|
vim.ui.select(current, {
|
||||||
prompt = 'Choose ' .. type .. ' to delete',
|
prompt = "Choose " .. type .. " to delete",
|
||||||
format_item = function(user)
|
format_item = function(user)
|
||||||
return user.username .. " (" .. user.name .. ")"
|
return user.username .. " (" .. user.name .. ")"
|
||||||
end
|
end,
|
||||||
}, function(choice)
|
}, function(choice)
|
||||||
if not choice then return end
|
if not choice then
|
||||||
local ids = u.extract(M.filter_eligible(current, { choice }), 'id')
|
return
|
||||||
|
end
|
||||||
|
local ids = u.extract(M.filter_eligible(current, { choice }), "id")
|
||||||
local body = { ids = ids }
|
local body = { ids = ids }
|
||||||
job.run_job("/mr/" .. type, "PUT", body, function(data)
|
job.run_job("/mr/" .. type, "PUT", body, function(data)
|
||||||
vim.notify(data.message, vim.log.levels.INFO)
|
vim.notify(data.message, vim.log.levels.INFO)
|
||||||
@@ -62,10 +66,12 @@ M.delete_popup = function(type)
|
|||||||
end
|
end
|
||||||
|
|
||||||
M.filter_eligible = function(current, to_remove)
|
M.filter_eligible = function(current, to_remove)
|
||||||
local ids = u.extract(to_remove, 'id')
|
local ids = u.extract(to_remove, "id")
|
||||||
local res = {}
|
local res = {}
|
||||||
for _, member in ipairs(current) do
|
for _, member in ipairs(current) do
|
||||||
if not u.contains(ids, member.id) then table.insert(res, member) end
|
if not u.contains(ids, member.id) then
|
||||||
|
table.insert(res, member)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
return res
|
return res
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -55,13 +55,17 @@ M.toggle = function()
|
|||||||
M.discussions = data.discussions
|
M.discussions = data.discussions
|
||||||
M.unlinked_discussions = data.unlinked_discussions
|
M.unlinked_discussions = data.unlinked_discussions
|
||||||
|
|
||||||
if type(data.discussions) == "table" then M.rebuild_discussion_tree() end
|
if type(data.discussions) == "table" then
|
||||||
if type(data.unlinked_discussions) == "table" then M.rebuild_unlinked_discussion_tree() end
|
M.rebuild_discussion_tree()
|
||||||
|
end
|
||||||
|
if type(data.unlinked_discussions) == "table" then
|
||||||
|
M.rebuild_unlinked_discussion_tree()
|
||||||
|
end
|
||||||
|
|
||||||
M.switch_can_edit_bufs(true)
|
M.switch_can_edit_bufs(true)
|
||||||
M.add_empty_titles({
|
M.add_empty_titles({
|
||||||
{ linked_section.bufnr, data.discussions, "No Discussions for this MR" },
|
{ linked_section.bufnr, data.discussions, "No Discussions for this MR" },
|
||||||
{ unlinked_section.bufnr, data.unlinked_discussions, "No Notes (Unlinked Discussions) for this MR" }
|
{ unlinked_section.bufnr, data.unlinked_discussions, "No Notes (Unlinked Discussions) for this MR" },
|
||||||
})
|
})
|
||||||
M.switch_can_edit_bufs(false)
|
M.switch_can_edit_bufs(false)
|
||||||
end)
|
end)
|
||||||
@@ -118,7 +122,7 @@ M.delete_comment = function(tree, unlinked)
|
|||||||
},
|
},
|
||||||
on_submit = function(item)
|
on_submit = function(item)
|
||||||
M.send_deletion(tree, item, unlinked)
|
M.send_deletion(tree, item, unlinked)
|
||||||
end
|
end,
|
||||||
})
|
})
|
||||||
menu:mount()
|
menu:mount()
|
||||||
end
|
end
|
||||||
@@ -152,7 +156,7 @@ M.send_deletion = function(tree, item, unlinked)
|
|||||||
M.switch_can_edit_bufs(true)
|
M.switch_can_edit_bufs(true)
|
||||||
M.add_empty_titles({
|
M.add_empty_titles({
|
||||||
{ M.linked_section_bufnr, M.discussions, "No Discussions for this MR" },
|
{ M.linked_section_bufnr, M.discussions, "No Discussions for this MR" },
|
||||||
{ M.unlinked_section_bufnr, M.unlinked_discussions, "No Notes (Unlinked Discussions) for this MR" }
|
{ M.unlinked_section_bufnr, M.unlinked_discussions, "No Notes (Unlinked Discussions) for this MR" },
|
||||||
})
|
})
|
||||||
M.switch_can_edit_bufs(false)
|
M.switch_can_edit_bufs(false)
|
||||||
end)
|
end)
|
||||||
@@ -171,7 +175,7 @@ M.edit_comment = function(tree, unlinked)
|
|||||||
local children_ids = note_node:get_child_ids()
|
local children_ids = note_node:get_child_ids()
|
||||||
for _, child_id in ipairs(children_ids) do
|
for _, child_id in ipairs(children_ids) do
|
||||||
local child_node = tree:get_node(child_id)
|
local child_node = tree:get_node(child_id)
|
||||||
if (not child_node:has_children()) then
|
if not child_node:has_children() then
|
||||||
local line = tree:get_node(child_id).text
|
local line = tree:get_node(child_id).text
|
||||||
table.insert(lines, line)
|
table.insert(lines, line)
|
||||||
end
|
end
|
||||||
@@ -179,17 +183,19 @@ M.edit_comment = function(tree, unlinked)
|
|||||||
|
|
||||||
local currentBuffer = vim.api.nvim_get_current_buf()
|
local currentBuffer = vim.api.nvim_get_current_buf()
|
||||||
vim.api.nvim_buf_set_lines(currentBuffer, 0, -1, false, lines)
|
vim.api.nvim_buf_set_lines(currentBuffer, 0, -1, false, lines)
|
||||||
state.set_popup_keymaps(edit_popup,
|
state.set_popup_keymaps(
|
||||||
M.send_edits(tree, tostring(root_node.id), note_node.root_note_id or note_node.id, unlinked))
|
edit_popup,
|
||||||
|
M.send_edits(tostring(root_node.id), note_node.root_note_id or note_node.id, unlinked)
|
||||||
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- This function sends the edited comment to the Go server
|
-- This function sends the edited comment to the Go server
|
||||||
M.send_edits = function(tree, discussion_id, note_id, unlinked)
|
M.send_edits = function(discussion_id, note_id, unlinked)
|
||||||
return function(text)
|
return function(text)
|
||||||
local body = {
|
local body = {
|
||||||
discussion_id = discussion_id,
|
discussion_id = discussion_id,
|
||||||
note_id = note_id,
|
note_id = note_id,
|
||||||
comment = text
|
comment = text,
|
||||||
}
|
}
|
||||||
job.run_job("/comment", "PATCH", body, function(data)
|
job.run_job("/comment", "PATCH", body, function(data)
|
||||||
vim.notify(data.message, vim.log.levels.INFO)
|
vim.notify(data.message, vim.log.levels.INFO)
|
||||||
@@ -207,7 +213,9 @@ end
|
|||||||
-- This comment (settings.discussion_tree.toggle_resolved) will toggle the resolved status of the current discussion and send the change to the Go server
|
-- This comment (settings.discussion_tree.toggle_resolved) will toggle the resolved status of the current discussion and send the change to the Go server
|
||||||
M.toggle_resolved = function(tree)
|
M.toggle_resolved = function(tree)
|
||||||
local note = tree:get_node()
|
local note = tree:get_node()
|
||||||
if not note or not note.resolvable then return end
|
if not note or not note.resolvable then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
local body = {
|
local body = {
|
||||||
discussion_id = note.id,
|
discussion_id = note.id,
|
||||||
@@ -245,9 +253,13 @@ end
|
|||||||
-- This function (settings.discussion_tree.toggle_node) expands/collapses the current node and its children
|
-- This function (settings.discussion_tree.toggle_node) expands/collapses the current node and its children
|
||||||
M.toggle_node = function(tree)
|
M.toggle_node = function(tree)
|
||||||
local node = tree:get_node()
|
local node = tree:get_node()
|
||||||
if node == nil then return end
|
if node == nil then
|
||||||
|
return
|
||||||
|
end
|
||||||
local children = node:get_child_ids()
|
local children = node:get_child_ids()
|
||||||
if node == nil then return end
|
if node == nil then
|
||||||
|
return
|
||||||
|
end
|
||||||
if node:is_expanded() then
|
if node:is_expanded() then
|
||||||
node:collapse()
|
node:collapse()
|
||||||
for _, child in ipairs(children) do
|
for _, child in ipairs(children) do
|
||||||
@@ -263,7 +275,6 @@ M.toggle_node = function(tree)
|
|||||||
tree:render()
|
tree:render()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--
|
--
|
||||||
-- 🌲 Helper Functions
|
-- 🌲 Helper Functions
|
||||||
--
|
--
|
||||||
@@ -298,7 +309,9 @@ end
|
|||||||
M.add_discussion = function(arg)
|
M.add_discussion = function(arg)
|
||||||
local discussion = arg.data.discussion
|
local discussion = arg.data.discussion
|
||||||
if arg.unlinked then
|
if arg.unlinked then
|
||||||
if type(M.unlinked_discussions) ~= "table" then M.unlinked_discussions = {} end
|
if type(M.unlinked_discussions) ~= "table" then
|
||||||
|
M.unlinked_discussions = {}
|
||||||
|
end
|
||||||
table.insert(M.unlinked_discussions, 1, discussion)
|
table.insert(M.unlinked_discussions, 1, discussion)
|
||||||
local bufinfo = vim.fn.getbufinfo(M.unlinked_section_bufnr)
|
local bufinfo = vim.fn.getbufinfo(M.unlinked_section_bufnr)
|
||||||
if u.table_size(bufinfo) ~= 0 then
|
if u.table_size(bufinfo) ~= 0 then
|
||||||
@@ -306,7 +319,9 @@ M.add_discussion = function(arg)
|
|||||||
end
|
end
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if type(M.discussions) ~= "table" then M.discussions = {} end
|
if type(M.discussions) ~= "table" then
|
||||||
|
M.discussions = {}
|
||||||
|
end
|
||||||
table.insert(M.discussions, 1, discussion)
|
table.insert(M.discussions, 1, discussion)
|
||||||
local bufinfo = vim.fn.getbufinfo(M.unlinked_section_bufnr)
|
local bufinfo = vim.fn.getbufinfo(M.unlinked_section_bufnr)
|
||||||
if u.table_size(bufinfo) ~= 0 then
|
if u.table_size(bufinfo) ~= 0 then
|
||||||
@@ -331,9 +346,7 @@ M.create_layout = function()
|
|||||||
Layout.Box({
|
Layout.Box({
|
||||||
Layout.Box(linked_section, { size = "50%" }),
|
Layout.Box(linked_section, { size = "50%" }),
|
||||||
Layout.Box(unlinked_section, { size = "50%" }),
|
Layout.Box(unlinked_section, { size = "50%" }),
|
||||||
},
|
}, { dir = (position == "left" and "col" or "row") })
|
||||||
{ dir = (position == "left" and "col" or "row") }
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
return linked_section, unlinked_section, layout
|
return linked_section, unlinked_section, layout
|
||||||
@@ -347,75 +360,69 @@ M.add_empty_titles = function(args)
|
|||||||
if type(data) ~= "table" or #data == 0 then
|
if type(data) ~= "table" or #data == 0 then
|
||||||
vim.api.nvim_buf_set_lines(bufnr, 0, 1, false, { title })
|
vim.api.nvim_buf_set_lines(bufnr, 0, 1, false, { title })
|
||||||
local linnr = 1
|
local linnr = 1
|
||||||
vim.api.nvim_buf_set_extmark(bufnr, ns_id, linnr - 1, 0,
|
vim.api.nvim_buf_set_extmark(
|
||||||
{ end_row = linnr - 1, end_col = string.len(title), hl_group = 'TitleHighlight' })
|
bufnr,
|
||||||
|
ns_id,
|
||||||
|
linnr - 1,
|
||||||
|
0,
|
||||||
|
{ end_row = linnr - 1, end_col = string.len(title), hl_group = "TitleHighlight" }
|
||||||
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
M.set_tree_keymaps = function(tree, bufnr, unlinked)
|
M.set_tree_keymaps = function(tree, bufnr, unlinked)
|
||||||
vim.keymap.set('n',
|
vim.keymap.set("n", state.settings.discussion_tree.edit_comment, function()
|
||||||
state.settings.discussion_tree.edit_comment,
|
M.edit_comment(tree, unlinked)
|
||||||
function() M.edit_comment(tree, unlinked) end,
|
end, { buffer = bufnr })
|
||||||
{ buffer = bufnr }
|
vim.keymap.set("n", state.settings.discussion_tree.delete_comment, function()
|
||||||
)
|
M.delete_comment(tree, unlinked)
|
||||||
vim.keymap.set('n',
|
end, { buffer = bufnr })
|
||||||
state.settings.discussion_tree.delete_comment,
|
vim.keymap.set("n", state.settings.discussion_tree.toggle_resolved, function()
|
||||||
function() M.delete_comment(tree, unlinked) end,
|
M.toggle_resolved(tree)
|
||||||
{ buffer = bufnr }
|
end, { buffer = bufnr })
|
||||||
)
|
vim.keymap.set("n", state.settings.discussion_tree.toggle_node, function()
|
||||||
vim.keymap.set('n',
|
M.toggle_node(tree, unlinked)
|
||||||
state.settings.discussion_tree.toggle_resolved,
|
end, { buffer = bufnr })
|
||||||
function() M.toggle_resolved(tree) end,
|
vim.keymap.set("n", state.settings.discussion_tree.reply, function()
|
||||||
{ buffer = bufnr }
|
M.reply(tree)
|
||||||
)
|
end, { buffer = bufnr })
|
||||||
vim.keymap.set('n',
|
|
||||||
state.settings.discussion_tree.toggle_node,
|
|
||||||
function() M.toggle_node(tree, unlinked) end,
|
|
||||||
{ buffer = bufnr }
|
|
||||||
)
|
|
||||||
vim.keymap.set('n',
|
|
||||||
state.settings.discussion_tree.reply,
|
|
||||||
function() M.reply(tree) end,
|
|
||||||
{ buffer = bufnr }
|
|
||||||
)
|
|
||||||
|
|
||||||
if not unlinked then
|
if not unlinked then
|
||||||
vim.keymap.set('n', state.settings.discussion_tree.jump_to_file, function()
|
vim.keymap.set("n", state.settings.discussion_tree.jump_to_file, function()
|
||||||
M.jump_to_file(tree)
|
M.jump_to_file(tree)
|
||||||
end, { buffer = bufnr }
|
end, { buffer = bufnr })
|
||||||
)
|
vim.keymap.set("n", state.settings.discussion_tree.jump_to_reviewer, function()
|
||||||
vim.keymap.set('n', state.settings.discussion_tree.jump_to_reviewer,
|
M.jump_to_reviewer(tree)
|
||||||
function() M.jump_to_reviewer(tree) end,
|
end, { buffer = bufnr })
|
||||||
{ buffer = bufnr }
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
M.redraw_resolved_status = function(tree, note, mark_resolved)
|
M.redraw_resolved_status = function(tree, note, mark_resolved)
|
||||||
local current_text = tree.nodes.by_id["-" .. note.id].text
|
local current_text = tree.nodes.by_id["-" .. note.id].text
|
||||||
local target = mark_resolved and 'resolved' or 'unresolved'
|
local target = mark_resolved and "resolved" or "unresolved"
|
||||||
local current = mark_resolved and 'unresolved' or 'resolved'
|
local current = mark_resolved and "unresolved" or "resolved"
|
||||||
|
|
||||||
local function set_property(key, val)
|
local function set_property(key, val)
|
||||||
tree.nodes.by_id["-" .. note.id][key] = val
|
tree.nodes.by_id["-" .. note.id][key] = val
|
||||||
end
|
end
|
||||||
|
|
||||||
local has_symbol = function(s)
|
local has_symbol = function(s)
|
||||||
return state.settings.discussion_tree[s] ~= nil and state.settings.discussion_tree[s] ~= ''
|
return state.settings.discussion_tree[s] ~= nil and state.settings.discussion_tree[s] ~= ""
|
||||||
end
|
end
|
||||||
|
|
||||||
set_property('resolved', mark_resolved)
|
set_property("resolved", mark_resolved)
|
||||||
|
|
||||||
if not has_symbol(current) and not has_symbol(target) then return end
|
if not has_symbol(current) and not has_symbol(target) then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
if not has_symbol(current) and has_symbol(target) then
|
if not has_symbol(current) and has_symbol(target) then
|
||||||
set_property('text', (current_text .. " " .. state.settings.discussion_tree[target]))
|
set_property("text", (current_text .. " " .. state.settings.discussion_tree[target]))
|
||||||
elseif has_symbol(current) and not has_symbol(target) then
|
elseif has_symbol(current) and not has_symbol(target) then
|
||||||
set_property('text', u.remove_last_chunk(current_text))
|
set_property("text", u.remove_last_chunk(current_text))
|
||||||
else
|
else
|
||||||
set_property('text', (u.remove_last_chunk(current_text) .. " " .. state.settings.discussion_tree[target]))
|
set_property("text", (u.remove_last_chunk(current_text) .. " " .. state.settings.discussion_tree[target]))
|
||||||
end
|
end
|
||||||
|
|
||||||
tree:render()
|
tree:render()
|
||||||
@@ -435,7 +442,7 @@ M.replace_text = function(data, discussion_id, note_id, text)
|
|||||||
end
|
end
|
||||||
|
|
||||||
M.get_root_node = function(tree, node)
|
M.get_root_node = function(tree, node)
|
||||||
if (not node.is_root) then
|
if not node.is_root then
|
||||||
local parent_id = node:get_parent_id()
|
local parent_id = node:get_parent_id()
|
||||||
return M.get_root_node(tree, tree:get_node(parent_id))
|
return M.get_root_node(tree, tree:get_node(parent_id))
|
||||||
else
|
else
|
||||||
@@ -444,9 +451,11 @@ M.get_root_node = function(tree, node)
|
|||||||
end
|
end
|
||||||
|
|
||||||
M.get_note_node = function(tree, node)
|
M.get_note_node = function(tree, node)
|
||||||
if (not node.is_note) then
|
if not node.is_note then
|
||||||
local parent_id = node:get_parent_id()
|
local parent_id = node:get_parent_id()
|
||||||
if parent_id == nil then return node end
|
if parent_id == nil then
|
||||||
|
return node
|
||||||
|
end
|
||||||
return M.get_note_node(tree, tree:get_node(parent_id))
|
return M.get_note_node(tree, tree:get_node(parent_id))
|
||||||
else
|
else
|
||||||
return node
|
return node
|
||||||
@@ -461,19 +470,22 @@ M.build_note_body = function(note, resolve_info)
|
|||||||
local text_nodes = {}
|
local text_nodes = {}
|
||||||
for bodyLine in note.body:gmatch("[^\n]+") do
|
for bodyLine in note.body:gmatch("[^\n]+") do
|
||||||
local line = attach_uuid(bodyLine)
|
local line = attach_uuid(bodyLine)
|
||||||
table.insert(text_nodes, NuiTree.Node({
|
table.insert(
|
||||||
|
text_nodes,
|
||||||
|
NuiTree.Node({
|
||||||
new_line = (type(note.position) == "table" and note.position.new_line),
|
new_line = (type(note.position) == "table" and note.position.new_line),
|
||||||
old_line = (type(note.position) == "table" and note.position.old_line),
|
old_line = (type(note.position) == "table" and note.position.old_line),
|
||||||
text = line.text,
|
text = line.text,
|
||||||
id = line.id,
|
id = line.id,
|
||||||
is_body = true
|
is_body = true,
|
||||||
}, {}))
|
}, {})
|
||||||
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
local resolve_symbol = ''
|
local resolve_symbol = ""
|
||||||
if resolve_info ~= nil and resolve_info.resolvable then
|
if resolve_info ~= nil and resolve_info.resolvable then
|
||||||
resolve_symbol = resolve_info.resolved and state.settings.discussion_tree.resolved or
|
resolve_symbol = resolve_info.resolved and state.settings.discussion_tree.resolved
|
||||||
state.settings.discussion_tree.unresolved
|
or state.settings.discussion_tree.unresolved
|
||||||
end
|
end
|
||||||
|
|
||||||
local noteHeader = "@" .. note.author.username .. " " .. u.format_date(note.created_at) .. " " .. resolve_symbol
|
local noteHeader = "@" .. note.author.username .. " " .. u.format_date(note.created_at) .. " " .. resolve_symbol
|
||||||
@@ -502,16 +514,15 @@ M.add_reply_to_tree = function(tree, note, discussion_id)
|
|||||||
tree:render()
|
tree:render()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
M.add_discussions_to_table = function(items)
|
M.add_discussions_to_table = function(items)
|
||||||
local t = {}
|
local t = {}
|
||||||
for _, discussion in ipairs(items) do
|
for _, discussion in ipairs(items) do
|
||||||
local discussion_children = {}
|
local discussion_children = {}
|
||||||
|
|
||||||
-- These properties are filled in by the first note
|
-- These properties are filled in by the first note
|
||||||
local root_text = ''
|
local root_text = ""
|
||||||
local root_note_id = ''
|
local root_note_id = ""
|
||||||
local root_file_name = ''
|
local root_file_name = ""
|
||||||
local root_id = 0
|
local root_id = 0
|
||||||
local root_text_nodes = {}
|
local root_text_nodes = {}
|
||||||
local resolvable = false
|
local resolvable = false
|
||||||
@@ -521,7 +532,7 @@ M.add_discussions_to_table = function(items)
|
|||||||
|
|
||||||
for j, note in ipairs(discussion.notes) do
|
for j, note in ipairs(discussion.notes) do
|
||||||
if j == 1 then
|
if j == 1 then
|
||||||
__, root_text, root_text_nodes = M.build_note(note, { resolved = note.resolved, resolvable = note.resolvable })
|
_, root_text, root_text_nodes = M.build_note(note, { resolved = note.resolved, resolvable = note.resolvable })
|
||||||
|
|
||||||
root_file_name = (type(note.position) == "table" and note.position.new_path)
|
root_file_name = (type(note.position) == "table" and note.position.new_path)
|
||||||
root_new_line = (type(note.position) == "table" and note.position.new_line)
|
root_new_line = (type(note.position) == "table" and note.position.new_line)
|
||||||
@@ -548,7 +559,7 @@ M.add_discussions_to_table = function(items)
|
|||||||
new_line = root_new_line,
|
new_line = root_new_line,
|
||||||
old_line = root_old_line,
|
old_line = root_old_line,
|
||||||
resolvable = resolvable,
|
resolvable = resolvable,
|
||||||
resolved = resolved
|
resolved = resolved,
|
||||||
}, body)
|
}, body)
|
||||||
|
|
||||||
table.insert(t, root_node)
|
table.insert(t, root_node)
|
||||||
@@ -559,9 +570,13 @@ end
|
|||||||
|
|
||||||
M.get_note_location = function(tree)
|
M.get_note_location = function(tree)
|
||||||
local node = tree:get_node()
|
local node = tree:get_node()
|
||||||
if node == nil then return nil, nil, nil, "Could not get node" end
|
if node == nil then
|
||||||
|
return nil, nil, nil, "Could not get node"
|
||||||
|
end
|
||||||
local discussion_node = M.get_root_node(tree, node)
|
local discussion_node = M.get_root_node(tree, node)
|
||||||
if discussion_node == nil then return nil, nil, nil, "Could not get discussion node" end
|
if discussion_node == nil then
|
||||||
|
return nil, nil, nil, "Could not get discussion node"
|
||||||
|
end
|
||||||
return discussion_node.file_name, discussion_node.new_line, discussion_node.old_line
|
return discussion_node.file_name, discussion_node.new_line, discussion_node.old_line
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ end
|
|||||||
|
|
||||||
M.attach_file = function()
|
M.attach_file = function()
|
||||||
local attachment_dir = state.settings.attachment_dir
|
local attachment_dir = state.settings.attachment_dir
|
||||||
if not attachment_dir or attachment_dir == '' then
|
if not attachment_dir or attachment_dir == "" then
|
||||||
vim.notify("Must provide valid attachment_dir in plugin setup", vim.log.levels.ERROR)
|
vim.notify("Must provide valid attachment_dir in plugin setup", vim.log.levels.ERROR)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
@@ -33,9 +33,11 @@ M.attach_file = function()
|
|||||||
end
|
end
|
||||||
|
|
||||||
vim.ui.select(files, {
|
vim.ui.select(files, {
|
||||||
prompt = 'Choose attachment',
|
prompt = "Choose attachment",
|
||||||
}, function(choice)
|
}, function(choice)
|
||||||
if not choice then return end
|
if not choice then
|
||||||
|
return
|
||||||
|
end
|
||||||
local full_path = attachment_dir .. (u.is_windows() and "\\" or "/") .. choice
|
local full_path = attachment_dir .. (u.is_windows() and "\\" or "/") .. choice
|
||||||
local body = { file_path = full_path, file_name = choice }
|
local body = { file_path = full_path, file_name = choice }
|
||||||
job.run_job("/mr/attachment", "POST", body, function(data)
|
job.run_job("/mr/attachment", "POST", body, function(data)
|
||||||
|
|||||||
@@ -53,8 +53,15 @@ M.open = function()
|
|||||||
table.insert(lines, "")
|
table.insert(lines, "")
|
||||||
table.insert(lines, "Jobs:")
|
table.insert(lines, "Jobs:")
|
||||||
for _, pipeline_job in ipairs(pipeline_jobs) do
|
for _, pipeline_job in ipairs(pipeline_jobs) do
|
||||||
table.insert(lines,
|
table.insert(
|
||||||
string.format("%s (%s) %s", state.settings.pipeline[pipeline_job.status], pipeline_job.status, pipeline_job.name))
|
lines,
|
||||||
|
string.format(
|
||||||
|
"%s (%s) %s",
|
||||||
|
state.settings.pipeline[pipeline_job.status],
|
||||||
|
pipeline_job.status,
|
||||||
|
pipeline_job.name
|
||||||
|
)
|
||||||
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
vim.schedule(function()
|
vim.schedule(function()
|
||||||
@@ -83,9 +90,8 @@ M.retrigger = function()
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
job.run_job("/pipeline", "POST", body, function(data)
|
job.run_job("/pipeline", "POST", body, function()
|
||||||
vim.notify("Pipeline re-triggered!", vim.log.levels.INFO)
|
vim.notify("Pipeline re-triggered!", vim.log.levels.INFO)
|
||||||
pipeline = data.Pipeline
|
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -101,7 +107,9 @@ M.see_logs = function()
|
|||||||
|
|
||||||
local j = nil
|
local j = nil
|
||||||
for _, pipeline_job in ipairs(M.pipeline_jobs) do
|
for _, pipeline_job in ipairs(M.pipeline_jobs) do
|
||||||
if pipeline_job.name == last_word then j = pipeline_job end
|
if pipeline_job.name == last_word then
|
||||||
|
j = pipeline_job
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if j == nil then
|
if j == nil then
|
||||||
@@ -147,19 +155,24 @@ M.color_status = function(status, bufnr, status_line, linnr)
|
|||||||
vim.cmd(string.format("highlight default StatusHighlight guifg=%s", state.settings.pipeline[status]))
|
vim.cmd(string.format("highlight default StatusHighlight guifg=%s", state.settings.pipeline[status]))
|
||||||
|
|
||||||
local status_to_color_map = {
|
local status_to_color_map = {
|
||||||
created = 'DiagnosticWarn',
|
created = "DiagnosticWarn",
|
||||||
pending = 'DiagnosticWarn',
|
pending = "DiagnosticWarn",
|
||||||
preparing = 'DiagnosticWarn',
|
preparing = "DiagnosticWarn",
|
||||||
scheduled = 'DiagnosticWarn',
|
scheduled = "DiagnosticWarn",
|
||||||
running = 'DiagnosticWarn',
|
running = "DiagnosticWarn",
|
||||||
canceled = 'DiagnosticWarn',
|
canceled = "DiagnosticWarn",
|
||||||
skipped = 'DiagnosticWarn',
|
skipped = "DiagnosticWarn",
|
||||||
failed = 'DiagnosticError',
|
failed = "DiagnosticError",
|
||||||
success = 'DiagnosticOK',
|
success = "DiagnosticOK",
|
||||||
}
|
}
|
||||||
|
|
||||||
vim.api.nvim_buf_set_extmark(bufnr, ns_id, linnr - 1, 0,
|
vim.api.nvim_buf_set_extmark(
|
||||||
{ end_row = linnr - 1, end_col = string.len(status_line), hl_group = status_to_color_map[status] })
|
bufnr,
|
||||||
|
ns_id,
|
||||||
|
linnr - 1,
|
||||||
|
0,
|
||||||
|
{ end_row = linnr - 1, end_col = string.len(status_line), hl_group = status_to_color_map[status] }
|
||||||
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|||||||
@@ -12,10 +12,9 @@ local M = {
|
|||||||
layout = nil,
|
layout = nil,
|
||||||
layout_buf = nil,
|
layout_buf = nil,
|
||||||
title_bufnr = nil,
|
title_bufnr = nil,
|
||||||
description_bufnr = nil
|
description_bufnr = nil,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
-- The function will render the MR description in a popup
|
-- The function will render the MR description in a popup
|
||||||
M.summary = function()
|
M.summary = function()
|
||||||
if M.layout_visible then
|
if M.layout_visible then
|
||||||
@@ -48,8 +47,12 @@ M.summary = function()
|
|||||||
vim.schedule(function()
|
vim.schedule(function()
|
||||||
vim.api.nvim_buf_set_lines(currentBuffer, 0, -1, false, lines)
|
vim.api.nvim_buf_set_lines(currentBuffer, 0, -1, false, lines)
|
||||||
vim.api.nvim_buf_set_lines(title_popup.bufnr, 0, -1, false, { title })
|
vim.api.nvim_buf_set_lines(title_popup.bufnr, 0, -1, false, { title })
|
||||||
state.set_popup_keymaps(description_popup, M.edit_summary, miscellaneous.attach_file,
|
state.set_popup_keymaps(
|
||||||
{ cb = exit, action_before_close = true })
|
description_popup,
|
||||||
|
M.edit_summary,
|
||||||
|
miscellaneous.attach_file,
|
||||||
|
{ cb = exit, action_before_close = true }
|
||||||
|
)
|
||||||
state.set_popup_keymaps(title_popup, M.edit_summary, nil, { cb = exit, action_before_close = true })
|
state.set_popup_keymaps(title_popup, M.edit_summary, nil, { cb = exit, action_before_close = true })
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
@@ -70,20 +73,20 @@ end
|
|||||||
|
|
||||||
local top_popup = {
|
local top_popup = {
|
||||||
buf_options = {
|
buf_options = {
|
||||||
filetype = 'markdown'
|
filetype = "markdown",
|
||||||
},
|
},
|
||||||
focusable = true,
|
focusable = true,
|
||||||
border = {
|
border = {
|
||||||
style = "rounded",
|
style = "rounded",
|
||||||
text = {
|
text = {
|
||||||
top = "Merge Request"
|
top = "Merge Request",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
local bottom_popup = {
|
local bottom_popup = {
|
||||||
buf_options = {
|
buf_options = {
|
||||||
filetype = 'markdown'
|
filetype = "markdown",
|
||||||
},
|
},
|
||||||
enter = true,
|
enter = true,
|
||||||
focusable = true,
|
focusable = true,
|
||||||
|
|||||||
@@ -3,26 +3,25 @@
|
|||||||
local server = require("gitlab.server")
|
local server = require("gitlab.server")
|
||||||
local job = require("gitlab.job")
|
local job = require("gitlab.job")
|
||||||
local state = require("gitlab.state")
|
local state = require("gitlab.state")
|
||||||
local u = require("gitlab.utils")
|
|
||||||
|
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
Async = {
|
local async = {
|
||||||
cb = nil
|
cb = nil,
|
||||||
}
|
}
|
||||||
|
|
||||||
function Async:new(o)
|
function async:new(o)
|
||||||
o = o or {}
|
o = o or {}
|
||||||
setmetatable(o, self)
|
setmetatable(o, self)
|
||||||
self.__index = self
|
self.__index = self
|
||||||
return o
|
return o
|
||||||
end
|
end
|
||||||
|
|
||||||
function Async:init(cb)
|
function async:init(cb)
|
||||||
self.cb = cb
|
self.cb = cb
|
||||||
end
|
end
|
||||||
|
|
||||||
function Async:fetch(dependencies, i, argTable)
|
function async:fetch(dependencies, i, argTable)
|
||||||
if i > #dependencies then
|
if i > #dependencies then
|
||||||
self.cb(argTable)
|
self.cb(argTable)
|
||||||
return
|
return
|
||||||
@@ -45,7 +44,7 @@ end
|
|||||||
-- Will call APIs in sequence and set global state
|
-- Will call APIs in sequence and set global state
|
||||||
M.sequence = function(dependencies, cb)
|
M.sequence = function(dependencies, cb)
|
||||||
return function(argTable)
|
return function(argTable)
|
||||||
local handler = Async:new()
|
local handler = async:new()
|
||||||
handler:init(cb)
|
handler:init(cb)
|
||||||
|
|
||||||
if not state.is_gitlab_project then
|
if not state.is_gitlab_project then
|
||||||
|
|||||||
@@ -17,7 +17,9 @@ local revisions = state.dependencies.revisions
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
setup = function(args)
|
setup = function(args)
|
||||||
if args == nil then args = {} end
|
if args == nil then
|
||||||
|
args = {}
|
||||||
|
end
|
||||||
server.build() -- Builds the Go binary if it doesn't exist
|
server.build() -- Builds the Go binary if it doesn't exist
|
||||||
state.setPluginConfiguration() -- Sets configuration from `.gitlab.nvim` file
|
state.setPluginConfiguration() -- Sets configuration from `.gitlab.nvim` file
|
||||||
state.merge_settings(args) -- Sets keymaps and other settings from setup function
|
state.merge_settings(args) -- Sets keymaps and other settings from setup function
|
||||||
@@ -36,7 +38,9 @@ return {
|
|||||||
create_multiline_comment = async.sequence({ info, revisions }, comment.create_multiline_comment),
|
create_multiline_comment = async.sequence({ info, revisions }, comment.create_multiline_comment),
|
||||||
create_comment_suggestion = async.sequence({ info, revisions }, comment.create_comment_suggestion),
|
create_comment_suggestion = async.sequence({ info, revisions }, comment.create_comment_suggestion),
|
||||||
create_note = async.sequence({ info }, comment.create_note),
|
create_note = async.sequence({ info }, comment.create_note),
|
||||||
review = async.sequence({ u.merge(info, { refresh = true }) }, function() reviewer.open() end),
|
review = async.sequence({ u.merge(info, { refresh = true }) }, function()
|
||||||
|
reviewer.open()
|
||||||
|
end),
|
||||||
pipeline = async.sequence({ info }, pipeline.open),
|
pipeline = async.sequence({ info }, pipeline.open),
|
||||||
-- Discussion Tree Actions 🌴
|
-- Discussion Tree Actions 🌴
|
||||||
toggle_discussions = async.sequence({ info }, discussions.toggle),
|
toggle_discussions = async.sequence({ info }, discussions.toggle),
|
||||||
|
|||||||
@@ -24,7 +24,9 @@ M.run_job = function(endpoint, method, body, callback)
|
|||||||
local data_ok, data = pcall(vim.json.decode, output)
|
local data_ok, data = pcall(vim.json.decode, output)
|
||||||
if not data_ok then
|
if not data_ok then
|
||||||
local msg = string.format("Failed to parse JSON from %s endpoint", endpoint)
|
local msg = string.format("Failed to parse JSON from %s endpoint", endpoint)
|
||||||
if (type(output) == "string") then msg = string.format(msg .. ", got: '%s'", output) end
|
if type(output) == "string" then
|
||||||
|
msg = string.format(msg .. ", got: '%s'", output)
|
||||||
|
end
|
||||||
vim.notify(string.format(msg, endpoint, output), vim.log.levels.WARN)
|
vim.notify(string.format(msg, endpoint, output), vim.log.levels.WARN)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
@@ -42,12 +44,12 @@ M.run_job = function(endpoint, method, body, callback)
|
|||||||
end
|
end
|
||||||
end, 0)
|
end, 0)
|
||||||
end,
|
end,
|
||||||
on_stderr = function(_, output)
|
on_stderr = function()
|
||||||
vim.defer_fn(function()
|
vim.defer_fn(function()
|
||||||
vim.notify("Could not run command!", vim.log.levels.ERROR)
|
vim.notify("Could not run command!", vim.log.levels.ERROR)
|
||||||
end, 0)
|
end, 0)
|
||||||
end,
|
end,
|
||||||
on_exit = function(msg, status)
|
on_exit = function(_, status)
|
||||||
vim.defer_fn(function()
|
vim.defer_fn(function()
|
||||||
if status ~= 0 then
|
if status ~= 0 then
|
||||||
vim.notify(string.format("Go server exited with non-zero code: %d", status), vim.log.levels.ERROR)
|
vim.notify(string.format("Go server exited with non-zero code: %d", status), vim.log.levels.ERROR)
|
||||||
|
|||||||
@@ -246,11 +246,8 @@ M.get_review_buffer_lines = function(review_buffer_range)
|
|||||||
return lines
|
return lines
|
||||||
end
|
end
|
||||||
|
|
||||||
---Return content between start_line and end_line
|
--- This function is not supported for delta
|
||||||
---@param start_line integer
|
M.get_lines = function()
|
||||||
---@param end_line integer
|
|
||||||
---@return string[] | nil
|
|
||||||
M.get_lines = function(start_line, end_line)
|
|
||||||
vim.notify("Getting lines in delta is not supported yet", vim.log.levels.ERROR)
|
vim.notify("Getting lines in delta is not supported yet", vim.log.levels.ERROR)
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -21,7 +21,9 @@ M.start = function(callback)
|
|||||||
.. " "
|
.. " "
|
||||||
.. state.settings.auth_token
|
.. state.settings.auth_token
|
||||||
.. " "
|
.. " "
|
||||||
.. "'" .. vim.json.encode(state.settings.debug) .. "'"
|
.. "'"
|
||||||
|
.. vim.json.encode(state.settings.debug)
|
||||||
|
.. "'"
|
||||||
.. " "
|
.. " "
|
||||||
.. state.settings.log_path
|
.. state.settings.log_path
|
||||||
|
|
||||||
@@ -61,7 +63,7 @@ M.start = function(callback)
|
|||||||
vim.notify(err_msg, vim.log.levels.ERROR)
|
vim.notify(err_msg, vim.log.levels.ERROR)
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
on_exit = function(job_id, exit_code, ...)
|
on_exit = function(job_id, exit_code)
|
||||||
vim.notify(
|
vim.notify(
|
||||||
"Golang gitlab server exited: job_id: " .. job_id .. ", exit_code: " .. exit_code,
|
"Golang gitlab server exited: job_id: " .. job_id .. ", exit_code: " .. exit_code,
|
||||||
vim.log.levels.ERROR
|
vim.log.levels.ERROR
|
||||||
|
|||||||
@@ -63,7 +63,9 @@ M.settings = {
|
|||||||
|
|
||||||
-- Merges user settings into the default settings, overriding them
|
-- Merges user settings into the default settings, overriding them
|
||||||
M.merge_settings = function(args)
|
M.merge_settings = function(args)
|
||||||
if args == nil then return end
|
if args == nil then
|
||||||
|
return
|
||||||
|
end
|
||||||
M.settings = u.merge(M.settings, args)
|
M.settings = u.merge(M.settings, args)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -110,15 +112,21 @@ end
|
|||||||
|
|
||||||
local function exit(popup, cb)
|
local function exit(popup, cb)
|
||||||
popup:unmount()
|
popup:unmount()
|
||||||
if cb ~= nil then cb() end
|
if cb ~= nil then
|
||||||
|
cb()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- These keymaps are buffer specific and are set dynamically when popups mount
|
-- These keymaps are buffer specific and are set dynamically when popups mount
|
||||||
M.set_popup_keymaps = function(popup, action, linewise_action, opts)
|
M.set_popup_keymaps = function(popup, action, linewise_action, opts)
|
||||||
if opts == nil then opts = {} end
|
if opts == nil then
|
||||||
vim.keymap.set('n', M.settings.popup.exit, function() exit(popup, opts.cb) end, { buffer = popup.bufnr })
|
opts = {}
|
||||||
|
end
|
||||||
|
vim.keymap.set("n", M.settings.popup.exit, function()
|
||||||
|
exit(popup, opts.cb)
|
||||||
|
end, { buffer = popup.bufnr })
|
||||||
if action ~= nil then
|
if action ~= nil then
|
||||||
vim.keymap.set('n', M.settings.popup.perform_action, function()
|
vim.keymap.set("n", M.settings.popup.perform_action, function()
|
||||||
local text = u.get_buffer_text(popup.bufnr)
|
local text = u.get_buffer_text(popup.bufnr)
|
||||||
if opts.action_before_close then
|
if opts.action_before_close then
|
||||||
action(text, popup.bufnr)
|
action(text, popup.bufnr)
|
||||||
@@ -131,7 +139,7 @@ M.set_popup_keymaps = function(popup, action, linewise_action, opts)
|
|||||||
end
|
end
|
||||||
|
|
||||||
if linewise_action ~= nil then
|
if linewise_action ~= nil then
|
||||||
vim.keymap.set('n', M.settings.popup.perform_linewise_action, function()
|
vim.keymap.set("n", M.settings.popup.perform_linewise_action, function()
|
||||||
local bufnr = vim.api.nvim_get_current_buf()
|
local bufnr = vim.api.nvim_get_current_buf()
|
||||||
local linnr = vim.api.nvim_win_get_cursor(0)[1]
|
local linnr = vim.api.nvim_win_get_cursor(0)[1]
|
||||||
local text = u.get_line_content(bufnr, linnr)
|
local text = u.get_line_content(bufnr, linnr)
|
||||||
@@ -148,9 +156,7 @@ end
|
|||||||
M.dependencies = {
|
M.dependencies = {
|
||||||
info = { endpoint = "/info", key = "info", state = "INFO", refresh = false },
|
info = { endpoint = "/info", key = "info", state = "INFO", refresh = false },
|
||||||
revisions = { endpoint = "/mr/revisions", key = "Revisions", state = "MR_REVISIONS", refresh = false },
|
revisions = { endpoint = "/mr/revisions", key = "Revisions", state = "MR_REVISIONS", refresh = false },
|
||||||
project_members = { endpoint = "/members", key = "ProjectMembers", state = "PROJECT_MEMBERS", refresh = false }
|
project_members = { endpoint = "/members", key = "ProjectMembers", state = "PROJECT_MEMBERS", refresh = false },
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ M.get_current_line_number = function()
|
|||||||
end
|
end
|
||||||
|
|
||||||
M.has_reviewer = function(reviewer)
|
M.has_reviewer = function(reviewer)
|
||||||
local has_reviewer = false
|
local has_reviewer
|
||||||
if reviewer == "diffview" then
|
if reviewer == "diffview" then
|
||||||
has_reviewer = vim.fn.exists(":DiffviewOpen") ~= 0
|
has_reviewer = vim.fn.exists(":DiffviewOpen") ~= 0
|
||||||
else
|
else
|
||||||
@@ -253,10 +253,7 @@ end
|
|||||||
M.get_line_content = function(bufnr, start)
|
M.get_line_content = function(bufnr, start)
|
||||||
local current_buffer = vim.api.nvim_get_current_buf()
|
local current_buffer = vim.api.nvim_get_current_buf()
|
||||||
local lines = vim.api.nvim_buf_get_lines(bufnr ~= nil and bufnr or current_buffer, start - 1, start, false)
|
local lines = vim.api.nvim_buf_get_lines(bufnr ~= nil and bufnr or current_buffer, start - 1, start, false)
|
||||||
|
return lines[1]
|
||||||
for _, line in ipairs(lines) do
|
|
||||||
return line
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
M.get_win_from_buf = function(bufnr)
|
M.get_win_from_buf = function(bufnr)
|
||||||
|
|||||||
7
stylua.toml
Normal file
7
stylua.toml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
column_width = 120
|
||||||
|
line_endings = "Unix"
|
||||||
|
indent_type = "Spaces"
|
||||||
|
indent_width = 2
|
||||||
|
quote_style = "AutoPreferDouble"
|
||||||
|
call_parentheses = "Always"
|
||||||
|
collapse_simple_statement = "Never"
|
||||||
Reference in New Issue
Block a user