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

@@ -103,6 +103,7 @@ func NewCmdAssess(f *cmdutil.Factory) *cobra.Command {
if err != nil {
return fmt.Errorf("cannot read procedure file: %w", err)
}
input["procedure"] = string(data)
}

View File

@@ -145,6 +145,7 @@ func NewCmdCreate(f *cmdutil.Factory) *cobra.Command {
if flagName == "" {
return fmt.Errorf("name is required; pass --name or run interactively")
}
if flagCategory == "" {
return fmt.Errorf("category is required; pass --category or run interactively")
}
@@ -158,12 +159,15 @@ func NewCmdCreate(f *cmdutil.Factory) *cobra.Command {
if flagDescription != "" {
input["description"] = flagDescription
}
if flagLegalName != "" {
input["legalName"] = flagLegalName
}
if flagAddress != "" {
input["headquarterAddress"] = flagAddress
}
if flagWebsite != "" {
input["websiteUrl"] = flagWebsite
}

View File

@@ -45,6 +45,7 @@ func NewCmdDelete(f *cmdutil.Factory) *cobra.Command {
}
var confirmed bool
err := huh.NewConfirm().
Title(fmt.Sprintf("Delete thirdParty %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

@@ -111,6 +111,7 @@ func NewCmdList(f *cmdutil.Factory) *cobra.Command {
if err := cmdutil.ValidateEnum("order-by", flagOrderBy, []string{"NAME", "CREATED_AT", "UPDATED_AT"}); err != nil {
return err
}
variables["orderBy"] = map[string]any{
"field": flagOrderBy,
"direction": flagOrderDir,
@@ -132,12 +133,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("organization %s not found", flagOrg)
}
if resp.Node.Typename != "Organization" {
return nil, fmt.Errorf("expected Organization node, got %s", resp.Node.Typename)
}
return &resp.Node.ThirdParties, nil
},
)

View File

@@ -96,6 +96,7 @@ func NewCmdPublish(f *cmdutil.Factory) *cobra.Command {
if flagOrg == "" {
flagOrg = hc.Organization
}
if flagOrg == "" {
return fmt.Errorf("organization is required: pass --org or run `prb auth login`")
}

View File

@@ -85,18 +85,23 @@ func NewCmdUpdate(f *cmdutil.Factory) *cobra.Command {
if cmd.Flags().Changed("name") {
input["name"] = flagName
}
if cmd.Flags().Changed("description") {
input["description"] = flagDescription
}
if cmd.Flags().Changed("category") {
input["category"] = flagCategory
}
if cmd.Flags().Changed("legal-name") {
input["legalName"] = flagLegalName
}
if cmd.Flags().Changed("address") {
input["headquarterAddress"] = flagAddress
}
if cmd.Flags().Changed("website") {
input["websiteUrl"] = flagWebsite
}