While the repository runs go vet and go 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:
Merge this PR.
Sign up on DeepSource and grant access to this repository here.
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
Add error handling for json.Marshal, which was previously unhandled.
Remove a redundant parameter to make for slice, where the capacity parameter is not really required.
Remove the const baseConfigKey = "", which is not used anywhere.
- A picture of a cute animal (not mandatory but encouraged)
- 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)