Fix quality issues, add DeepSource config #43
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
- Summary
While the repository runs
go vet
andgo lint
as part of CI, which detects and shows some issues, it doesn't really block the PR for major issues, and the issues are raised for the entire code in the repository. Ideally, the issues should be raised for the changes in a given PR only.To solve the above problems, this PR introduces DeepSource for code quality analysis.
DeepSource is a free for open-source tool that helps developers and teams write good code. It continuously analyzes code changes on every PR and gives a central dashboard to see code health in terms of issues and important metrics. DeepSource is used by teams at Uber, NASA and DGraph among others.
I've added a customized .deepsource.toml file for this repo, and made some fixes for issues existing in the code highlighted by DeepSource. To keep analyzing code on every change, integration is easy:
You can also take a look at the docs. I'll be happy to answer any questions! :)
- Test plan
The changes to the code are such that they do not change the functionality in any way. The error handling, the removal of the unused constant and the removal of the redundant parameter (as noted in the changelog) would be caught by the go build tool if there were any new issues.
- Description for the changelog
make
for slice, where the capacity parameter is not really required.const baseConfigKey = ""
, which is not used anywhere.- A picture of a cute animal (not mandatory but encouraged)