Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix quality issues, add DeepSource config #43

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sourya
Copy link

@sourya sourya commented Dec 15, 2019

- Summary

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:

  1. Merge this PR.
  2. Sign up on DeepSource and grant access to this repository here.
  3. Activate analysis for this repo 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

  1. Add error handling for json.Marshal, which was previously unhandled.
  2. Remove a redundant parameter to make for slice, where the capacity parameter is not really required.
  3. Remove the const baseConfigKey = "", which is not used anywhere.

- A picture of a cute animal (not mandatory but encouraged)
Beebo

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