Skip to content

chore: Add golangci-lint and fix most issues#505

Merged
bhavanki merged 1 commit intomasterfrom
linting
Jun 7, 2024
Merged

chore: Add golangci-lint and fix most issues#505
bhavanki merged 1 commit intomasterfrom
linting

Conversation

@bhavanki
Copy link
Contributor

@bhavanki bhavanki commented Jun 5, 2024

The new make lint target runs golangci-lint if installed locally. It
is not (yet) required for a passing build.

Most issues reported by golangci-lint are resolved. Some interesting
ones:

  • Missing error checking is added for exporting to a properties file and
    to Terraform variables.
  • Unused functions are removed: stringInSlice, S3KMSStore.readObject.
  • Unused variables are removed: validKeyFormat.
  • Write operations used to set up store tests now have their errors
    checked. If a setup write fails, the test immediately fails.

Unresolved issues:

  • Use of EndpointResolverWithOptions
  • Missing error checks for flushing, syncing, and closing a file
    created by the export command

The new `make lint` target runs golangci-lint if installed locally. It
is not (yet) required for a passing build.

Most issues reported by golangci-lint are resolved. Some interesting
ones:

* Missing error checking is added for exporting to a properties file and
  to Terraform variables.
* Unused functions are removed: stringInSlice, S3KMSStore.readObject.
* Unused variables are removed: validKeyFormat.
* Write operations used to set up store tests now have their errors
  checked. If a setup write fails, the test immediately fails.

Unresolved issues:

* Use of EndpointResolverWithOptions
* Missing error checks for flushing, syncing, and closing a file
  created by the export command
@bhavanki bhavanki requested a review from a team as a code owner June 5, 2024 20:26
@codecov
Copy link

codecov bot commented Jun 5, 2024

Codecov Report

Attention: Patch coverage is 6.45161% with 29 lines in your changes missing coverage. Please review.

Project coverage is 36.17%. Comparing base (9fa06b1) to head (a693d26).

Files Patch % Lines
cmd/export.go 0.00% 7 Missing ⚠️
cmd/root.go 0.00% 4 Missing ⚠️
store/s3store.go 0.00% 3 Missing ⚠️
store/s3storeKMS.go 0.00% 3 Missing ⚠️
cmd/exec.go 0.00% 2 Missing ⚠️
cmd/write.go 0.00% 2 Missing ⚠️
cmd/delete.go 0.00% 1 Missing ⚠️
cmd/env.go 0.00% 1 Missing ⚠️
cmd/history.go 0.00% 1 Missing ⚠️
cmd/import.go 0.00% 1 Missing ⚠️
... and 4 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #505      +/-   ##
==========================================
+ Coverage   35.81%   36.17%   +0.35%     
==========================================
  Files          25       25              
  Lines        2284     2256      -28     
==========================================
- Hits          818      816       -2     
+ Misses       1394     1368      -26     
  Partials       72       72              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bhavanki bhavanki merged commit 6e1ecd6 into master Jun 7, 2024
@bhavanki bhavanki deleted the linting branch June 7, 2024 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants