Skip to content

Commit b15ff8e

Browse files
ci: fix lint
1 parent b0cfcb7 commit b15ff8e

File tree

4 files changed

+27
-13
lines changed

4 files changed

+27
-13
lines changed

internal/cmd/company/rules/client.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,18 @@ type IRulesClient interface {
3838
ListTenantRules(ctx context.Context, companyID string) ([]*rulesentities.SaveChangesRules, error)
3939
ListProjectRules(ctx context.Context, projectID string) ([]*rulesentities.ProjectSaveChangesRules, error)
4040
UpdateTenantRules(ctx context.Context, companyID string, rules []*rulesentities.SaveChangesRules) error
41-
UpdateProjectRules(ctx context.Context, projectId string, rules []*rulesentities.SaveChangesRules) error
41+
UpdateProjectRules(ctx context.Context, projectID string, rules []*rulesentities.SaveChangesRules) error
4242
}
4343

44-
type RulesClient struct {
44+
type rulesClient struct {
4545
c *client.APIClient
4646
}
4747

4848
func New(c *client.APIClient) IRulesClient {
49-
return &RulesClient{c: c}
49+
return &rulesClient{c: c}
5050
}
5151

52-
func (e *RulesClient) ListTenantRules(ctx context.Context, companyID string) ([]*rulesentities.SaveChangesRules, error) {
52+
func (e *rulesClient) ListTenantRules(ctx context.Context, companyID string) ([]*rulesentities.SaveChangesRules, error) {
5353
request := e.c.Get().APIPath(tenantsAPIPrefix)
5454
request.SetParam("search", companyID)
5555

@@ -85,7 +85,7 @@ func (e *RulesClient) ListTenantRules(ctx context.Context, companyID string) ([]
8585
return tenant.ConfigurationManagement.SaveChangesRules, nil
8686
}
8787

88-
func (e *RulesClient) ListProjectRules(ctx context.Context, projectID string) ([]*rulesentities.ProjectSaveChangesRules, error) {
88+
func (e *rulesClient) ListProjectRules(ctx context.Context, projectID string) ([]*rulesentities.ProjectSaveChangesRules, error) {
8989
request := e.c.Get().APIPath(fmt.Sprintf(getProjectAPIFmt, projectID))
9090
request.SetParam("withTenant", "true")
9191

@@ -113,7 +113,7 @@ type UpdateRequestBody struct {
113113
ConfigurationManagement *resources.ConfigurationManagement `json:"configurationManagement"`
114114
}
115115

116-
func (e *RulesClient) UpdateTenantRules(ctx context.Context, companyID string, rules []*rulesentities.SaveChangesRules) error {
116+
func (e *rulesClient) UpdateTenantRules(ctx context.Context, companyID string, rules []*rulesentities.SaveChangesRules) error {
117117
requestBody := UpdateRequestBody{
118118
ConfigurationManagement: &resources.ConfigurationManagement{
119119
SaveChangesRules: rules,
@@ -141,7 +141,7 @@ func (e *RulesClient) UpdateTenantRules(ctx context.Context, companyID string, r
141141
return nil
142142
}
143143

144-
func (e *RulesClient) UpdateProjectRules(ctx context.Context, projectID string, rules []*rulesentities.SaveChangesRules) error {
144+
func (e *rulesClient) UpdateProjectRules(ctx context.Context, projectID string, rules []*rulesentities.SaveChangesRules) error {
145145
requestBody := UpdateRequestBody{
146146
ConfigurationManagement: &resources.ConfigurationManagement{
147147
SaveChangesRules: rules,
@@ -169,7 +169,7 @@ func (e *RulesClient) UpdateProjectRules(ctx context.Context, projectID string,
169169
return nil
170170
}
171171

172-
func (e *RulesClient) assertSuccessResponse(resp *client.Response) error {
172+
func (e *rulesClient) assertSuccessResponse(resp *client.Response) error {
173173
if resp.StatusCode() >= http.StatusBadRequest {
174174
return resp.Error()
175175
}

internal/cmd/company/rules/list.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ func printProjectList(rules []*rulesentities.ProjectSaveChangesRules, p printer.
100100

101101
p.Keys(tableColumnLabel...)
102102
for i, rule := range rules {
103-
104103
ruleInfo := createRecord(rule.DisallowedRuleSet)
105104
p.Record(
106105
strconv.Itoa(i),

internal/cmd/company/rules/update.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
// Copyright Mia srl
2+
// SPDX-License-Identifier: Apache-2.0
3+
//
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
//
8+
// http://www.apache.org/licenses/LICENSE-2.0
9+
//
10+
// Unless required by applicable law or agreed to in writing, software
11+
// distributed under the License is distributed on an "AS IS" BASIS,
12+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
// See the License for the specific language governing permissions and
14+
// limitations under the License.
15+
116
package rules
217

318
import (

internal/resources/rules/rules.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,20 @@
1616
package rules
1717

1818
type SaveChangesRules struct {
19-
RoleIDs []string `yaml:"roleIds,omitempty" json:"roleIds,omitempty"`
19+
RoleIDs []string `yaml:"roleIds,omitempty" json:"roleIds,omitempty"` //nolint:tagliatelle
2020
DisallowedRuleSet []RuleSet `yaml:"disallowedRuleSet,omitempty" json:"disallowedRuleSet,omitempty"`
2121
}
2222

2323
type ProjectSaveChangesRules struct {
24-
RoleIDs []string `yaml:"roleIds,omitempty" json:"roleIds,omitempty"`
24+
RoleIDs []string `yaml:"roleIds,omitempty" json:"roleIds,omitempty"` //nolint:tagliatelle
2525
DisallowedRuleSet []RuleSet `yaml:"disallowedRuleSet,omitempty" json:"disallowedRuleSet,omitempty"`
2626
IsInheritedFromTenant bool `yaml:"isInheritedFromTenant,omitempty" json:"isInheritedFromTenant,omitempty"`
2727
}
2828

2929
type RuleSet struct {
3030
JSONPath string `yaml:"jsonPath,omitempty" json:"jsonPath,omitempty"`
31-
Options *RuleOptions `yaml:"processingOptions,omitempty" json:"processingOptions,omitempty"`
32-
RuleID string `yaml:"ruleId,omitempty" json:"ruleId,omitempty"`
31+
Options *RuleOptions `yaml:"processingOptions,omitempty" json:"processingOptions,omitempty"` //nolint:tagliatelle
32+
RuleID string `yaml:"ruleId,omitempty" json:"ruleId,omitempty"` //nolint:tagliatelle
3333
}
3434

3535
type RuleOptions struct {

0 commit comments

Comments
 (0)