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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Refactor code quality issues #7871

Closed
wants to merge 3 commits into from

Conversation

powerexploit
Copy link
Contributor

@powerexploit powerexploit commented Mar 26, 2021

Description

Hey 馃憢 , I'm member of the Developer Outreach team at DeepSource and ran DeepSource analysis on my fork of the repo. It found some interesting code quality improvements to consider.

This PR fixes a few of the issues detected for you to assess if it is right for you.
Happy to provide the tweaks separately otherwise :)

What problem does this PR solve?

This PR improve some code quality issues like anti-pattern and bug risks.

Important changes

  • Remove return from __init__() method
  • Remove duplicate dictionary key(s)
  • Use max built-in to get the maximum of two values
  • Remove redundant None default
  • Remove unnecessary comprehension
  • Added .deepsource.toml file for continuous analysis on bug risks/performance/code-quality issues on new changes.

- Added '.deepsource.toml' file for continuous analysis on bug risk

- Remove `return` from `__init__()` method

- Remove duplicate dictionary key(s)

- Use `max` built-in to get the maximum of two values

- Remove redundant `None` default

- Remove unnecessary comprehension

Signed-off-by: ankitdobhal <dobhal.ankit@protonmail.com>
@tomchristie tomchristie mentioned this pull request Mar 26, 2021
@tomchristie
Copy link
Member

Okay. There's some neater linting in this, but I want to drop the .deepsource.toml config, and I've omitted the test/test_fields.py changes, which don't make so much sense.

Opened #7874 based on the other minor cleanups.

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.

None yet

2 participants