Skip to content

Commit 932fdb5

Browse files
authored
Fix/lint issues (#4)
* chore: remove unnecessary golangci.yml configuration file
1 parent 586be64 commit 932fdb5

11 files changed

Lines changed: 330 additions & 202 deletions

File tree

.github/release.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ changelog:
55
exclude:
66
labels:
77
- ignore for release
8-
- skip-changelog
8+
- wontfix
9+
- question
10+
- feature request
911
authors:
1012
- dependabot
1113
- dependabot[bot]
@@ -15,7 +17,6 @@ changelog:
1517
- title: Breaking Changes 🚨
1618
labels:
1719
- breaking change
18-
- breaking
1920
- title: Security Updates 🔒
2021
labels:
2122
- security
@@ -24,16 +25,13 @@ changelog:
2425
labels:
2526
- new feature
2627
- feature
27-
- enhancement
28-
- title: Improvements 🌱
28+
- title: Improvements & Enhancements 🌱
2929
labels:
3030
- improvement
3131
- enhancement
3232
- title: Bug Fixes 🛠
3333
labels:
3434
- bug
35-
- bugfix
36-
- fix
3735
- title: Performance ⚡
3836
labels:
3937
- performance
@@ -50,10 +48,9 @@ changelog:
5048
labels:
5149
- test
5250
- testing
53-
- title: Maintenance 🔧
51+
- title: Maintenance & CI/CD 🔧
5452
labels:
5553
- maintenance
56-
- internal
5754
- refactor
5855
- chore
5956
- ci

.github/workflows/pr-labels.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,6 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- name: Check if PR has allowed labels
12-
uses: jfrog/.github/actions/pr-labels@main
12+
uses: jfrog/.github/actions/pr-labels@main
13+
with:
14+
allowed-labels: 'bug,breaking change,new feature,feature,enhancement,improvement,security,vulnerability,performance,optimization,documentation,docs,test,testing,dependencies,deps,ci,build,maintenance,refactor,chore,style,question,wontfix,ignore for release,feature request'

.golangci.yml

Lines changed: 0 additions & 178 deletions
This file was deleted.

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ BUILD_TIME?=$(shell date -u '+%Y-%m-%d_%H:%M:%S')
2626
LDFLAGS=-ldflags "-X main.Version=$(VERSION) -X main.Commit=$(COMMIT) -X main.BuildTime=$(BUILD_TIME)"
2727

2828
# Test flags
29-
TEST_FLAGS=-v -race -coverprofile=$(COVERAGE_DIR)/coverage.out -covermode=atomic
29+
TEST_FLAGS= -race -coverprofile=$(COVERAGE_DIR)/coverage.out -covermode=atomic
3030
TEST_TIMEOUT=10m
3131

3232
# Directories
@@ -89,11 +89,11 @@ test: ## Run all tests
8989

9090
test-short: ## Run short tests
9191
@echo "$(GREEN)Running short tests...$(NC)"
92-
$(GOTEST) -short -v ./$(EVIDENCE_DIR)/...
92+
$(GOTEST) -short ./$(EVIDENCE_DIR)/...
9393

9494
test-integration: ## Run integration tests
9595
@echo "$(GREEN)Running integration tests...$(NC)"
96-
$(GOTEST) -v -tags=integration -timeout 30m ./$(EVIDENCE_DIR)/...
96+
$(GOTEST) -tags=integration -timeout 30m ./$(EVIDENCE_DIR)/...
9797

9898
test-unit: ## Run unit tests only
9999
@echo "$(GREEN)Running unit tests...$(NC)"

evidence/cli/command_cli_test.go

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,12 @@ func TestCreateEvidence_Context(t *testing.T) {
1919

2020
assert.NoError(t, os.Setenv(coreUtils.SigningKey, "PGP"), "Failed to set env: "+coreUtils.SigningKey)
2121
assert.NoError(t, os.Setenv(coreUtils.BuildName, buildName), "Failed to set env: JFROG_CLI_BUILD_NAME")
22-
defer os.Unsetenv(coreUtils.SigningKey)
23-
defer os.Unsetenv(coreUtils.BuildName)
22+
defer func() {
23+
assert.NoError(t, os.Unsetenv(coreUtils.SigningKey))
24+
}()
25+
defer func() {
26+
assert.NoError(t, os.Unsetenv(coreUtils.BuildName))
27+
}()
2428

2529
app := cli.NewApp()
2630
app.Commands = []cli.Command{
@@ -216,8 +220,12 @@ func TestVerifyEvidence_Context(t *testing.T) {
216220

217221
assert.NoError(t, os.Setenv(coreUtils.SigningKey, "PGP"), "Failed to set env: "+coreUtils.SigningKey)
218222
assert.NoError(t, os.Setenv(coreUtils.BuildName, buildName), "Failed to set env: JFROG_CLI_BUILD_NAME")
219-
defer os.Unsetenv(coreUtils.SigningKey)
220-
defer os.Unsetenv(coreUtils.BuildName)
223+
defer func() {
224+
assert.NoError(t, os.Unsetenv(coreUtils.SigningKey))
225+
}()
226+
defer func() {
227+
assert.NoError(t, os.Unsetenv(coreUtils.BuildName))
228+
}()
221229

222230
app := cli.NewApp()
223231
app.Commands = []cli.Command{

evidence/create/create_github.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ func marshalEvidenceToGitLogEntryView(evidence []byte) (*model.GitLogEntryView,
188188
}
189189

190190
func (c *createGitHubEvidence) committerReviewerEvidence() ([]byte, error) {
191-
if c.createEvidenceBase.flagType != FlagTypeCommitterReviewer {
191+
if c.flagType != FlagTypeCommitterReviewer {
192192
return nil, errors.New("flag type must be gh-commiter")
193193
}
194194

evidence/get/get_base.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,9 @@ func exportEvidenceToJsonFile(evidence []byte, outputFileName string) error {
9898
return err
9999
}
100100

101-
defer file.Close()
101+
defer func() {
102+
_ = file.Close()
103+
}()
102104

103105
_, err = file.Write(evidence)
104106
if err != nil {
@@ -118,7 +120,9 @@ func exportEvidenceToJsonlFile(data []byte, outputFileName string) error {
118120
if err != nil {
119121
return err
120122
}
121-
defer file.Close()
123+
defer func() {
124+
_ = file.Close()
125+
}()
122126

123127
return writeEvidenceJsonl(data, file)
124128
}

evidence/sonar/parser.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ func readTaskReport(path string) (map[string]string, error) {
4444
if err != nil {
4545
return nil, errorutils.CheckErrorf("failed to open report task file '%s': %v", path, err)
4646
}
47-
defer f.Close()
47+
defer func() {
48+
_ = f.Close()
49+
}()
4850

4951
scanner := bufio.NewScanner(f)
5052
for scanner.Scan() {

evidence/utils/environment.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ func GetEnvVariable(envVarName string) (string, error) {
99
if key, exists := os.LookupEnv(envVarName); exists {
1010
return key, nil
1111
}
12-
return "", fmt.Errorf("'%s' field wasn't provided.", envVarName)
12+
return "", fmt.Errorf("'%s' field wasn't provided", envVarName)
1313
}
1414

1515
func IsRunningUnderGitHubAction() bool {

evidence/verify/verifiers/sigstore_verifier_test.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,6 @@ func TestSigstoreVerifier_VerifyTUFProviderError(t *testing.T) {
104104
func TestSigstoreVerifier_Creation(t *testing.T) {
105105
verifier := newSigstoreVerifier()
106106
assert.NotNil(t, verifier)
107-
108-
// Verify it implements the interface
109-
var _ sigstoreVerifierInterface = verifier
110107
}
111108

112109
func TestSigstoreVerifier_VerifyNilBundleAfterTUFSuccess(t *testing.T) {

0 commit comments

Comments
 (0)