Add wsl linter and fix

Signed-off-by: Émile Ré <emile@probo.com>
This commit is contained in:
Émile Ré
2026-05-19 14:51:08 +04:00
parent eedfdcecc8
commit 9156d6a16a
882 changed files with 6068 additions and 574 deletions

View File

@@ -45,6 +45,7 @@ func NewCmdDelete(f *cmdutil.Factory) *cobra.Command {
}
var confirmed bool
err := huh.NewConfirm().
Title(fmt.Sprintf("Delete webhook subscription %s?", args[0])).
Value(&confirmed).
@@ -52,6 +53,7 @@ func NewCmdDelete(f *cmdutil.Factory) *cobra.Command {
if err != nil {
return err
}
if !confirmed {
return nil
}

View File

@@ -97,6 +97,7 @@ func NewCmdList(f *cmdutil.Factory) *cobra.Command {
if err := cmdutil.ValidateEnum("order-by", flagOrderBy, []string{"CREATED_AT"}); err != nil {
return err
}
variables["orderBy"] = map[string]any{
"field": flagOrderBy,
"direction": flagOrderDir,
@@ -118,12 +119,15 @@ func NewCmdList(f *cmdutil.Factory) *cobra.Command {
if err := json.Unmarshal(data, &resp); err != nil {
return nil, err
}
if resp.Node == nil {
return nil, fmt.Errorf("webhook subscription %s not found", args[0])
}
if resp.Node.Typename != "WebhookSubscription" {
return nil, fmt.Errorf("expected WebhookSubscription node, got %s", resp.Node.Typename)
}
return &resp.Node.Events, nil
},
)
@@ -135,6 +139,7 @@ func NewCmdList(f *cmdutil.Factory) *cobra.Command {
if events == nil {
events = []webhookEvent{}
}
return cmdutil.PrintJSON(f.IOStreams.Out, events)
}

View File

@@ -96,6 +96,7 @@ func NewCmdList(f *cmdutil.Factory) *cobra.Command {
if err := cmdutil.ValidateEnum("order-by", flagOrderBy, []string{"CREATED_AT"}); err != nil {
return err
}
variables["orderBy"] = map[string]any{
"field": flagOrderBy,
"direction": flagOrderDir,
@@ -118,6 +119,7 @@ func NewCmdList(f *cmdutil.Factory) *cobra.Command {
if err := json.Unmarshal(data, &resp); err != nil {
return nil, err
}
return &resp.Viewer.Organization.WebhookSubscriptions, nil
},
)
@@ -129,6 +131,7 @@ func NewCmdList(f *cmdutil.Factory) *cobra.Command {
if webhooks == nil {
webhooks = []webhookSubscription{}
}
return cmdutil.PrintJSON(f.IOStreams.Out, webhooks)
}

View File

@@ -74,6 +74,7 @@ func NewCmdUpdate(f *cmdutil.Factory) *cobra.Command {
return fmt.Errorf("invalid --event value %q: valid values are %s", e, strings.Join(shared.ValidEvents, ", "))
}
}
input["selectedEvents"] = flagEvents
}